Skip to content

Commit cf7312f

Browse files
update docs with major overhaul (#38)
1 parent 27572da commit cf7312f

File tree

13 files changed

+76
-3
lines changed

13 files changed

+76
-3
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,3 +190,6 @@ mediafiles/
190190

191191
# pyright config for nvim-lspconfig
192192
pyrightconfig.json
193+
194+
# auto-generated apidocs
195+
apidocs/

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ We adhere to Django's Code of Conduct in all interactions and expect all contrib
1010

1111
## Setup
1212

13-
The following setup steps assume you are using a Unix-like operating system, such as Linux or macOS, and that you have a [supported](README.md#requirements) version of Python installed. If you are using Windows, you will need to adjust the commands accordingly. If you do not have Python installed, you can visit [python.org](https://www.python.org/) for instructions on how to install it for your operating system.
13+
The following setup steps assume you are using a Unix-like operating system, such as Linux or macOS, and that you have a [supported](https://django-simple-nav.westervelt.dev/en/latest/#requirements) version of Python installed. If you are using Windows, you will need to adjust the commands accordingly. If you do not have Python installed, you can visit [python.org](https://www.python.org/) for instructions on how to install it for your operating system.
1414

1515
1. Fork the repository and clone it locally.
1616
2. Create a virtual environment and activate it. You can use whatever tool you prefer for this. Below is an example using the Python standard library's `venv` module:

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# django-simple-nav
22

3+
<!-- intro-start -->
34
[![PyPI](https://img.shields.io/pypi/v/django-simple-nav)](https://pypi.org/project/django-simple-nav/)
45
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/django-simple-nav)
56
![Django Version](https://img.shields.io/badge/django-3.2%20%7C%204.2%20%7C%205.0-%2344B78B?labelColor=%23092E20)
@@ -13,9 +14,11 @@
1314

1415
- Python 3.8, 3.9, 3.10, 3.11, 3.12
1516
- Django 3.2, 4.2, 5.0
17+
<!-- intro-end -->
1618

1719
## Getting Started
1820

21+
<!-- getting-started-start -->
1922
1. **Install the package from PyPI.**
2023

2124
```bash
@@ -33,9 +36,11 @@
3336
...,
3437
]
3538
```
39+
<!-- getting-started-end -->
3640

3741
## Usage
3842

43+
<!-- usage-start -->
3944
1. **Create a navigation definition.**
4045

4146
Define your navigation structure in a Python file. This file can be located anywhere in your Django project, provided it's importable. You can also split the navigations across multiple files if desired.
@@ -199,6 +204,7 @@
199204
```
200205

201206
After configuring your navigation, you can use it across your Django project by calling the `django_simple_nav` template tag in your templates. This tag dynamically renders navigation based on your defined structure, ensuring a consistent and flexible navigation experience throughout your application.
207+
<!-- usage-end -->
202208

203209
## Documentation
204210

RELEASING.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Releasing a New Version
22

3+
<!-- releasing-start -->
34
When it comes time to cut a new release, follow these steps:
45

56
1. Create a new git branch off of `main` for the release.
@@ -52,7 +53,7 @@ When it comes time to cut a new release, follow these steps:
5253
bumpver update --tag=final
5354
```
5455

55-
3. Ensure the [CHANGELOG](CHANGELOG.md) is up to date. If updates are needed, add them now in the release branch.
56+
3. Ensure the [CHANGELOG](https://github.com/westerveltco/django-simple-nav/CHANGELOG.md) is up to date. If updates are needed, add them now in the release branch.
5657

5758
4. Create a pull request from the release branch to `main`.
5859

@@ -73,3 +74,4 @@ When it comes time to cut a new release, follow these steps:
7374
We try our best to adhere to [Semantic Versioning](https://semver.org/), but we do not promise to follow it perfectly (and let's be honest, this is the case with a lot of projects using SemVer).
7475

7576
In general, use your best judgement when choosing the next version number. If you are unsure, you can always ask for a second opinion from another contributor.
77+
<!-- releasing-end -->

docs/_static/css/custom.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#django-simple-nav p .reference img {
2+
vertical-align: inherit;
3+
}

docs/changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```{include} ../CHANGELOG.md
2+
3+
```

docs/conf.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@
4040
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
4141
# ones.
4242
extensions = [
43+
"autodoc2",
4344
"myst_parser",
4445
"sphinx_copybutton",
4546
"sphinx_inline_tabs",
46-
"sphinx.ext.autodoc",
4747
"sphinx.ext.napoleon",
4848
]
4949

@@ -62,6 +62,10 @@
6262
copybutton_selector = "div.copy pre"
6363
copybutton_prompt_text = "$ "
6464

65+
# -- Options for autodoc2 -----------------------------------------------------
66+
autodoc2_packages = [f"../src/{project.replace('-', '_')}"]
67+
68+
autodoc2_render_plugin = "myst"
6569

6670
# -- Options for HTML output -------------------------------------------------
6771

@@ -75,6 +79,10 @@
7579
# so a file named "default.css" will overwrite the builtin "default.css".
7680
html_static_path = ["_static"]
7781

82+
html_css_files = [
83+
"css/custom.css",
84+
]
85+
7886
html_title = project
7987

8088
html_theme_options = {

docs/development/contributing.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
```{include} ../../CONTRIBUTING.md
2+
3+
```
4+
5+
The next section has more information about which `just` commands are available.

docs/development/releasing.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Releasing
2+
3+
## Releasing a New Version
4+
5+
```{include} ../../RELEASING.md
6+
:start-after: <!-- releasing-start -->
7+
:end-before: <!-- releasing-end -->
8+
```

docs/getting-started.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Getting Started
2+
3+
```{include} ../README.md
4+
:start-after: <!-- getting-started-start -->
5+
:end-before: <!-- getting-started-end -->
6+
```

0 commit comments

Comments
 (0)