|
| 1 | +# -*- coding: utf-8 -*- |
| 2 | +# |
| 3 | +# Configuration file for the Sphinx documentation builder. |
| 4 | +# |
| 5 | +# This file does only contain a selection of the most common options. For a |
| 6 | +# full list see the documentation: |
| 7 | +# http://www.sphinx-doc.org/en/stable/config |
| 8 | +import os |
| 9 | + |
| 10 | +# -- Path setup -------------------------------------------------------------- |
| 11 | + |
| 12 | +# If extensions (or modules to document with autodoc) are in another directory, |
| 13 | +# add these directories to sys.path here. If the directory is relative to the |
| 14 | +# documentation root, use os.path.abspath to make it absolute, like shown here. |
| 15 | +# |
| 16 | +# import os |
| 17 | +# import sys |
| 18 | +# sys.path.insert(0, os.path.abspath('.')) |
| 19 | +from recommonmark.parser import CommonMarkParser |
| 20 | + |
| 21 | + |
| 22 | +# -- Project information ----------------------------------------------------- |
| 23 | + |
| 24 | +project = u'pwncat' |
| 25 | +copyright = u'2020, cytopia' |
| 26 | +author = u'cytopia' |
| 27 | + |
| 28 | +# The short X.Y version |
| 29 | +version = u'0.1.1' |
| 30 | +# The full version, including alpha/beta/rc tags |
| 31 | +release = u'0.1.1' |
| 32 | + |
| 33 | + |
| 34 | +# -- General configuration --------------------------------------------------- |
| 35 | + |
| 36 | +# on_rtd is whether we are on readthedocs.org, this line of code grabbed from docs.readthedocs.org |
| 37 | +on_rtd = os.environ.get('READTHEDOCS', None) == 'True' |
| 38 | + |
| 39 | +# If your documentation needs a minimal Sphinx version, state it here. |
| 40 | +# |
| 41 | +# needs_sphinx = '1.0' |
| 42 | + |
| 43 | +# Add any Sphinx extension module names here, as strings. They can be |
| 44 | +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
| 45 | +# ones. |
| 46 | +extensions = [ |
| 47 | + 'sphinx.ext.todo' |
| 48 | +] |
| 49 | + |
| 50 | +todo_include_todos = True |
| 51 | + |
| 52 | +# Add any paths that contain templates here, relative to this directory. |
| 53 | +templates_path = ['_templates'] |
| 54 | + |
| 55 | +# The suffix(es) of source filenames. |
| 56 | +# You can specify multiple suffix as a list of string: |
| 57 | +# |
| 58 | +source_suffix = '.rst' |
| 59 | +# Exclude Markdown files for now |
| 60 | +#source_suffix = ['.rst', '.md'] |
| 61 | +#source_parsers = { |
| 62 | +# '.md': CommonMarkParser, |
| 63 | +#} |
| 64 | + |
| 65 | +# The master toctree document. |
| 66 | +master_doc = 'index' |
| 67 | + |
| 68 | +# The language for content autogenerated by Sphinx. Refer to documentation |
| 69 | +# for a list of supported languages. |
| 70 | +# |
| 71 | +# This is also used if you do content translation via gettext catalogs. |
| 72 | +# Usually you set "language" from the command line for these cases. |
| 73 | +language = None |
| 74 | + |
| 75 | +# List of patterns, relative to source directory, that match files and |
| 76 | +# directories to ignore when looking for source files. |
| 77 | +# This pattern also affects html_static_path and html_extra_path . |
| 78 | +exclude_patterns = [ |
| 79 | + u'_build/*', |
| 80 | + u'_includes/**', |
| 81 | + u'venv/**', |
| 82 | + u'requirements.txt', |
| 83 | + u'Thumbs.db', |
| 84 | + u'.DS_Store' |
| 85 | +] |
| 86 | + |
| 87 | +# The name of the Pygments (syntax highlighting) style to use. |
| 88 | +pygments_style = 'sphinx' |
| 89 | + |
| 90 | +rst_epilog = """ |
| 91 | +.. |psf| replace:: pwncat |
| 92 | +""" |
| 93 | + |
| 94 | + |
| 95 | +# -- Options for Link check ------------------------------------------------- |
| 96 | + |
| 97 | +# http://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-the-linkcheck-builder |
| 98 | +linkcheck_ignore = [ |
| 99 | + r'http(s)?://localhost(/)?.*', |
| 100 | + r'http(s)?://127\.0\.0\.1(/)?.*', |
| 101 | + r'http(s)?://.+\.loc$', |
| 102 | + r'http(s)?://.+\.loc/.+$' |
| 103 | +] |
| 104 | +linkcheck_retries = 5 |
| 105 | +linkcheck_timeout = 60 |
| 106 | +linkcheck_anchors = True |
| 107 | + |
| 108 | + |
| 109 | +# -- Options for HTML output ------------------------------------------------- |
| 110 | + |
| 111 | +# The theme to use for HTML and HTML Help pages. See the documentation for |
| 112 | +# a list of builtin themes. |
| 113 | +# |
| 114 | +#html_theme = 'alabaster' |
| 115 | +#html_theme = 'sphinx_rtd_theme' |
| 116 | +html_theme = 'default' |
| 117 | + |
| 118 | +html_logo = 'img/logo.png' |
| 119 | + |
| 120 | +# From: |
| 121 | +# * https://github.com/snide/sphinx_png_theme#using-this-theme-locally-then-building-on-read-the-docs |
| 122 | +if not on_rtd: # only import and set the theme if we're building docs locally |
| 123 | + import sphinx_rtd_theme |
| 124 | + html_theme = 'sphinx_rtd_theme' |
| 125 | + html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] |
| 126 | + |
| 127 | +# Theme options are theme-specific and customize the look and feel of a theme |
| 128 | +# further. For a list of options available for each theme, see the |
| 129 | +# documentation. |
| 130 | +# |
| 131 | +# html_theme_options = {} |
| 132 | +# https://sphinx-rtd-theme.readthedocs.io/en/latest/configuring.html#project-wide-configuration |
| 133 | +html_theme_options = { |
| 134 | + 'canonical_url': '', |
| 135 | + 'analytics_id': '', |
| 136 | + 'logo_only': False, |
| 137 | + 'display_version': True, |
| 138 | + 'prev_next_buttons_location': 'bottom', |
| 139 | + #'style_external_links': True, |
| 140 | + #'vcs_pageview_mode': '', |
| 141 | + # Toc options |
| 142 | + 'collapse_navigation': False, |
| 143 | + 'sticky_navigation': True, |
| 144 | + 'navigation_depth': 5, |
| 145 | + #'includehidden': True, |
| 146 | + #'titles_only': False |
| 147 | +} |
| 148 | + |
| 149 | +# Add any paths that contain custom static files (such as style sheets) here, |
| 150 | +# relative to this directory. They are copied after the builtin static files, |
| 151 | +# so a file named "default.css" will overwrite the builtin "default.css". |
| 152 | +html_static_path = ['_static'] |
| 153 | + |
| 154 | +# Custom sidebar templates, must be a dictionary that maps document names |
| 155 | +# to template names. |
| 156 | +# |
| 157 | +# The default sidebars (for documents that don't match any pattern) are |
| 158 | +# defined by theme itself. Builtin themes are using these templates by |
| 159 | +# default: ``['localtoc.html', 'relations.html', 'sourcelink.html', |
| 160 | +# 'searchbox.html']``. |
| 161 | +# |
| 162 | +# html_sidebars = {} |
| 163 | + |
| 164 | +def setup(app): |
| 165 | + '''Include custom css file''' |
| 166 | + app.add_stylesheet('css/pwncat.css') |
| 167 | + |
| 168 | + |
| 169 | +# If true, “Created using Sphinx” is shown in the HTML footer. Default is True. |
| 170 | +html_show_sphinx = False |
| 171 | + |
| 172 | + |
| 173 | +# -- Options for HTMLHelp output --------------------------------------------- |
| 174 | + |
| 175 | +# Output file base name for HTML help builder. |
| 176 | +htmlhelp_basename = 'pwncat' |
| 177 | + |
| 178 | + |
| 179 | +# -- Options for LaTeX output ------------------------------------------------ |
| 180 | + |
| 181 | +latex_elements = { |
| 182 | + # The paper size ('letterpaper' or 'a4paper'). |
| 183 | + # |
| 184 | + # 'papersize': 'letterpaper', |
| 185 | + |
| 186 | + # The font size ('10pt', '11pt' or '12pt'). |
| 187 | + # |
| 188 | + # 'pointsize': '10pt', |
| 189 | + |
| 190 | + # Additional stuff for the LaTeX preamble. |
| 191 | + # |
| 192 | + # 'preamble': '', |
| 193 | + |
| 194 | + # Latex figure (float) alignment |
| 195 | + # |
| 196 | + # 'figure_align': 'htbp', |
| 197 | +} |
| 198 | + |
| 199 | +# Grouping the document tree into LaTeX files. List of tuples |
| 200 | +# (source start file, target name, title, |
| 201 | +# author, documentclass [howto, manual, or own class]). |
| 202 | +latex_documents = [ |
| 203 | + ( |
| 204 | + master_doc, |
| 205 | + 'pwncat.tex', |
| 206 | + u'pwncat documentation', |
| 207 | + u'cytopia', |
| 208 | + 'manual' |
| 209 | + ), |
| 210 | +] |
| 211 | + |
| 212 | + |
| 213 | +# -- Options for manual page output ------------------------------------------ |
| 214 | + |
| 215 | +# One entry per manual page. List of tuples |
| 216 | +# (source start file, name, description, authors, manual section). |
| 217 | +man_pages = [ |
| 218 | + ( |
| 219 | + master_doc, |
| 220 | + 'pwncat', |
| 221 | + u'pwncat documentation', |
| 222 | + [author], |
| 223 | + 1 |
| 224 | + ) |
| 225 | +] |
0 commit comments