Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
tldr; We can now use markdown table syntax in RST file. Command for building docs is same as before (i.e.
cmake -G \"Ninja Multi-Config\" -B build -DDOCS:STRING=YES && ninja -C build -f build-Release.ninja
). This was achieved by modifying cmake docs command from${SPHINX_EXECUTABLE} -b html
to${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/preprocessor.py --input ${SPHINX_SOURCE} --output ${SPHINX_SOURCE}/__output__ && ${SPHINX_EXECUTABLE} -b html
. Preprocessor may be useful for other custom RST syntax in future. Additional RST parsing can be added todocs/scripts/preprocessor.py
in future.Resolves #120.
Now, we can write tables in RST file using markdown syntax. This is pretty much as simple as it can get re. writing the tables. Supporting this requires additional step before the docs build, because markdown syntax isn't allowed in final RST file.
So, when building the docs, I added a preprocessor step (to existing CMAKE build docs command). The preprocessor scans all the RST files and creates parsed copy of each RST file in
docs/source__out__
. I have added that folder to.gitignore
.For above example, the parsed RST would be:
Notice that markdown table has been replaced with valid RST (type 2) table.
Then after building you will get a nice table.