|
| 1 | +======================= |
| 2 | +LibreSign Documentation |
| 3 | +======================= |
| 4 | + |
| 5 | +Documentation is published on `<https://docs.libresign.coop>`_. |
| 6 | +To edit it yourself, you need to tinker a bit with Git and Sphinx. |
| 7 | +See the `Style Guide <https://github.com/nextcloud/documentation/blob/master/style_guide.rst>`_ for formatting and style conventions. |
| 8 | + |
| 9 | +Manuals |
| 10 | +------- |
| 11 | + |
| 12 | +This repository hosts three manuals: |
| 13 | + |
| 14 | +* **Users' Manual** |
| 15 | +* **Administration Manual** |
| 16 | +* **Developers Manual** |
| 17 | + |
| 18 | +Please wrap lines at 80 characters. |
| 19 | + |
| 20 | +Spelling and Capitalization Conventions |
| 21 | +--------------------------------------- |
| 22 | + |
| 23 | +* Nextcloud |
| 24 | +* LibreSign |
| 25 | + |
| 26 | +License |
| 27 | +------- |
| 28 | + |
| 29 | +All documentation in this repository is licensed under the Creative Commons |
| 30 | +Attribution 3.0 Unported license (`CC BY 3.0`_). |
| 31 | + |
| 32 | +.. _CC BY 3.0: https://creativecommons.org/licenses/by/3.0/deed.en_US |
| 33 | + |
| 34 | +Style |
| 35 | +----- |
| 36 | + |
| 37 | +Source files are written using the `Sphinx Documentation Generator |
| 38 | +<https://www.sphinx-doc.org/en/master/>`_. The syntax follows the `reStructuredText |
| 39 | +<http://docutils.sourceforge.net/rst.html>`_ style, and can also be edited |
| 40 | +from GitHub. |
| 41 | + |
| 42 | +Structure |
| 43 | +--------- |
| 44 | + |
| 45 | +Of course, think about structure. Keep in mind that we try NOT to move or rename |
| 46 | +pages once they are created! Lots of external sources link to our documentation, |
| 47 | +including the indexing by search engines of course. So once you create a page with a certain |
| 48 | +name, it has to stay in that location and with that name. Think of it as API stability |
| 49 | +- we have to ensure things stay as they are as much as possible. Renaming or moving |
| 50 | +is only allowed in exceptional circumstances and only when a redirect is put in place. |
| 51 | + |
| 52 | +Editing |
| 53 | +------- |
| 54 | + |
| 55 | +Contributing to the documentation requires a GitHub account. |
| 56 | + |
| 57 | +To edit a document, you can edit the .rst files on your local system, or work |
| 58 | +directly on GitHub. The latter is only suitable for small fixes and improvements |
| 59 | +because substantial editing efforts can better be controlled on your local PC. |
| 60 | + |
| 61 | +The best way is to install a complete Sphinx build environment and work on your |
| 62 | +local PC or using the docker-compose that stay at home folder of this repository. |
| 63 | +You will be able to make your own local builds, which is the fastest |
| 64 | +and best way to preview for errors. Sphinx will report syntax errors, missing |
| 65 | +images, and formatting errors. The GitHub preview is not complete and misses |
| 66 | +many mistakes. Create a new branch against the main, make your edits, then push |
| 67 | +your new branch to GitHub and open a new PR. |
| 68 | + |
| 69 | +To edit on GitHub, fork the repository (see top-right of the screen, under |
| 70 | +your username). You will then be able to make changes easily. Once done, |
| 71 | +you can create a pull request and get the changes reviewed and back into |
| 72 | +the official repository. |
| 73 | + |
| 74 | +When editing either on your own local PC or on GitHub, be sure to sign of |
| 75 | +commits, to certify adherence to the Developer Certificate of Origin, |
| 76 | +see https://github.com/probot/dco . Your commit messages need to have, |
| 77 | +the name and email address of the contributor. |
| 78 | + |
| 79 | + Signed-off-by: Awesome Contributor < [email protected]> |
| 80 | + |
| 81 | +If using the command line and your name and email are configured, you can use |
| 82 | + |
| 83 | + git commit -s -m 'Commit message' |
| 84 | + |
| 85 | +In both settings be sure that your email address matches that in your GitHub profile, |
| 86 | +which if you have privacy enabled will be [email protected] |
| 87 | + |
| 88 | + |
| 89 | +Building |
| 90 | +-------- |
| 91 | + |
| 92 | +Building HTML |
| 93 | +============= |
| 94 | + |
| 95 | +Using pipenv |
| 96 | +^^^^^^^^^^^^ |
| 97 | + |
| 98 | +1. Install ``pipenv`` - https://pipenv.readthedocs.io/en/latest/ |
| 99 | +2. Change into the environment: ``pipenv shell`` |
| 100 | +3. Install the dependencies ``pip install -r docs/requirements.txt`` |
| 101 | +4. Now you can use ``make ...`` to build all the stuff - for example ``make html`` to build the HTML flavor of all manuals |
| 102 | + The build assets will be put into the individual documentation subdirectories like ``developer_manual/_build/html/com`` |
| 103 | + |
| 104 | +To change into this environment you need to run ``pipenv shell`` to launch the shell and to exit you can use either ``exit`` or ``Ctrl`` + ``D``. |
| 105 | + |
| 106 | +Using venv |
| 107 | +^^^^^^^^^^ |
| 108 | + |
| 109 | +1. Install ``python3-venv`` |
| 110 | +2. Only once: Create a venv (typically inside this repository): ``python -m venv venv`` |
| 111 | +3. Activate the environment (inside this repository): ``source venv/bin/activate`` |
| 112 | +4. Install the dependencies ``pip install -r docs/requirements.txt`` |
| 113 | +5. Now you can use ``make ...`` to build all the stuff - for example ``make html`` to build the HTML flavor of all manuals |
| 114 | + The build assets will be put into the individual documentation subdirectories like ``developer_manual/_build/html/com`` |
| 115 | + |
| 116 | +Autobuilding |
| 117 | +^^^^^^^^^^^^ |
| 118 | + |
| 119 | +When editing the documentation installing ``sphinx-autobuild`` though pip can be helpful. This will watch file changes and automatically reload the html preview: |
| 120 | + |
| 121 | +1. Install ``pip install sphinx-autobuild`` |
| 122 | +2. Enter the documentation section ``cd user_manual`` |
| 123 | +3. Watch for file changes ``make SPHINXBUILD=sphinx-autobuild html`` |
| 124 | +4. Open http://127.0.0.1:8000 in the browser and start editing |
| 125 | + |
| 126 | +Building PDF |
| 127 | +============ |
| 128 | + |
| 129 | +1. Follow instructions for "Building HTML" above |
| 130 | +2. Install ``latexmk`` and ``texlive-latex-extra`` - https://pipenv.readthedocs.io/en/latest/ |
| 131 | +3. Create a Python environment (typically inside this repository): ``pipenv --python 3.9`` |
| 132 | +4. Change into the environment: ``pipenv shell`` |
| 133 | +5. Install the dependencies ``pip install -r docs/requirements.txt`` |
| 134 | +6. Now you can use ``make ...`` to build all the stuff - for example ``make pdf`` to build the PDF flavor of all manuals |
| 135 | + |
| 136 | +Using the VSCode DevContainer |
| 137 | +============================= |
| 138 | + |
| 139 | +This repository contains a full-featured `VSCode DevContainer <https://code.visualstudio.com/docs/devcontainers/containers>`_. |
| 140 | +You can use it in your local development environment or via `GitHub Codespaces <https://github.com/features/codespaces>`_. |
| 141 | +Just open the container an use one of the commands from above to build the project. For example ``make`` to build the full |
| 142 | +documentation, ``make html`` to build the HTML documentation or ``make pdf`` to build the PDF documentation. You can also use |
| 143 | +``make SPHINXBUILD=sphinx-autobuild html`` in combination with `port forwarding <https://code.visualstudio.com/docs/devcontainers/containers#_forwarding-or-publishing-a-port>`_ |
| 144 | +to watch file changes and automatically reload the html preview. |
| 145 | + |
| 146 | +Usign docker |
| 147 | +============ |
| 148 | +You can also use the `docker-compose.yml` file to build the documentation using |
| 149 | +Docker. This is useful if you want to avoid installing Python and its |
| 150 | +dependencies on your local machine. |
| 151 | + |
| 152 | +1. Make sure you have Docker and Docker Compose installed. |
| 153 | +2. Open a terminal and navigate to the root directory of the repository. |
| 154 | +3. Run the following command to build the documentation: |
| 155 | + |
| 156 | + ``docker-compose up`` |
| 157 | + |
| 158 | + This will build the HTML documentation and place it in the `volumes/html` directory. |
| 159 | + And also will start a HTTP server and you can access the documentation at `http://localhost:8000`. |
| 160 | + |
| 161 | +4. To stop the server, press `Ctrl+C` in the terminal. |
| 162 | + |
| 163 | + |
| 164 | +.. _CC BY 3.0: https://creativecommons.org/licenses/by/3.0/deed.en_US |
| 165 | +.. _`Xcode command line tools`: https://stackoverflow.com/questions/9329243/xcode-install-command-line-tools |
| 166 | + |
| 167 | +This README was based on the `Nextcloud documentation <https://github.com/nextcloud/documentation/blob/master/README.rst>`_. |
0 commit comments