-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature] Pull docs from OpenWISP modules to create a unified documentation Website #107 #189
Changes from all commits
a6342ae
3ca0ef0
ea42d8d
7176457
e120afe
f6a5d5d
8fe9c57
b14c12c
b22017c
4479c44
72f3444
bbae5d3
8302d7b
a0a027a
95c49f2
c0164ab
d526095
0b0c2ad
ceb770f
979b829
1296c63
d394335
189fd3a
ce84397
12b43eb
fa2959e
b08103b
9b29347
85149c1
e6671ad
3093cb2
788c4e2
2b4e451
48894d4
5517a88
bc06e57
ce61324
ff6b451
1563161
a177bbe
f624cf1
f92705a
a00dd19
aa7db67
408034a
d5aeb9a
ef2b23d
947cbf2
ac33ae4
26153a0
0697b31
7568a2d
08fe264
b12fd53
abe06dd
d4a1409
782dc5e
8c8d824
f869b45
ee2de11
3786f04
bea59ca
990562d
fb80a00
e9e4bb0
2bf9402
ab079a3
fd95314
9ab038b
0cf8c00
9d77a90
ba27b4b
6fbfd46
45a73af
58a85c7
1b6e2f8
3229d16
a2ba1b2
89670fe
7dbcd1c
56772fc
8bd6dba
cdd3aaa
e356149
01d9783
d1e81cf
74d554c
c9c6b17
3ee187d
ba2db0f
162218d
3d06e7f
149569b
c7eba3f
f5ea01d
d02355a
23fbb12
61d199d
165c8b9
a0f1f2b
fac5622
389ca12
0560c72
f3184c1
317e1a7
4b3c9f4
4526055
7a42dc8
5aa0373
8ef2a45
899eb3b
a67cf1e
8b43143
ccd4fa2
a431696
fc0c301
ad83f52
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "pip" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "monthly" | ||
commit-message: | ||
prefix: "[deps] " | ||
- package-ecosystem: "github-actions" # Check for GitHub Actions updates | ||
directory: "/" # The root directory where the Ansible role is located | ||
schedule: | ||
interval: "monthly" # Check for updates weekly | ||
commit-message: | ||
prefix: "[ci] " |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,157 @@ | ||
======================== | ||
OpenWISP 2 Documentation | ||
======================== | ||
OpenWISP Documentation | ||
====================== | ||
|
||
This repository aims to help out **new users and contributors** to get | ||
start using and getting involved in `OpenWISP <http://openwisp.org>`_. | ||
This repository contains the main source of the Unified Documentation of | ||
OpenWISP, published at `openwisp.io/docs <https://openwisp.io/docs>`_. | ||
|
||
This repo at this stage is pretty much a work in progress, so | ||
contributions, feedback and suggestions are very welcome. | ||
It implements logic which pulls source documents from different OpenWISP | ||
modules in order to build a single unified documentation website. | ||
|
||
How to build the docs | ||
--------------------- | ||
|
||
Requirements: Python >= 3.9. | ||
|
||
1. Fork this repository | ||
2. Clone this repository using the following command: | ||
|
||
2. Clone this repository using the following command:: | ||
.. code-block:: shell | ||
|
||
git clone https://github.com/<your-username>/openwisp2-docs.git | ||
git clone https://github.com/<your-username>/openwisp2-docs.git | ||
nemesifier marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
3. Install sphinx on your local machine using:: | ||
3. Install sphinx on your local machine using: | ||
|
||
.. code-block:: shell | ||
|
||
pip install -r requirements.txt | ||
|
||
4. Build HTML:: | ||
4. You can build the documentation using the following command | ||
|
||
.. code-block:: shell | ||
|
||
# This command will generate the documentation in all formats - HTML, PDF and ePUB | ||
make build | ||
# The ``formats`` argument is a comma separated list of formats to build, | ||
# e.g. ``formats=html,pdf,epub``. The default is to build all available | ||
# formats, which currently are ``html``, ``pdf`` and ``epub``. | ||
make build formats=pdf,html | ||
# This command is a shortcut for generating only HTML documentation during | ||
# development, since building PDF and ePUB takes time. It also supports | ||
# the VERSION argument. | ||
make build_html | ||
|
||
make html | ||
.. | ||
note: | ||
|
||
Please refer the "`build options" <#build-options>`_section of this | ||
configuration for a complete reference of the available options. | ||
|
||
5. Open the generated HTML files in your browser. | ||
|
||
Build options | ||
------------- | ||
|
||
Building different formats | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
By default, the ``make build`` command will generate documentation in all | ||
supported output formats: HTML, PDF, and ePUB. | ||
|
||
If you want to generate the documentation in specific formats, you can | ||
specify the ``FORMATS`` argument. The ``FORMATS`` argument accepts a | ||
comma-separated list of formats to generate. The supported formats are: | ||
|
||
- ``html``: HTML documentation | ||
- ``pdf``: PDF documentation | ||
- ``epub``: ePUB documentation | ||
|
||
For example, to generate only HTML and PDF documentation, you can run: | ||
|
||
.. code-block:: shell | ||
|
||
make build FORMATS=html,pdf | ||
|
||
To generate all supported formats, just omit the ``FORMATS`` argument: | ||
|
||
.. code-block:: shell | ||
|
||
make build | ||
|
||
.. code-block:: shell | ||
|
||
# This command will only generate HTML | ||
make build FORMATS=html | ||
|
||
Building specific version | ||
~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
By default, the ``make build`` command will generate documentation for all | ||
the versions defined in ``config.yml``. | ||
|
||
If you want to generate the documentation for a specific version, you can | ||
do so by using the ``VERSION`` argument. ``VERSION`` accepts any version | ||
that is specified in the ``config.yml`` file. | ||
|
||
For example, if you want to generate documentation for the ``dev`` | ||
version, you can run: | ||
|
||
.. code-block:: shell | ||
|
||
make build VERSION=dev | ||
|
||
This is useful if you only want to generate documentation for the version | ||
you are currently working on, or if you want to generate documentation for | ||
a specific version without having to rebuild all the other versions as | ||
well. | ||
|
||
Overriding a module of a version | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
The ``make build`` command is programmed to generate the documentation for | ||
the modules that are defined in the ``config.yml`` file. Sometimes, it may | ||
be necessary to override the branch/remote of a module defined in the | ||
``config.yml`` file to build the documentation for a specific version or | ||
to test a specific commit/branch of a module. | ||
|
||
You can do so by using the ``MODULES`` argument. ``MODULES`` accepts a | ||
comma separated string where each item is of the following format: | ||
|
||
.. code-block:: text | ||
|
||
version=<openwisp-version>,repository=<repo-owner>/<repo-name>,branch=<branch-name> | ||
|
||
E.g. if you want to build the documentation for the ``dev`` version, but | ||
want to use the ``feature`` branch of openwisp-controller of your fork, | ||
then the command will be: | ||
|
||
.. code-block:: shell | ||
|
||
make build MODULES="version=dev:repository=<your-username>/openwisp-controller:branch=feature" | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we already have the version flag, why allow to specify the version here too? Seems redundant to me. Why not just:
Can you allow something like this?
In this case, if nothing is specified, we can assume this is the list of module we want to build, so use the defaults provided in the config YAML but build only these modules instead of all of them. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
How will this help us in using the script programmatically? If you want to do this for quick builds, you can temporarily comment out the modules from config.yml There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The E.g. you can have something like this
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok let's leave this for now. |
||
The ``MODULES`` argument allows you to override the default settings for a | ||
single module, or multiple modules, defined in the ``config.yml`` file. | ||
|
||
You can use the ``MODULES`` argument to add modules to a version that is | ||
not defined in the ``config.yml`` file. | ||
|
||
Building with SSH remotes | ||
~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
By default, the OpenWISP modules are cloned over HTTPS. This may pose a | ||
hurdle if you wish to make changes to the cloned modules and push them to | ||
the remote URL. To use SSH remotes, you can set the environment variable | ||
``SSH=1``. This will instruct the build to clone the modules using SSH | ||
instead of HTTPS. For example: | ||
|
||
.. code-block:: shell | ||
|
||
SSH=1 make build | ||
|
||
Need help? | ||
---------- | ||
|
||
- If any help regarding installing and using `sphinx` and | ||
`reStructured Text` is required then please visit this | ||
`link <http://www.sphinx-doc.org/en/stable/tutorial.html>`_. | ||
|
||
- If any help regarding installing and using `sphinx` and `reStructured | ||
Text` is required then please visit this `link | ||
<http://www.sphinx-doc.org/en/stable/tutorial.html>`_. | ||
- Feel free to post any doubt or comment through our `support channels | ||
<http://openwisp.org/support.html>`_. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta http-equiv="refresh" content="0; URL='{{ docs_root }}/{{ stable_version }}/index.html'" /> | ||
</head> | ||
<body> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
styles: | ||
heading: | ||
borderPadding: | ||
- 5 | ||
- 0 | ||
- 5 | ||
- 10 | ||
spaceAfter: 16 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.