From a6c8dea1906c267169c3df64dc26f306684d6bed Mon Sep 17 00:00:00 2001 From: Bartuccio Antoine Date: Wed, 14 Aug 2019 15:05:40 +0200 Subject: [PATCH] documentation: move markdown syntax documentation and move helper for counting lines --- README.rst | 15 --------------- doc/index.rst | 3 +-- doc/misc/helpers.rst | 11 ++++++++++- doc/misc/md_syntax.rst | 20 ++++++++++++++++++++ 4 files changed, 31 insertions(+), 18 deletions(-) create mode 100644 doc/misc/md_syntax.rst diff --git a/README.rst b/README.rst index 17b58d9d..6099f669 100644 --- a/README.rst +++ b/README.rst @@ -76,18 +76,3 @@ Now you have many solutions in your model: Finally, when building a class based view, which is highly advised, you just have to inherit it from CanEditPropMixin, CanEditMixin, or CanViewMixin, which are located in core.views. Your view will then be protected using either the appropriate group fields, or the right method to check user permissions. - -Counting the number of line of code -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. sourcecode:: bash - - sudo apt install cloc - cloc --exclude-dir=doc,env . - -Updating doc/SYNTAX.md -~~~~~~~~~~~~~~~~~~~~~~ - -| If you make an update in the Markdown syntax parser, it's good to document update the syntax reference page in :bash:`doc/SYNTAX.md`. But updating this file will break the tests if you don't update the corresponding :bash:`doc/SYNTAX.html` file at the same time. -| To do that, simply run :bash:`./manage.py markdown > doc/SYNTAX.html`, -and the tests should pass again. diff --git a/doc/index.rst b/doc/index.rst index 2d6019ec..97357eb0 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -38,6 +38,7 @@ Bienvenue sur la documentation du Sith de l'AE :maxdepth: 2 :caption: Divers + misc/md_syntax misc/helpers Documentations complémentaires @@ -68,8 +69,6 @@ Git * `Livre sur Git `__ - - Documents téléchargeables ------------------------- diff --git a/doc/misc/helpers.rst b/doc/misc/helpers.rst index fc31b69b..d961b37c 100644 --- a/doc/misc/helpers.rst +++ b/doc/misc/helpers.rst @@ -1,8 +1,17 @@ Commandes utiles ================ -* Appliquer le header de licence sur tout le projet +Appliquer le header de licence sur tout le projet +------------------------------------------------- .. code-block:: bash for f in $(find . -name "*.py" ! -path "*migration*" ! -path "./env/*" ! -path "./doc/*"); do cat ./doc/header "$f" > /tmp/temp && mv /tmp/temp "$f"; done + +Compter le nombre de lignes de code +----------------------------------- + +.. code-block:: bash + + sudo apt install cloc + cloc --exclude-dir=doc,env . diff --git a/doc/misc/md_syntax.rst b/doc/misc/md_syntax.rst new file mode 100644 index 00000000..13607afb --- /dev/null +++ b/doc/misc/md_syntax.rst @@ -0,0 +1,20 @@ +Syntaxe markdown utilisée dans le site +====================================== + +.. note:: + + Si vous faites une mise à jour sur le parseur markdown, il est bon de documenter cette mise à jour dans la page de référence *doc/SYNTAX.md*. Mettre à jour ce fichier vas casser les tests si vous ne mettez pas à jour le fichier *doc/SYNTAX.md* qui lui correspond juste après. Pour mettre à jour ce fichier il suffit d'utiliser la commande + + :: + + ./manage.py markdown > doc/SYNTAX.html + +.. warning:: + + Le rendu de cette aide est fait via Sphinx, il peut représenter quelques différences avec la réalité. Il est possible de télécharger juste en dessous les versions brutes. + +* :download:`Fichier d'aide en markdown <../SYNTAX.md>` +* :download:`Fichier d'aide rendu en HTML <../SYNTAX.html>` + +.. raw:: html + :file: ../SYNTAX.html