Skip to content

Commit d7f6f93

Browse files
authored
Reorganize install and getting started docs (#114)
* Reorganize install and getting started docs * add docs badge * fix example
1 parent aa1ae44 commit d7f6f93

File tree

7 files changed

+25
-33
lines changed

7 files changed

+25
-33
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!--header-start-->
22

3-
# Django IDOM &middot; [![Tests](https://github.com/idom-team/django-idom/workflows/Test/badge.svg?event=push)](https://github.com/idom-team/django-idom/actions?query=workflow%3ATest) [![PyPI Version](https://img.shields.io/pypi/v/django-idom.svg)](https://pypi.python.org/pypi/django-idom) [![License](https://img.shields.io/badge/License-MIT-purple.svg)](https://github.com/idom-team/django-idom/blob/main/LICENSE)
3+
# Django IDOM &middot; [![Tests](https://github.com/idom-team/django-idom/workflows/Test/badge.svg?event=push)](https://github.com/idom-team/django-idom/actions?query=workflow%3ATest) [![PyPI Version](https://img.shields.io/pypi/v/django-idom.svg?label=PyPI)](https://pypi.python.org/pypi/django-idom) [![License](https://img.shields.io/badge/License-MIT-purple.svg)](https://github.com/idom-team/django-idom/blob/main/LICENSE) [![Docs](https://img.shields.io/website?down_message=offline&label=Docs&logo=read%20the%20docs&logoColor=white&up_message=online&url=https%3A%2F%2Fidom-team.github.io%2Fdjango-idom%2F)](https://idom-team.github.io/django-idom/)
44

55
<!--header-end-->
66
<!--intro-start-->

docs/src/features/settings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
???+ summary
22

3-
Django IDOM uses your **Django project's** `settings.py` file to modify the behavior of IDOM.
3+
Django-IDOM uses your **Django project's** `settings.py` file to modify the behavior of IDOM.
44

55
## Primary Configuration
66

docs/src/features/templatetag.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107

108108
??? question "What is a "template tag"?"
109109

110-
You can think of template tags as Django's way of allowing you to run Python code within your HTML. Django IDOM uses a `#!jinja {% component ... %}` template tag to perform it's magic.
110+
You can think of template tags as Django's way of allowing you to run Python code within your HTML. Django-IDOM uses a `#!jinja {% component ... %}` template tag to perform it's magic.
111111

112112
Keep in mind, in order to use the `#!jinja {% component ... %}` tag, you will need to first call `#!jinja {% load idom %}` to gain access to it.
113113

docs/src/getting-started/initial-steps.md renamed to docs/src/getting-started/choose-django-app.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,12 @@
44

55
---
66

7-
If you have reached this point, you should have already [installed Django-IDOM](../installation/index.md) through the previous steps.
7+
If you have reached this point, you should have already [installed Django-IDOM](../getting-started/installation.md) through the previous steps.
8+
9+
You will now need to pick at least one **Django app** to start using Django-IDOM on.
810

911
For the examples within this section, we will assume you have placed the files [generated by `startapp`](https://docs.djangoproject.com/en/dev/intro/tutorial01/#creating-the-polls-app) directly into your **Django project** folder. This is common for small projects.
1012

1113
??? question "How do I organize my Django project for IDOM?"
1214

1315
Django-IDOM has no project structure requirements. Organize everything as you wish, just like any **Django project**.
14-
15-
??? question "I have never used Django, what do I need to learn?"
16-
17-
{% include-markdown "../installation/index.md" start="<!--dj-proj-start-->" end="<!--dj-proj-end-->" %}
18-
19-
Afterwards, make sure to follow the [Django-IDOM installation instructions](../installation/index.md).

docs/src/getting-started/create-component.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414

1515
You have full freedom in naming/placement of your files and functions.
1616

17-
You should determine the best way to sort your Python modules and component functions to fit your needs.
17+
We recommend creating a `components.py` for small **Django apps**. If your app has a lot of components, you should consider breaking them apart into individual modules such as `components/navbar.py`.
1818

1919
Ultimately, components are referenced by Python dotted path in `my-template.html` (_see next step_). So, at minimum this path needs to be valid to Python's `importlib`.

docs/src/installation/index.md renamed to docs/src/getting-started/installation.md

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
???+ tip "Learning Django first is recommended!"
1+
???+ summary
22

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-->
3+
Django-IDOM can be installed from PyPI to an existing **Django project** with minimal configuration.
44

5-
## Install from PyPI
5+
## Step 0: Set up a Django Project
6+
7+
These docs assumes you have already created [a **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_.
8+
9+
## Step 1: Install from PyPI
610

711
```bash
812
pip install django-idom
913
```
1014

11-
You will also need to modify a few files in your **Django project**...
12-
13-
---
14-
15-
## Configure [`settings.py`](https://docs.djangoproject.com/en/dev/topics/settings/)
15+
## Step 2: Configure [`settings.py`](https://docs.djangoproject.com/en/dev/topics/settings/)
1616

1717
In your settings you will need to add `django_idom` to [`INSTALLED_APPS`](https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-INSTALLED_APPS).
1818

@@ -47,11 +47,9 @@ In your settings you will need to add `django_idom` to [`INSTALLED_APPS`](https:
4747

4848
Below are a handful of values you can change within `settings.py` to modify the behavior of IDOM.
4949

50-
{% include-markdown "../features/settings.md" start="<!--settings-start-->" end="<!--settings-end-->" %}
51-
52-
---
50+
{% include-markdown "../features/settings.md" start="<!--settings-start-->" end="<!--settings-end-->" preserve-includer-indent=false %}
5351

54-
## Configure [`urls.py`](https://docs.djangoproject.com/en/dev/topics/http/urls/)
52+
## Step 3: Configure [`urls.py`](https://docs.djangoproject.com/en/dev/topics/http/urls/)
5553

5654
Add IDOM HTTP paths to your `urlpatterns`.
5755

@@ -66,9 +64,7 @@ Add IDOM HTTP paths to your `urlpatterns`.
6664
]
6765
```
6866

69-
---
70-
71-
## Configure [`asgi.py`](https://docs.djangoproject.com/en/dev/howto/deployment/asgi/)
67+
## Step 4: Configure [`asgi.py`](https://docs.djangoproject.com/en/dev/howto/deployment/asgi/)
7268

7369
Register IDOM's Websocket using `IDOM_WEBSOCKET_PATH`.
7470

mkdocs.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
nav:
33
- Home: index.md
4-
- Installation: installation/index.md
54
- Getting Started:
6-
- 1. Initial Steps: getting-started/initial-steps.md
7-
- 2. Create a Component: getting-started/create-component.md
8-
- 3. Use the Template Tag: getting-started/reference-component.md
9-
- 4. Render Your View: getting-started/render-view.md
10-
- 5. Learn More: getting-started/learn-more.md
5+
- 1. Install Django-IDOM: getting-started/installation.md
6+
- 2. Choose a Django App: getting-started/choose-django-app.md
7+
- 3. Create a Component: getting-started/create-component.md
8+
- 4. Use the Template Tag: getting-started/reference-component.md
9+
- 5. Render Your View: getting-started/render-view.md
10+
- 6. Learn More: getting-started/learn-more.md
1111
- Usage:
1212
- Components: features/components.md
1313
- Hooks: features/hooks.md
@@ -89,5 +89,5 @@ copyright: Copyright &copy; 2022 IDOM Team
8989
repo_url: https://github.com/idom-team/django-idom
9090
site_url: https://idom-team.github.io/django-idom
9191
repo_name: idom-team/django-idom
92-
edit_uri: edit/docs
92+
edit_uri: edit/main/docs/src
9393
docs_dir: docs/src

0 commit comments

Comments
 (0)