The documentations are written in a novel way. The documentations are written in C++ source, in form of C++ comment.
The sample code is real C++ code which is compilable and runnable. When converting the C++ source file to document file, the comments are converted to markdown description, and the sample code is also converted to markdown code block.
That's to say, most sample code in the documents are compilable and runnable.
All documentations and the readme are generated from the source code in folder jsonpp/tests/docsrc
. The document .md file name is same to the .cpp source file name.
The documentations are generated by running the command
cd jsonpp/tools
python gendoc.py
The tool requires Python 3 to convert .cpp to .md files.
In folder jsonpp/tests/docsrc
, all files that name starts with "doc_" are the documentation source files. There are different source file types.
For .cpp file, the comment and code in the file are parsed and converted to .md file.
For .md file, it's copied to the doc folder.
Note: the "doc_" file name prefix are removed from the generated documentation files.
So, to modify the documentation, DON'T modify the files in doc folder. You should modify the files in docsrc folder and run the tool the generate the documentations.
The folder structure in docsrc
is same as doc
. The files in docsrc
are created in the same sub folder in doc
. There are some files create in special folders.
doc_readme.cpp -> jsonpp/readme.md # the main readme
doc_document_readme.cpp -> jsonpp/doc/readme.md