Skip to content

Commit c9c5661

Browse files
Merge pull request #15 from codeperfectplus/dev
Read the docs documentation bug fix
2 parents 42cf871 + be334be commit c9c5661

4 files changed

Lines changed: 160 additions & 2 deletions

File tree

.readthedocs.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Read the Docs configuration file for Sphinx projects
2+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3+
4+
# Required
5+
version: 2
6+
7+
# Set the OS, Python version and other tools you might need
8+
build:
9+
os: ubuntu-22.04
10+
tools:
11+
python: "3.12"
12+
13+
14+
# Build documentation in the "docs/" directory with Sphinx
15+
sphinx:
16+
configuration: docs/conf.py
17+
18+
# Optionally build your docs in additional formats such as PDF and ePub
19+
formats:
20+
- pdf
21+
- epub
22+
23+
python:
24+
install:
25+
- requirements: docs/requirements.txt

docs/_static/custom.css

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/* Navbar customization */
2+
.navbar .toc {
3+
display: none; /* This will hide the TOC */
4+
}
5+
.navbar a {
6+
color: #007bff; /* Link color */
7+
padding: 10px 15px; /* Padding around links */
8+
}
9+
10+
.navbar a:hover {
11+
background-color: #e2e6ea; /* Background color on hover */
12+
color: #0056b3; /* Darker link color on hover */
13+
}
14+
15+
.navbar .navbar-brand {
16+
font-weight: bold; /* Bold brand name */
17+
}
18+
19+
/* Responsive adjustments */
20+
@media (max-width: 768px) {
21+
.navbar {
22+
flex-direction: column; /* Stack items vertically on small screens */
23+
}
24+
}

docs/conf.py

Lines changed: 108 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,113 @@
1010
extensions = ['sphinx.ext.autosectionlabel']
1111
releases_github_path = "Py-Contributors/filemover"
1212
autosectionlabel_prefix_document = True
13-
html_theme = 'sphinx_rtd_theme' # 'pydata_sphinx_theme' 'alabaster'
1413
html_static_path = ['_static']
1514
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '.venv']
16-
html_sidebars = { '**': ['globaltoc.html', 'relations.html', 'sourcelink.html', 'searchbox.html'] }
15+
html_sidebars = { '**': ['globaltoc.html', 'relations.html', 'sourcelink.html', 'searchbox.html'] }
16+
17+
18+
19+
# -- General Configuration ---------------------------------------------------
20+
extensions = [
21+
'sphinx.ext.autodoc', # Automatically document from docstrings
22+
'sphinx.ext.todo', # Support for todo notes
23+
'sphinx.ext.coverage', # Check documentation coverage
24+
'sphinx.ext.viewcode', # Add links to highlighted source code
25+
'sphinx.ext.autosectionlabel', # Automatically reference sections
26+
'sphinx.ext.githubpages', # Publish HTML docs on GitHub Pages
27+
]
28+
29+
# Prefix document path to section labels to avoid ambiguity
30+
autosectionlabel_prefix_document = True
31+
32+
# PDF generation (requires an external tool)
33+
pdf_documents = [
34+
('index', 'SystemGuard_Documentation', 'SystemGuard Docs', 'SystemGuard Team')
35+
]
36+
37+
# GitHub Releases Integration
38+
releases_github_path = "codeperfectplus/systemguard"
39+
releases_unstable_prehistory = True # Treat pre-v1.0 releases as unstable
40+
41+
# Custom templates path
42+
templates_path = ['_templates']
43+
44+
# Specify the source file format
45+
source_suffix = ".rst"
46+
47+
# Main document (entry point)
48+
master_doc = "index"
49+
50+
# Patterns to exclude from the build process
51+
exclude_patterns = [
52+
'_build',
53+
'Thumbs.db',
54+
'.DS_Store',
55+
'.venv'
56+
]
57+
58+
# -- HTML Output Configuration ------------------------------------------------
59+
# Specify the theme for HTML output
60+
html_theme = 'pydata_sphinx_theme' # Alternative themes: 'sphinx_rtd_theme', 'alabaster'
61+
62+
# Paths for custom static files (e.g., CSS stylesheets)
63+
html_static_path = ['_static']
64+
65+
# Theme options for pydata_sphinx_theme
66+
html_theme_options = {
67+
"show_prev_next": True, # Enable next/previous buttons
68+
"navigation_depth": 4, # Control TOC depth, increase to show more levels
69+
"collapse_navigation": True, # Collapsible sidebar navigation
70+
"navbar_align": "content", # Center-align navbar content
71+
"show_nav_level": 2, # Show second-level headings in the navbar
72+
"icon_links": [
73+
{
74+
"name": "GitHub",
75+
"url": "https://github.com/codeperfectplus/systemguard",
76+
"icon": "fab fa-github",
77+
"type": "fontawesome"
78+
},
79+
{
80+
"name": "Releases",
81+
"url": "https://github.com/codeperfectplus/systemguard/releases",
82+
"icon": "fas fa-tag",
83+
"type": "fontawesome"
84+
}
85+
],
86+
"use_edit_page_button": True,
87+
88+
}
89+
90+
# Provide context for "Edit on GitHub" button
91+
html_context = {
92+
"github_user": "codeperfectplus",
93+
"github_repo": "systemguard",
94+
"github_version": "production",
95+
"doc_path": "docs",
96+
}
97+
98+
# Configure sidebars
99+
html_sidebars = {
100+
'**': [
101+
'globaltoc.html', # Global table of contents
102+
'relations.html', # Links to next/previous pages
103+
'sourcelink.html', # Link to view source code
104+
'searchbox.html' # Search box
105+
]
106+
}
107+
108+
# Configure sidebars for documentation
109+
html_sidebars = {
110+
'**': [
111+
'globaltoc.html', # Global table of contents
112+
'relations.html', # Links to next/previous pages
113+
'sourcelink.html', # Link to view source code
114+
'searchbox.html', # Search box
115+
]
116+
}
117+
118+
119+
# Additional CSS for improved navbar styling
120+
html_css_files = [
121+
'custom.css' # Custom CSS file for additional styling
122+
]

docs/requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
sphinx
2+
pydata_sphinx_theme
3+

0 commit comments

Comments
 (0)