README.rst 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. ==============================================
  2. Enhanced Sphinx theme (based on Python 3 docs)
  3. ==============================================
  4. Theme customized for https://pyrocko.org
  5. !! Includes pyrocko piwik tracking code !!
  6. .. list-table::
  7. :stub-columns: 1
  8. * - docs
  9. - |docs|
  10. * - tests
  11. - | |travis|
  12. * - demo
  13. - `default <http://ionelmc.github.io/sphinx-py3doc-enhanced-theme/default/>`_,
  14. `bare <http://ionelmc.github.io/sphinx-py3doc-enhanced-theme/bare/>`_
  15. * - package
  16. - |version| |downloads|
  17. .. |docs| image:: https://readthedocs.org/projects/sphinx-py3doc-enhanced-theme/badge/?style=flat
  18. :target: https://readthedocs.org/projects/sphinx-py3doc-enhanced-theme
  19. :alt: Documentation Status
  20. .. |travis| image:: http://img.shields.io/travis/ionelmc/sphinx-py3doc-enhanced-theme/master.svg?style=flat&label=Travis
  21. :alt: Travis-CI Build Status
  22. :target: https://travis-ci.org/ionelmc/sphinx-py3doc-enhanced-theme
  23. .. |version| image:: http://img.shields.io/pypi/v/sphinx-py3doc-enhanced-theme.svg?style=flat
  24. :alt: PyPI Package latest release
  25. :target: https://pypi.python.org/pypi/sphinx-py3doc-enhanced-theme
  26. .. |downloads| image:: http://img.shields.io/pypi/dm/sphinx-py3doc-enhanced-theme.svg?style=flat
  27. :alt: PyPI Package monthly downloads
  28. :target: https://pypi.python.org/pypi/sphinx-py3doc-enhanced-theme
  29. A theme based on https://github.com/ionelmc/sphinx-py3doc-enhanced-theme
  30. * Free software: BSD license
  31. Installation
  32. ============
  33. ::
  34. pip install sphinx_sleekcat_theme
  35. Add this in your documentation's ``conf.py``:
  36. .. sourcecode:: python
  37. import sphinx_sleekcat_theme
  38. html_theme = "sphinx_sleekcat_theme"
  39. html_theme_path = [sphinx_sleekcat_theme.get_html_theme_path()]
  40. Customization
  41. =============
  42. No extra styling
  43. ----------------
  44. This theme has some extra styling like different fonts, text shadows for headings, slightly different styling for inline code and code blocks.
  45. To get the original styling Python 3 docs have add this in you ``conf.py``:
  46. .. sourcecode:: python
  47. html_theme_options = {
  48. 'githuburl': 'https://github.com/pyrocko/pyrocko/',
  49. 'bodyfont': '"Lucida Grande",Arial,sans-serif',
  50. 'headfont': '"Lucida Grande",Arial,sans-serif',
  51. 'codefont': 'monospace,sans-serif',
  52. 'linkcolor': '#0072AA',
  53. 'visitedlinkcolor': '#6363bb',
  54. 'extrastyling': False,
  55. 'googlewebfonturl': 'http://fonts.googleapis.com/css?family=Rubik+One|Kalam',
  56. 'fontawesome': 'https://use.fontawesome.com/d51e5252e5.js',
  57. }
  58. pygments_style = 'friendly'
  59. Custom favicon
  60. --------------
  61. To have a custom favicon create a ``theme`` directory near your ``conf.py`` and add this ``theme.conf`` in it:
  62. .. sourcecode:: ini
  63. [theme]
  64. inherit = sphinx_sleekcat_theme
  65. Then create a ``favicon.png`` in the ``static`` directory.
  66. And then edit your ``conf.py`` to have something like this:
  67. .. sourcecode:: python
  68. import sphinx_sleekcat_theme
  69. html_theme = "theme"
  70. html_theme_path = [sphinx_sleekcat_theme.get_html_theme_path(), "."]
  71. The final file structure should be like this::
  72. docs
  73. ├── conf.py
  74. └── theme
  75. ├── static
  76. │   └── favicon.png
  77. └── theme.conf
  78. A bit of extra css
  79. ------------------
  80. .. sourcecode:: python
  81. html_theme_options = {
  82. 'appendcss': 'div.body code.descclassname { display: none }',
  83. }
  84. Examples
  85. ========
  86. * http://python-aspectlib.readthedocs.org/en/latest/
  87. * http://python-manhole.readthedocs.org/en/latest/