|
| 1 | +QL language documentation |
| 2 | +######################### |
| 3 | + |
| 4 | +Overview |
| 5 | +******** |
| 6 | + |
| 7 | +The QL language documentation is written in reStructuredText and converted to |
| 8 | +HTML for manual publication on `help.semmle.com <https://help.semmle.com>`__ using Sphinx. |
| 9 | + |
| 10 | +For more information on writing in reStructuredText, |
| 11 | +see http://docutils.sourceforge.net/rst.html. |
| 12 | + |
| 13 | +For more information on Sphinx, see https://www.sphinx-doc.org. |
| 14 | + |
| 15 | +Project structure |
| 16 | +***************** |
| 17 | + |
| 18 | +The QL language documentation currently consists of the following Sphinx projects: |
| 19 | + |
| 20 | +- ``learn-ql``–help topics to help you learn the QL language and write queries |
| 21 | +- ``ql-handbook``–a user-friendly guide to the QL language |
| 22 | +- ``ql-spec``–formal descriptions of the QL language and QLDoc comments |
| 23 | +- ``support``–the languages and frameworks currently supported in QL analysis |
| 24 | +- ``training``–QL for variant analysis training material |
| 25 | +- ``ql-training-rst``–QL for variant analysis slide shows |
| 26 | + |
| 27 | +Each project contains: |
| 28 | + |
| 29 | +- an ``index.html`` file, the project's |
| 30 | + `master document <https://www.sphinx-doc.org/en/master/glossary.html#term-master-document>`__. |
| 31 | +- a ``conf.py`` file that defines some project-specific configuration values |
| 32 | +- one or more reStructuredText source files |
| 33 | + |
| 34 | +Shared configuration values are specified in ``global-conf.py``, which is found |
| 35 | +in the ``global-sphinx-files`` directory. |
| 36 | +This directory also contains any other files, such as templates and stylesheets, |
| 37 | +that are used by multiple projects. |
| 38 | +Images used in the QL documentation are located in the ``images`` directory. |
| 39 | + |
| 40 | +The ``ql-training-rst`` project contains the source files, themes, and static files |
| 41 | +used to generate the QL training presentations. |
| 42 | +It uses a different configuration from the other projects, and is built using an |
| 43 | +extension specifically designed for HTML slide shows. |
| 44 | +For more information, see |
| 45 | +**Building and previewing the QL training presentations** below. |
| 46 | + |
| 47 | + |
| 48 | +Building and previewing the QL language documentation |
| 49 | +***************************************************** |
| 50 | + |
| 51 | +To build and preview the QL documentation locally, you need to install Sphinx. |
| 52 | +For installation options, see https://github.com/sphinx-doc/sphinx. |
| 53 | + |
| 54 | +After installing Sphinx, you can build the HTML files for a project by running |
| 55 | +`sphinx-build <https://www.sphinx-doc.org/en/master/man/sphinx-build.html>`__ |
| 56 | +from the project's |
| 57 | +`source directory <https://www.sphinx-doc.org/en/master/glossary.html#term-source-directory>`__. |
| 58 | +For example, to generate the HTML output for a project in the |
| 59 | +``<docs-output>`` directory you would use: |
| 60 | + |
| 61 | +.. code:: |
| 62 | +
|
| 63 | + sphinx-build -b html . <docs-output> |
| 64 | +
|
| 65 | +Building and previewing the QL training presentations |
| 66 | +***************************************************** |
| 67 | + |
| 68 | +To build the QL training presentations, you need to install a Sphinx extension |
| 69 | +called `hieroglyph <https://github.com/nyergler/hieroglyph>`__. |
| 70 | + |
| 71 | +After installing hieroglyph, you can build the QL training presentations by running |
| 72 | +``sphinx-build``, specifying the ``slides`` builder. For example |
| 73 | + |
| 74 | +.. code:: |
| 75 | +
|
| 76 | + sphinx-build -b slides . <slides-output> |
| 77 | +
|
| 78 | +generates html slide shows in the ``<slides-output>`` directory when run from |
| 79 | +the ``ql-training-rst`` source directory. |
| 80 | + |
| 81 | + |
| 82 | +Viewing the current version of the QL language documentation |
| 83 | +************************************************************ |
| 84 | + |
| 85 | +The QL language documentation for the most recent Semmle release is |
| 86 | +published to `help.semmle.com <https://help.semmle.com>`__. |
| 87 | +There, you can also find the documentation for QL for Eclipse, |
| 88 | +QL for Visual Studio, QL command-line tools, and LGTM Enterprise. |
0 commit comments