Skip to content

Commit b9ca296

Browse files
authored
Minor docs styling, formatting, and grammar improvements (#76)
* Minor readme cleanup * Minor grammar cleanup * Remove "next section" from footer * Remove "Made with mkdocs" from footer * Refresh on changes made to readme and changelog * Add copyright to footer * Automatically change color scheme based on system theme * Pin navbar color to black * Put "Django developer" assumption into a tip box * clean up Enable Django ASGI warning * bold "Django Project" * "Learning Django first is recommended!" * change tagline to "ReactJS for Django Developers" * add "Looking for more hooks?" * add more details to HelloWorld readme paragraph * update notice on Use Location hook
1 parent ccd0673 commit b9ca296

File tree

9 files changed

+50
-22
lines changed

9 files changed

+50
-22
lines changed

Diff for: README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
<!--header-end-->
66
<!--intro-start-->
77

8-
Django-IDOM connects your project to a ReactJS frontend, allowing you to create **interactive websites without needing JavaScript!**
8+
Django-IDOM connects your Python project to a ReactJS frontend, allowing you to create **interactive websites without needing JavaScript!**
99

1010
Following ReactJS styling, web elements are combined into [reusable "components"](https://idom-docs.herokuapp.com/docs/guides/creating-interfaces/your-first-components/index.html#parametrizing-components). These components can utilize [hooks](https://idom-docs.herokuapp.com/docs/reference/hooks-api.html) and [events](https://idom-docs.herokuapp.com/docs/guides/adding-interactivity/responding-to-events/index.html#async-event-handlers) to create infinitely complex web pages.
1111

1212
When needed, IDOM can [use components directly from NPM](https://idom-docs.herokuapp.com/docs/guides/escape-hatches/javascript-components.html#dynamically-loaded-components). For additional flexibility, components can also be [fully developed in JavaScript](https://idom-docs.herokuapp.com/docs/guides/escape-hatches/javascript-components.html#custom-javascript-components).
1313

1414
Any Python web framework with Websockets can support IDOM. See below for what frameworks are supported out of the box.
1515

16-
| Supported Frameworks | Supported Frameworks (External) |
17-
| ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
16+
| Supported Frameworks | Supported Frameworks (External) |
17+
| --- | --- |
1818
| [`Flask`, `FastAPI`, `Sanic`, `Tornado`](https://idom-docs.herokuapp.com/docs/guides/getting-started/installing-idom.html#officially-supported-servers) | [`Django`](https://github.com/idom-team/django-idom), [`Plotly-Dash`](https://github.com/idom-team/idom-dash), [`Jupyter`](https://github.com/idom-team/idom-jupyter) |
1919

2020
<!--intro-end-->
@@ -27,7 +27,7 @@ Any Python web framework with Websockets can support IDOM. See below for what fr
2727

2828
<!--py-header-start-->
2929

30-
You'll need a file to define your [IDOM](https://github.com/idom-team/idom) components. We recommend creating a `components.py` file within your chosen **Django app** to start out.
30+
You'll need a file to define your [IDOM](https://github.com/idom-team/idom) components. We recommend creating a `components.py` file within your chosen **Django app** to start out. Within this file, we will create a simple `HelloWorld` component.
3131

3232
<!--py-header-end-->
3333
<!--py-code-start-->
@@ -76,4 +76,5 @@ Follow the links below to find out more about this project.
7676
- [Try it Now](https://mybinder.org/v2/gh/idom-team/idom-jupyter/main?urlpath=lab/tree/notebooks/introduction.ipynb) - Check out IDOM in a Jupyter Notebook.
7777
- [Documentation](https://idom-team.github.io/django-idom) - Learn how to install, run, and use IDOM.
7878
- [Community Forum](https://github.com/idom-team/idom/discussions) - Ask questions, share ideas, and show off projects.
79+
7980
<!--resources-end-->

Diff for: docs/contribute/django-idom.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
???+ tip "Looking to contribute features that are not Django specific?"
22

3-
Everything within the `django-idom` repository must be specific to Django integration. Check out the [IDOM Core documentation](https://idom-docs.herokuapp.com/docs/about/contributor-guide.html) to contribute general features, such as: components, hooks, events, etc.
3+
Everything within the `django-idom` repository must be specific to Django integration. Check out the [IDOM Core documentation](https://idom-docs.herokuapp.com/docs/about/contributor-guide.html) to contribute general features such as: components, hooks, events, and more.
44

55
If you plan to make code changes to this repository, you'll need to install the following dependencies first:
66

Diff for: docs/features/hooks.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Django Hooks
22

3+
???+ tip "Looking for more hooks?"
4+
5+
Check out the [IDOM Core docs](https://idom-docs.herokuapp.com/docs/reference/hooks-api.html?highlight=hooks) on hooks!
6+
37
## Use Websocket
48

59
You can fetch the Django Channels websocket at any time by using `use_websocket`.
@@ -36,7 +40,7 @@ def MyComponent():
3640

3741
??? info "This hook's behavior will be changed in a future update"
3842

39-
This hook will eventually be updated to return the client's current webpage URL. This will come in alongside our built-in [Single Page Application (SPA) support](https://github.com/idom-team/idom/issues/569).
43+
This hook will be updated to return the browser's current URL. This will come in alongside our built-in [Single Page Application (SPA) support](https://github.com/idom-team/idom/issues/569).
4044

4145
This is a shortcut that returns the Websocket's `path`.
4246

Diff for: docs/getting-started/initial-steps.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
???+ summary
22

3-
Set up a Django Project with at least one app.
3+
Set up a **Django Project** with at least one app.
44

55
---
66

@@ -10,7 +10,7 @@ For the examples within this section, we will assume you've placed the files [ge
1010

1111
??? question "How do I organize my Django project for IDOM?"
1212

13-
Django-IDOM has no project structure requirements. Organize everything as you wish, just like any Django project.
13+
Django-IDOM has no project structure requirements. Organize everything as you wish, just like any **Django project**.
1414

1515
??? question "I've never used Django, what do I need to learn?"
1616

Diff for: docs/getting-started/render-view.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ Now, navigate to `http://127.0.0.1:8000/example/`. If you copy-pasted the compon
3232

3333
??? question "Which urls.py do I add my views to?"
3434

35-
For simple Django projects, you can easily add all of your views directly into the **Django project**'s `urls.py`. However, as you start increase your project's complexity you might end up with way too much within one file.
35+
For simple **Django projects**, you can easily add all of your views directly into the **Django project's** `urls.py`. However, as you start increase your project's complexity you might end up with way too much within one file.
3636

3737
Once you reach that point, we recommend creating an individual `urls.py` within each of your **Django apps**.
3838

39-
Then, within your **Django project**'s `urls.py` you will use Django's [`include` function](https://docs.djangoproject.com/en/dev/ref/urls/) to link it all together.
39+
Then, within your **Django project's** `urls.py` you will use Django's [`include` function](https://docs.djangoproject.com/en/dev/ref/urls/) to link it all together.

Diff for: docs/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ hide:
66

77
{% include-markdown "../README.md" start="<!--header-start-->" end="<!--header-end-->" %}
88

9-
## It's React for Django Developers.
9+
## ReactJS for Django Developers.
1010

1111
---
1212

Diff for: docs/installation/index.md

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
<!--dj-proj-start-->
1+
???+ tip "Learning Django first is recommended!"
22

3-
These docs assumes you have created [a basic **Django project**](https://docs.djangoproject.com/en/dev/intro/tutorial01/), which also involves generating/installing at least one **Django app**. If not, check out this [9 minute YouTube tutorial](https://www.youtube.com/watch?v=ZsJRXS_vrw0) created by _IDG TECHtalk_.
4-
5-
<!--dj-proj-end-->
3+
<!--dj-proj-start-->These docs assumes you have created [a basic **Django project**](https://docs.djangoproject.com/en/dev/intro/tutorial01/), which involves creating and installing at least one **Django app**. If not, check out this [9 minute YouTube tutorial](https://www.youtube.com/watch?v=ZsJRXS_vrw0) created by _IDG TECHtalk_.<!--dj-proj-end-->
64

75
## Install from PyPI
86

97
```bash
108
pip install django-idom
119
```
1210

13-
You'll also need to modify a few files in your Django project...
11+
You'll also need to modify a few files in your **Django project**...
1412

1513
---
1614

@@ -25,11 +23,14 @@ INSTALLED_APPS = [
2523
]
2624
```
2725

28-
??? warning "Enabling ASGI on Django (Required)"
26+
??? warning "Enable Django ASGI (Required)"
2927

3028
Django-IDOM requires ASGI in order to use Websockets.
3129

32-
If you haven't [enabled ASGI](https://channels.readthedocs.io/en/stable/installation.html) on your Django project yet, you'll need to add `channels` to `INSTALLED_APPS` and set your `ASGI_APPLICATION` variable.
30+
If you haven't enabled ASGI on your **Django project** yet, you'll need to add `channels` to `INSTALLED_APPS` and set your `ASGI_APPLICATION` variable.
31+
32+
Read the [Django Channels Docs](https://channels.readthedocs.io/en/stable/installation.html) for more info.
33+
3334
```python title="settings.py"
3435
INSTALLED_APPS = [
3536
"channels",

Diff for: docs/stylesheets/extra.css

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.md-footer__inner {
2+
display: none;
3+
}
4+
5+
.md-tabs,
6+
.md-header {
7+
background-color: var(--md-footer-bg-color--dark);
8+
}

Diff for: mkdocs.yml

+18-4
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,15 @@ nav:
2020
theme:
2121
name: material
2222
palette:
23-
- scheme: slate
23+
- media: "(prefers-color-scheme: dark)"
24+
scheme: slate
2425
toggle:
2526
icon: material/toggle-switch
2627
name: Switch to light mode
2728
primary: deep-orange
28-
accent: deep-orange
29-
- scheme: default
29+
accent: orange
30+
- media: "(prefers-color-scheme: light)"
31+
scheme: default
3032
toggle:
3133
icon: material/toggle-switch-off-outline
3234
name: Switch to dark mode
@@ -37,7 +39,6 @@ theme:
3739
- navigation.tabs
3840
- toc.integrate
3941
- navigation.top
40-
4142
icon:
4243
repo: fontawesome/brands/github
4344

@@ -60,9 +61,22 @@ plugins:
6061
- git-revision-date-localized:
6162
fallback_to_build_date: true
6263

64+
extra:
65+
generator: false
66+
67+
extra_css:
68+
- stylesheets/extra.css
69+
70+
watch:
71+
- docs
72+
- mkdocs.yml
73+
- README.md
74+
- CHANGELOG.md
75+
6376
site_name: Django IDOM Docs
6477
site_author: Archmonger
6578
site_description: React for Django developers.
79+
copyright: Copyright &copy; 2022 IDOM Team
6680
repo_url: https://github.com/idom-team/django-idom
6781
site_url: https://idom-team.github.io/django-idom
6882
repo_name: idom-team/django-idom

0 commit comments

Comments
 (0)