github.com/hanks177/podman/v4@v4.1.3-0.20220613032544-16d90015bc83/docs/source/conf.py (about)

     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  # https://www.sphinx-doc.org/en/master/usage/configuration.html
     6  
     7  # -- Path setup --------------------------------------------------------------
     8  
     9  # If extensions (or modules to document with autodoc) are in another directory,
    10  # add these directories to sys.path here. If the directory is relative to the
    11  # documentation root, use os.path.abspath to make it absolute, like shown here.
    12  #
    13  # import os
    14  # import sys
    15  # sys.path.insert(0, os.path.abspath('.'))
    16  
    17  import re
    18  
    19  # -- Project information -----------------------------------------------------
    20  
    21  project = "Podman"
    22  copyright = "2019, team"
    23  author = "team"
    24  
    25  
    26  # -- General configuration ---------------------------------------------------
    27  
    28  # Add any Sphinx extension module names here, as strings. They can be
    29  # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
    30  # ones.
    31  extensions = ["myst_parser"]
    32  
    33  # Add any paths that contain templates here, relative to this directory.
    34  templates_path = ["_templates"]
    35  
    36  # List of patterns, relative to source directory, that match files and
    37  # directories to ignore when looking for source files.
    38  # This pattern also affects html_static_path and html_extra_path.
    39  exclude_patterns = []
    40  
    41  master_doc = "index"
    42  
    43  # Configure smartquotes to only transform quotes and ellipses, not dashes
    44  smartquotes_action = "qe"
    45  
    46  
    47  # -- Options for HTML output -------------------------------------------------
    48  
    49  # The theme to use for HTML and HTML Help pages.  See the documentation for
    50  # a list of builtin themes.
    51  #
    52  html_theme = "alabaster"
    53  
    54  # Add any paths that contain custom static files (such as style sheets) here,
    55  # relative to this directory. They are copied after the builtin static files,
    56  # so a file named "default.css" will overwrite the builtin "default.css".
    57  html_static_path = ["_static"]
    58  
    59  html_css_files = [
    60      "custom.css",
    61  ]
    62  
    63  # -- Extension configuration -------------------------------------------------
    64  
    65  # IMPORTANT: explicitly unset the extensions, by default dollarmath is enabled.
    66  # We use the dollar sign as text and do not want it to be interpreted as math expression.
    67  myst_enable_extensions = []
    68  
    69  
    70  def convert_markdown_title(app, docname, source):
    71      # Process markdown files only
    72      docpath = app.env.doc2path(docname)
    73      if docpath.endswith(".md"):
    74          # Convert pandoc title line into eval_rst block for myst_parser
    75          #
    76          # Remove the ending "(1)" to avoid it from being displayed
    77          # in the web tab. Often such a text indicates that
    78          # a web page got an update. For instance GitHub issues
    79          # shows the number of new comments that have been written
    80          # after the user's last visit.
    81          source[0] = re.sub(r"^% (.*)(\(\d\))", r"```{title} \g<1>\n```", source[0])
    82  
    83  def setup(app):
    84      app.connect("source-read", convert_markdown_title)