rstcommon.rst 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. ..
  2. Usage of this file:
  3. Add this in the beginning of *.rst file:
  4. .. default-role:: code
  5. .. include:: rstcommon.rst
  6. It's the current trick for brevity and compatibility with both Github and
  7. rst2html.py, considering that Github cannot highlight Nim in
  8. RST files anyway and it does not include files.
  9. This way interpreted text is displayed with monospaced font in Github
  10. and it's displayed an Nim code in both rst2html.py
  11. (note ".. default-role:: Nim" above) and `nim rst2html`.
  12. For files that are user manual and consist of stuff like cmdline
  13. option description, use 'code' as a **real** default role:
  14. .. include:: rstcommon.rst
  15. .. default-role:: code
  16. .. define language roles explicitly (for compatibility with rst2html.py):
  17. .. role:: nim(code)
  18. :language: nim
  19. .. default-role:: nim
  20. .. role:: c(code)
  21. :language: c
  22. .. role:: cpp(code)
  23. :language: cpp
  24. .. role:: yaml(code)
  25. :language: yaml
  26. .. role:: python(code)
  27. :language: python
  28. .. role:: java(code)
  29. :language: java
  30. .. role:: csharp(code)
  31. :language: csharp
  32. .. role:: cmd(code)
  33. .. role:: program(code)
  34. .. role:: option(code)