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.
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.
Template de documentação para repositórios
O moodle-docs-theme inclui um template completo e padronizado para estruturar a documentação de qualquer repositório ou plugin Moodle da organização:
Inicialização via CLI
# No diretório raiz do plugin
moodle-docs-theme init
O comando detecta o tipo de plugin, configura o docs/conf.py (com suporte a Markdown nativo via myst-parser), cria as páginas modelo (index.md, installation.md, configuration.md, usage.md), docs/requirements.txt e o workflow do GitHub Actions em .github/workflows/docs.yml.
Compilando a documentação
Para compilar a documentação do projeto atual:
moodle-docs-theme build
Ou para compilar a documentação do próprio tema:
python build_docs.py
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
│ └── template.rst # Guia de uso do template
├── moodle_docs_theme/ # Código fonte do tema Sphinx
│ ├── static/
│ │ ├── css/
│ │ │ ├── base.css
│ │ │ └── colors.css
│ │ └── js/
│ │ └── theme.js
│ ├── template/ # Arquivos modelo do template de documentação
│ │ ├── docs/
│ │ └── workflows/
│ ├── cli.py # CLI moodle-docs-theme (init, build)
│ ├── __main__.py
│ ├── layout.html
│ ├── page.html
│ ├── searchbox.html
│ ├── breadcrumbs.html
│ ├── theme.conf
│ ├── theme.toml
│ └── __init__.py
├── template/ # Template de documentação exposto na raiz
├── tests/ # Testes automatizados (pytest)
├── build_docs.py # Script para gerar a própria documentação
├── setup.py
├── pyproject.toml
├── MANIFEST.in
├── LICENSE
└── README.md
Compilando a documentação localmente
pip install -e .
python build_docs.py --clean
Licença
Este projeto está licenciado sob a Licença BSD 3-Clause. Consulte o arquivo LICENSE para mais detalhes.
Metadata
Release files for moodle-docs-theme 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| moodle_docs_theme-0.2.0.tar.gz | 26.9 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| moodle_docs_theme-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 54.5 kB
Release files / moodle_docs_theme-0.2.0.tar.gz
| Download URL | moodle_docs_theme-0.2.0.tar.gz |
|---|---|
| Size | 26.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dfe6828fdbf1429aab3f57a695579e8306e1b658b8ac5fe7b42cbc7e430ce46c
|
|
BLAKE2b-256 checksum How to use checksums |
cbb3cf1b5c1e060a323d8f2f7b4706acaee568e8eaba41c20cdfa488fde7db45
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.
Transparency logRelease files / moodle_docs_theme-0.2.0-py3-none-any.whl
| Download URL | moodle_docs_theme-0.2.0-py3-none-any.whl |
|---|---|
| Size | 27.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
82e115f18563d2ced3e1c9192789471ef84ce213d161d3d61c13144b5457ad2a
|
|
BLAKE2b-256 checksum How to use checksums |
f7cc7e814723bf2f2fb9380f65c6b16b5378cc90247f43bba7c9ed83cc631843
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.
Transparency logSecurity for moodle-docs-theme 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for moodle_docs_theme-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.