conf.py 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. # Configuration file for the Sphinx documentation builder.
  2. #
  3. # This file only contains a selection of the most common options. For a full
  4. # list see the documentation:
  5. # http://www.sphinx-doc.org/en/master/config
  6. # -- Path setup --------------------------------------------------------------
  7. # If extensions (or modules to document with autodoc) are in another directory,
  8. # add these directories to sys.path here. If the directory is relative to the
  9. # documentation root, use os.path.abspath to make it absolute, like shown here.
  10. #
  11. # import os
  12. # import sys
  13. # sys.path.insert(0, os.path.abspath('.'))
  14. import recommonmark
  15. import sphinx_rtd_theme
  16. from recommonmark.transform import AutoStructify
  17. # -- Project information -----------------------------------------------------
  18. project = 'Scribe'
  19. copyright = '2020, Shalvah'
  20. author = 'Shalvah'
  21. # -- General configuration ---------------------------------------------------
  22. # Add any Sphinx extension module names here, as strings. They can be
  23. # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
  24. # ones.
  25. extensions = ['recommonmark', 'sphinx_rtd_theme']
  26. # Add any paths that contain templates here, relative to this directory.
  27. templates_path = ['_templates']
  28. # List of patterns, relative to source directory, that match files and
  29. # directories to ignore when looking for source files.
  30. # This pattern also affects html_static_path and html_extra_path.
  31. exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
  32. # -- Options for HTML output -------------------------------------------------
  33. # The theme to use for HTML and HTML Help pages. See the documentation for
  34. # a list of builtin themes.
  35. #
  36. html_theme = 'sphinx_rtd_theme'
  37. # Add any paths that contain custom static files (such as style sheets) here,
  38. # relative to this directory. They are copied after the builtin static files,
  39. # so a file named "default.css" will overwrite the builtin "default.css".
  40. html_static_path = ['_static']
  41. master_doc = 'index'
  42. # app setup hook
  43. def setup(app):
  44. app.add_config_value('recommonmark_config', {
  45. 'enable_eval_rst': True,
  46. }, True)
  47. app.add_transform(AutoStructify)
  48. # Syntax highlighting
  49. pygments_style = 'sphinx'
  50. # Gpt this whole section from https://github.com/oroinc/documentation/blob/master/conf.py
  51. # Needed to make PHP syntax highlighting work well
  52. from sphinx.highlighting import lexers
  53. from pygments.lexers.web import PhpLexer
  54. # Enable highlighting for PHP code not between ``<?php ... ?>`` by default
  55. lexers['php'] = PhpLexer(startinline=True)
  56. lexers['php-annotations'] = PhpLexer(startinline=True)