Skip to content

Commit

Permalink
update docs with major overhaul (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuadavidthomas authored Feb 23, 2024
1 parent 27572da commit cf7312f
Show file tree
Hide file tree
Showing 13 changed files with 76 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -190,3 +190,6 @@ mediafiles/

# pyright config for nvim-lspconfig
pyrightconfig.json

# auto-generated apidocs
apidocs/
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ We adhere to Django's Code of Conduct in all interactions and expect all contrib

## Setup

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.
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.

1. Fork the repository and clone it locally.
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:
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# django-simple-nav

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

- Python 3.8, 3.9, 3.10, 3.11, 3.12
- Django 3.2, 4.2, 5.0
<!-- intro-end -->

## Getting Started

<!-- getting-started-start -->
1. **Install the package from PyPI.**

```bash
Expand All @@ -33,9 +36,11 @@
...,
]
```
<!-- getting-started-end -->

## Usage

<!-- usage-start -->
1. **Create a navigation definition.**

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.
Expand Down Expand Up @@ -199,6 +204,7 @@
```

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.
<!-- usage-end -->

## Documentation

Expand Down
4 changes: 3 additions & 1 deletion RELEASING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Releasing a New Version

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

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

3. Ensure the [CHANGELOG](CHANGELOG.md) is up to date. If updates are needed, add them now in the release branch.
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.

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

Expand All @@ -73,3 +74,4 @@ When it comes time to cut a new release, follow these steps:
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).

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.
<!-- releasing-end -->
3 changes: 3 additions & 0 deletions docs/_static/css/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#django-simple-nav p .reference img {
vertical-align: inherit;
}
3 changes: 3 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```{include} ../CHANGELOG.md
```
10 changes: 9 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"autodoc2",
"myst_parser",
"sphinx_copybutton",
"sphinx_inline_tabs",
"sphinx.ext.autodoc",
"sphinx.ext.napoleon",
]

Expand All @@ -62,6 +62,10 @@
copybutton_selector = "div.copy pre"
copybutton_prompt_text = "$ "

# -- Options for autodoc2 -----------------------------------------------------
autodoc2_packages = [f"../src/{project.replace('-', '_')}"]

autodoc2_render_plugin = "myst"

# -- Options for HTML output -------------------------------------------------

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

html_css_files = [
"css/custom.css",
]

html_title = project

html_theme_options = {
Expand Down
5 changes: 5 additions & 0 deletions docs/development/contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
```{include} ../../CONTRIBUTING.md
```

The next section has more information about which `just` commands are available.
8 changes: 8 additions & 0 deletions docs/development/releasing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Releasing

## Releasing a New Version

```{include} ../../RELEASING.md
:start-after: <!-- releasing-start -->
:end-before: <!-- releasing-end -->
```
6 changes: 6 additions & 0 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Getting Started

```{include} ../README.md
:start-after: <!-- getting-started-start -->
:end-before: <!-- getting-started-end -->
```
22 changes: 22 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,33 @@
# django-simple-nav

```{include} ../README.md
:start-after: <!-- intro-start -->
:end-before: <!-- intro-end -->
```

```{toctree}
:hidden:
:maxdepth: 3
getting-started.md
usage.md
changelog.md
```

```{toctree}
:hidden:
:maxdepth: 3
:caption: Reference
apidocs/index.rst
```

```{toctree}
:hidden:
:maxdepth: 3
:caption: Development
development/contributing.md
development/just.md
development/releasing.md
```
6 changes: 6 additions & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Usage

```{include} ../README.md
:start-after: <!-- usage-start -->
:end-before: <!-- usage-end -->
```
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ docs = [
"myst-parser",
"sphinx",
"sphinx-autobuild",
"sphinx-autodoc2",
"sphinx-copybutton",
"sphinx-inline-tabs"
]
Expand Down

0 comments on commit cf7312f

Please sign in to comment.