diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 0000000..adbb631 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,25 @@ +# Read the Docs configuration file for Sphinx projects +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Set the OS, Python version and other tools you might need +build: + os: ubuntu-22.04 + tools: + python: "3.12" + + +# Build documentation in the "docs/" directory with Sphinx +sphinx: + configuration: docs/conf.py + +# Optionally build your docs in additional formats such as PDF and ePub +formats: + - pdf + - epub + +python: + install: + - requirements: docs/requirements.txt \ No newline at end of file diff --git a/docs/_static/custom.css b/docs/_static/custom.css new file mode 100644 index 0000000..2812927 --- /dev/null +++ b/docs/_static/custom.css @@ -0,0 +1,24 @@ +/* Navbar customization */ +.navbar .toc { + display: none; /* This will hide the TOC */ +} +.navbar a { + color: #007bff; /* Link color */ + padding: 10px 15px; /* Padding around links */ +} + +.navbar a:hover { + background-color: #e2e6ea; /* Background color on hover */ + color: #0056b3; /* Darker link color on hover */ +} + +.navbar .navbar-brand { + font-weight: bold; /* Bold brand name */ +} + +/* Responsive adjustments */ +@media (max-width: 768px) { + .navbar { + flex-direction: column; /* Stack items vertically on small screens */ + } +} \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index ebc7fec..72ee139 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -10,7 +10,113 @@ extensions = ['sphinx.ext.autosectionlabel'] releases_github_path = "Py-Contributors/filemover" autosectionlabel_prefix_document = True -html_theme = 'sphinx_rtd_theme' # 'pydata_sphinx_theme' 'alabaster' html_static_path = ['_static'] exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '.venv'] -html_sidebars = { '**': ['globaltoc.html', 'relations.html', 'sourcelink.html', 'searchbox.html'] } \ No newline at end of file +html_sidebars = { '**': ['globaltoc.html', 'relations.html', 'sourcelink.html', 'searchbox.html'] } + + + +# -- General Configuration --------------------------------------------------- +extensions = [ + 'sphinx.ext.autodoc', # Automatically document from docstrings + 'sphinx.ext.todo', # Support for todo notes + 'sphinx.ext.coverage', # Check documentation coverage + 'sphinx.ext.viewcode', # Add links to highlighted source code + 'sphinx.ext.autosectionlabel', # Automatically reference sections + 'sphinx.ext.githubpages', # Publish HTML docs on GitHub Pages +] + +# Prefix document path to section labels to avoid ambiguity +autosectionlabel_prefix_document = True + +# PDF generation (requires an external tool) +pdf_documents = [ + ('index', 'SystemGuard_Documentation', 'SystemGuard Docs', 'SystemGuard Team') +] + +# GitHub Releases Integration +releases_github_path = "codeperfectplus/systemguard" +releases_unstable_prehistory = True # Treat pre-v1.0 releases as unstable + +# Custom templates path +templates_path = ['_templates'] + +# Specify the source file format +source_suffix = ".rst" + +# Main document (entry point) +master_doc = "index" + +# Patterns to exclude from the build process +exclude_patterns = [ + '_build', + 'Thumbs.db', + '.DS_Store', + '.venv' +] + +# -- HTML Output Configuration ------------------------------------------------ +# Specify the theme for HTML output +html_theme = 'pydata_sphinx_theme' # Alternative themes: 'sphinx_rtd_theme', 'alabaster' + +# Paths for custom static files (e.g., CSS stylesheets) +html_static_path = ['_static'] + +# Theme options for pydata_sphinx_theme +html_theme_options = { + "show_prev_next": True, # Enable next/previous buttons + "navigation_depth": 4, # Control TOC depth, increase to show more levels + "collapse_navigation": True, # Collapsible sidebar navigation + "navbar_align": "content", # Center-align navbar content + "show_nav_level": 2, # Show second-level headings in the navbar + "icon_links": [ + { + "name": "GitHub", + "url": "https://github.com/codeperfectplus/systemguard", + "icon": "fab fa-github", + "type": "fontawesome" + }, + { + "name": "Releases", + "url": "https://github.com/codeperfectplus/systemguard/releases", + "icon": "fas fa-tag", + "type": "fontawesome" + } + ], + "use_edit_page_button": True, + +} + +# Provide context for "Edit on GitHub" button +html_context = { + "github_user": "codeperfectplus", + "github_repo": "systemguard", + "github_version": "production", + "doc_path": "docs", +} + +# Configure sidebars +html_sidebars = { + '**': [ + 'globaltoc.html', # Global table of contents + 'relations.html', # Links to next/previous pages + 'sourcelink.html', # Link to view source code + 'searchbox.html' # Search box + ] +} + +# Configure sidebars for documentation +html_sidebars = { + '**': [ + 'globaltoc.html', # Global table of contents + 'relations.html', # Links to next/previous pages + 'sourcelink.html', # Link to view source code + 'searchbox.html', # Search box + ] +} + + +# Additional CSS for improved navbar styling +html_css_files = [ + 'custom.css' # Custom CSS file for additional styling +] \ No newline at end of file diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..5a1d1ea --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,3 @@ +sphinx +pydata_sphinx_theme +