Skip to content

Commit f91de63

Browse files
authored
Create conf.py fcor ReadTheDocs integration
1 parent b25b3ab commit f91de63

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

docs/source/conf.py

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# For the full list of built-in configuration values, see the documentation:
4+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
5+
6+
# -- Project information -----------------------------------------------------
7+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
8+
9+
import re
10+
import time
11+
12+
project = 'PyWinBox'
13+
year = time.strftime("%Y")
14+
author = 'Kalmat'
15+
copyright = year + ", " + author
16+
release = "latest"
17+
with open("../../src/pywinbox/__init__.py", "r") as fileObj:
18+
match = re.search(
19+
r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', fileObj.read(), re.MULTILINE
20+
)
21+
if match:
22+
release = match.group(1)
23+
24+
# -- General configuration ---------------------------------------------------
25+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
26+
extensions = ["myst_parser"]
27+
myst_enable_extensions = ["colon_fence"]
28+
source_suffix = {
29+
'.rst': 'restructuredtext',
30+
'.txt': 'markdown',
31+
'.md': 'markdown',
32+
}
33+
templates_path = ['_templates']
34+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
35+
36+
# -- Options for HTML output -------------------------------------------------
37+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
38+
# https://www.sphinx-doc.org/en/master/usage/theming.html
39+
html_theme = 'bizstyle'
40+
html_static_path = ['_static']
41+
myst_heading_anchors = 7
42+
43+
# -- Copy the modules documentation ------------------------------------------
44+
# https://stackoverflow.com/questions/66495200/is-it-possible-to-include-external-rst-files-in-my-documentation
45+
from urllib.request import urlretrieve
46+
47+
urlretrieve(
48+
"https://raw.githubusercontent.com/kalmat/pywinbox/master/README.md",
49+
"index.md"
50+
)

0 commit comments

Comments
 (0)