1 Documentation System {#dev_guides__documentation}
6 @section OCCT_DM_SECTION_1 Introduction
8 This document provides practical guidenes for generation and editing of OCCT user documentation.
10 @section OCCT_DM_SECTION_2 Prerequisites
12 In order to generate documentation, you need to have the following software installed.
15 Version 8.5 or 8.6: http://www.tcl.tk/software/tcltk/download.html
18 Version 1.8.4 or above: http://www.stack.nl/~dimitri/doxygen/download.html
20 <b>MiKTeX</b> or equivalent tool (only needed for PDF document creation): http://miktex.org/download
22 **Note**: to generate pdf documentation with MiKTeX you should execute gendoc.bat within MiKTeX environment
23 (run gendoc.bat in MiKTeX command promt or update PATH for MiKTeX bin folder). Also in process of pdf generation
24 MiKTeX can request you to download missing packages if MiKTeX was installed with option below:
26 @image html /dev_guides/documentation/images/documentation_image002.png
27 @image latex /dev_guides/documentation/images/documentation_image002.png
29 If this option is set to "Yes", MiKTeX will download missing packages automatically.
31 <b>MathJax</b> is used for rendering math formulas in browser (HTML and CHM outputs): http://www.mathjax.org.
33 By default MathJAX scripts and fonts are taken from http://cdn.mathjax.org/mathjax/latest and no instalation of MathJAX is necessary if Internet is accessible.
34 If you need to use OCCT documentation while offline, you can install local copy of MatJAX, see http://www.mathjax.org/download/.
35 See \ref OCCT_DM_SECTION_A_9 paragraph for more details on inserting math.
37 @section OCCT_DM_SECTION_2_1 Documentation Generation
39 Run gendoc.bat from OCCT directory to generate all articles are defined in FILES.txt:
43 * -html : To generate HTML files (cannot be used with -pdf);
44 * -pdf : To generate PDF files (cannot be used with -html);
45 * -m=\<modules_list\> : Specifies list of articles to generate. If it is not specified, all files, mentioned in FILES.txt are processed;
46 * -l=\<document_name\> : Specifies the article caption for a single document;
47 * -mathjax=\<path\> : Specifies path to non-default MathJAX installation
48 * -h : Prints help message;
49 * -v : Specifies the Verbose mode (info on all script actions is shown).
51 If you run the command without arguments (like example above) it will generate HTML documentation for all articles defined in FILES.txt.
53 **Note**: the generation process generates PDF files for each article,
54 but in html case it generates common Html page with references to the ones.
56 For generation of specific article specify path to corresponding MarkDown file (paths relative to *dox* subfolder can be given), for instance:
58 % gendoc.bat -html -m=dev_guides/documentation/documentation.md
60 Multiple files can be separated with comma:
62 % gendoc.bat -html -m=MD_FILE_1,MD_FILE_2
64 To specify an article name with -l option, use quotes to prevent incorrect interpretation of whitespaces:
66 % gendoc.bat -pdf -m=MD_FILE_1 -l="Label of MD_FILE_1 document"
68 @section OCCT_DM_SECTION_3 Documentation Conventions
70 This section contains information about conventions in the field of OCCT documentation file format,
71 structure of documentation directories, etc.
73 @subsection OCCT_DM_SECTION_3_1 File Format
75 The format used for documentation is MarkDown with Doxygen extensions.
76 The MarkDown files have a "*.md" extension and are based on rules desribed in
77 \ref OCCT_DM_SECTION_A section.
79 @subsection OCCT_DM_SECTION_3_2 Directory Structure
81 @image html /dev_guides/documentation/images/documentation_image001.png
82 @image latex /dev_guides/documentation/images/documentation_image001.png
84 Every separate article has own folder if images are used in it. These images
85 are stored into "images" subfolder.
87 If you want to use the same image for several articles, you can place the one into "dox/resources" folder.
89 **Note**: Every article can use any image that is used by others articles. To avoid incorrect image
90 displaying, use relative path to the image (starting from dox folder). For instance
92 @image html /dev_guides/snv/images/snv_image001.svg
95 Result of generation of the documentation is:
97 %OCCT_DIR% / doc - a folder for generated articles;
98 * html/ - a directory for generated HTML pages;
99 * pdf/ - a directory for generated PDF files.
101 @section OCCT_DM_SECTION_4 Adding a New Article
103 - Place a new article into folder that is chosen taking into account the place of the article
104 at the hierarchy of the documentation. For instance the article about "using SVN working with OCCT
105 source code" (svn.md - the file of the article) might be placed into /dox/dev_guides/ . If the article has images then you may create
106 the own folder of the article and subfolder in it for images. For instance
107 */dox/dev_guides/svn/ - for svn.md file
108 */dox/dev_guides/svn/images/ - for images
110 - Update dox/FILES.txt to add relative path to svn.md. For instance
112 dev_guides/snv/svn.md
115 **Note**: the place of the relative path to an article is connected with the place
116 into treeview of html version.
119 Note, that you should specify a file tag, not the document name.
120 See <a href="#OCCT_DM_SECTION_A_1">Header section</a> for details.
122 @section OCCT_DOC_SECTION_5 Additional Resources
124 More information about OCCT can be found at http://www.opencascade.org
126 The information on formula syntax can be found at:
127 http://en.wikipedia.org/wiki/Help:Displaying_a_formula
129 More information on MarkDown and Doxygen syntax can be found at:
130 http://www.stack.nl/~dimitri/doxygen/manual
132 @section OCCT_DM_SECTION_A Appendix 1: Document Syntax
134 Each OCCT document file in *.md format has a simple structure.
137 | Content type | Obligation |
138 | :---------------- | :-------------------: |
147 | Page numbers | M (auto generation) |
148 | Table of contents | M (auto generation) |
155 @subsection OCCT_DM_SECTION_A_1 Text Caption (a header)
157 headings of different levels can be specified with the following code:
169 and with the following code:
181 Where a word in curly braces is a MarkDown-style reference, which can be used in table of contents.
182 If you would like to have the table of contents, it is recommended to use \@section,
183 \@subsection and \@subsubsection pages instead of MarkDown headers as follows:
186 @section Section_Name Section Header
187 @subsection SubSection_Name SubSection Header
188 @subsubsection SubSubSection_Name SubSubSection Header
191 @subsection OCCT_DM_SECTION_A_2 Plain Text
193 Plain text is a text in a notepad-like format. To insert special symbols,
194 like \< , \> or \\, prepend them with \\ character: \\\<, \\\>, \\\\
195 To emphasize some words, write one pair of asterisks ( * ) or underscores ( _ ) across the word
196 to make it *italic* and two pairs of these symbols to make a word **Bold**.
198 @subsection OCCT_DM_SECTION_A_3 Lists
200 To create a bulleted list, start each line with a hyphen or an asterisk,
201 followed by a space. List items can be nested. This code:
219 To create a numbered list, start each line with number and a period,
220 then a space. Numbered lists can also be nested. Thus this code
238 Each list item can contain several paragraphs of text; these paragraphs must
239 have the same indentation as text after bullet or number in the numbered list
240 item (otherwise numbering will be broken).
242 Code blocks can be inserted as paragraphs with additional indentation
243 (4 spaces more). Note that fenced code blocks do not work within numbered lists
244 and their use may cause numeration to be reset.
247 Example of complex nested list:
260 code fragment for sub-item 1
264 Paragraph for sub-item 2
266 Yet one more paragraph for list item 1
281 code fragment for sub-item 1
285 Paragraph for sub-item 2
287 Yet one more paragraph for list item 1
291 Note that numbers of paragraphs are regenerated so they do not necessarily
292 follow numbering of source items.
294 @subsection OCCT_DM_SECTION_A_4 Tables
296 A table consists of a header line, a separator line, and at least one row line.
297 Table columns are separated by the pipe (|) character. The following example:
300 First Header | Second Header
301 ------------- | -------------
302 Content Cell | Content Cell
303 Content Cell | Content Cell
306 will produce the following table:
308 First Header | Second Header
309 ------------ | -------------
310 Content Cell | Content Cell
311 Content Cell | Content Cell
313 Column alignment can be controlled via one or two colons at the header separator line:
316 | Right | Center | Left |
317 | ----: | :----: | :---- |
319 | 1000 | 1000 | 1000 |
322 which will looks as follows:
324 | Right | Center | Left |
325 | ----: | :----: | :---- |
327 | 1000 | 1000 | 1000 |
329 Note that each table raw should be contained in one line of text; complex
330 tables can be created using HTML tags.
332 @subsection OCCT_DM_SECTION_A_5 Code Blocks
334 It is recommended to indent a code lines with 4 spaces.
335 A fenced code block does not require indentation, and is defined by a pair of "fence lines".
336 Such line consists of 3 or more tilde (~) characters on a line.
337 The end of the block should have the same number of tildes. Here is an example:
339 ~~~~~~~~~~~~~~~~~~~~~~~
340 a one-line code block
341 ~~~~~~~~~~~~~~~~~~~~~~~
343 By default the output is the same as for a normal code block.
344 To highlight the code, the developer has to indicate the typical file extension,
345 which corresponds to the programming language, after the opening fence.
346 For highlighting according to the C++ language, for instance, write the following code (the curly braces and dot are optional):
349 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
350 int func(int a,int b) { return a*b; }
351 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
355 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
356 int func(int a,int b) { return a*b; }
357 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
359 Verbatim content can be written by using framing \@verbatim \@endverbatim . For instance
364 @subsection OCCT_DM_SECTION_A_6 References
366 To insert a reference to a website, it is proposed to write a URL. For example: http://en.wikipedia.org
367 To insert a reference to another part of the same document, the developer can write:
371 <a href="#OCCT_DOC_SECTION_5">Doxygen Configuration file</a>
375 to get a link to paragraph : @htmlonly <a href="#OCCT_DOC_SECTION_5">Doxygen configuration</a> @endhtmlonly
377 @subsection OCCT_DM_SECTION_A_7 Images
379 To insert image into document the developer can write the following code(in Doxygen-style):
383 @image html /relative/path/to/image/image001.png "Image caption"
388 @image latex /relative/path/to/image/image001.png "Image caption"
391 *Note*: When markdown document is used to generate html document the latex insertion is ignored (and vice versa)
392 due to this fact you can use image insertions in the pair, like example below:
394 @image html /relative/path/to/image/image001.png "Image caption"
395 @image latex /relative/path/to/image/image001.png "Image caption"
398 The code below tells Doxygen to insert a picture right in the place this code was written:
400 @image html /resources/occ_logo.png "OCCT logo"
401 @image latex /resources/occ_logo.png "OCCT logo"
404 @image html /resources/occ_logo.png "OCCT logo"
405 @image latex /resources/occ_logo.png "OCCT logo"
407 @subsection OCCT_DM_SECTION_A_8 Table Of Contents
409 To get the table of contents at the beginning of the document, write \@tableofcontents tag.
410 But it is not needed now because TreeView option for HTML is used.
411 The TOC in the PDF document will be generated automatically.
413 @subsection OCCT_DM_SECTION_A_9 Formulas
415 Formulas within MarkDown documents can be defined using LaTeX syntax.
417 Equations can be written by several ways:
419 1.Unnumbered displayed formulas that are centered on a separate line.
420 These formulas should be put between \@f\[ and \@f\] tags. An example:
424 |I_2|=\left| \int_{0}^T \psi(t)
428 \frac{d\theta}{k(\theta,t)}
429 \int_{a}^\theta c(\xi)u_t(\xi,t)\,d\xi
435 gives the following result:
438 |I_2|=\left| \int_{0}^T \psi(t)
442 \frac{d\theta}{k(\theta,t)}
443 \int_{a}^\theta c(\xi)u_t(\xi,t)\,d\xi
448 2.Formulas can also be put between @verbatim \begin{align} @endverbatim and @verbatim \end{align} @endverbatim tags. An example:
452 \dot{x} & = \sigma(y-x) \\
453 \dot{y} & = \rho x - y - xz \\
454 \dot{z} & = -\beta z + xy
458 gives the following result:
461 \dot{x} & = \sigma(y-x) \\
462 \dot{y} & = \rho x - y - xz \\
463 \dot{z} & = -\beta z + xy
469 \dot{x} & = \sigma(y-x) \\
470 \dot{y} & = \rho x - y - xz \\
471 \dot{z} & = -\beta z + xy
475 3.Inline formulas can be specified using this syntax:
478 @f$ \sqrt{3x-1}+(1+x)^2 @f$
481 that leads to the following result: @f$ \sqrt{3x-1}+(1+x)^2 @f$