Skip to main content

moodle-docs-theme

Tema sphinx baseado do Moodle Docs.

Um tema Sphinx reutilizável inspirado visualmente na documentação oficial do Moodle (docs.moodle.org), criado para temas e plugins Moodle mantidos por organizações no GitHub. Mantém a mesma identidade visual — cabeçalho claro com faixa de destaque laranja, títulos em roxo, links em azul — em toda a documentação da sua organização.

Python Sphinx CI & Docs License


Recursos principais

  • Design inspirado no MoodleDocs: cabeçalho claro com faixa de destaque laranja (#f98012), títulos em roxo (#6c336d), links em azul (#3366cc) — a mesma linguagem visual do docs.moodle.org.
  • Modo escuro: alternância de tema claro/escuro com detecção de preferência do sistema e persistência em localStorage.
  • Customização simples: cores, logotipo, fontes e links de navegação configuráveis via conf.py, sem editar CSS.
  • Blocos de código interativos: botão para copiar snippets com um clique.
  • Editar no GitHub: link automático para editar a página no repositório correspondente.
  • 100% responsivo: menu adaptado para dispositivos móveis e desktop.
  • Automação GitHub Actions: build e deploy de docs no GitHub Pages, publicação no PyPI via Trusted Publishing a cada release.

Instalação

Via PyPI

pip install moodle-docs-theme

Instalação direta do GitHub

pip install git+https://github.com/moodle-by-kelsoncm/moodle-docs-theme.git

Desenvolvimento local

git clone https://github.com/moodle-by-kelsoncm/moodle-docs-theme.git
cd moodle-docs-theme
python3 -m venv .venv
source .venv/bin/activate
pip install -e .

Configuração básica no conf.py

No arquivo conf.py da documentação do seu tema ou plugin Moodle, adicione:

import moodle_docs_theme

html_theme = "moodle_docs_theme"
html_theme_path = [moodle_docs_theme.get_html_theme_path()]

extensions = [
    "sphinx.ext.githubpages",
]

html_theme_options = {
    "primary_color": "#6c336d",
    "secondary_color": "#f98012",
    "project_name": "Meu Plugin Moodle",
    "logo": "logo.png",
    "logo_height": "32px",
    "github_url": "https://github.com/usuario/meu-plugin",
    "github_repo": "usuario/meu-plugin",
    "github_version": "main",
    "doc_path": "docs/",
    "show_edit_on_github": True,
    "enable_dark_mode": True,
    "navigation_links": "Início|index.html, Instalação|installation.html",
}

html_static_path = ["_static"]

Veja a documentação completa para a lista completa de opções.


Estrutura do repositório

moodle-docs-theme/
├── .github/
│   └── workflows/
│       ├── ci.yml             # Integração contínua e deploy no GitHub Pages
│       └── publish-pypi.yml   # Deploy automático no PyPI via Trusted Publishing
├── docs/                      # Documentação oficial do tema
│   ├── conf.py
│   ├── index.rst
│   ├── installation.rst
│   └── configuration.rst
├── moodle_docs_theme/         # Código fonte do tema Sphinx
│   ├── static/
│   │   ├── css/
│   │   │   ├── base.css
│   │   │   └── colors.css
│   │   └── js/
│   │       └── theme.js
│   ├── layout.html
│   ├── page.html
│   ├── searchbox.html
│   ├── breadcrumbs.html
│   ├── theme.conf
│   ├── theme.toml
│   └── __init__.py
├── setup.py
├── pyproject.toml
├── MANIFEST.in
├── LICENSE
└── README.md

Compilando a documentação localmente

pip install -e .
sphinx-build -b html docs docs/_build/html

Licença

Este projeto está licenciado sob a Licença BSD 3-Clause. Consulte o arquivo LICENSE para mais detalhes.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

moodle_docs_theme-0.1.0.tar.gz (18.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

moodle_docs_theme-0.1.0-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

Details for the file moodle_docs_theme-0.1.0.tar.gz.

File metadata

  • Download URL: moodle_docs_theme-0.1.0.tar.gz
  • Upload date:
  • Size: 18.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for moodle_docs_theme-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5b71dbbc4aed3fe1d5101b9100597e17a4fe238564bc9ee283a5ac08f3c3830a
MD5 19e0bdf25ed88bd989322152a3c4c454
BLAKE2b-256 39beea34ecb832f3c739a8ede9d107bd4a84519f7681a7fce652b29597c3b433

See more details on using hashes here.

Provenance

The following attestation bundles were made for moodle_docs_theme-0.1.0.tar.gz:

Publisher: publish-pypi.yml on moodle-by-kelsoncm/moodle-docs-theme

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file moodle_docs_theme-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for moodle_docs_theme-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6ff4cd3894d47af6f610028a9bba103bc059048c424ad5dd77822a1c89a4f62f
MD5 652c184f4b039668116270947e79a9c6
BLAKE2b-256 57d8dc4a989caf13d3a441319b522c4b356b06bceebbc51bd8f4d99ed1a4f6a9

See more details on using hashes here.

Provenance

The following attestation bundles were made for moodle_docs_theme-0.1.0-py3-none-any.whl:

Publisher: publish-pypi.yml on moodle-by-kelsoncm/moodle-docs-theme

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page