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.
  • Internacionalização bilíngue: suporte nativo aos idiomas Inglês (en, default) e Português do Brasil (pt-br), com seletor de bandeiras (EUA e Brasil) no cabeçalho e roteador inteligente index.html na raiz.
  • 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/
│       └── publish-pypi.yml   # Integração contínua, docs (Pages) e publicação (PyPI)
├── 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.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for moodle-docs-theme 0.3.0
File Size Uploaded Provenance
moodle_docs_theme-0.3.0.tar.gz 31.8 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for moodle-docs-theme 0.3.0
File Interpreter ABI Platform
moodle_docs_theme-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 68.2 kB

Release files / moodle_docs_theme-0.3.0.tar.gz

Download URL moodle_docs_theme-0.3.0.tar.gz
Size 31.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4bad180bd8f40a4696c264f5b2dd5cecc7f27f8455506e8b5f7c83686ffce058
BLAKE2b-256 checksum
How to use checksums
6323940b3a8e84cd02c2d19c39842ac00fcb0f2c1b230df3e05b08dba1303116
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 log

Release files / moodle_docs_theme-0.3.0-py3-none-any.whl

Download URL moodle_docs_theme-0.3.0-py3-none-any.whl
Size 36.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4d690ed399de7f55766d49ab3bb180576f717ab31cea121d4df8d9f3c95bf215
BLAKE2b-256 checksum
How to use checksums
c6c0cb8404f55dd5ab6a3db1bfc0cc9b8e437265db69c02cde53e05c846b7db3
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 log

Security for moodle-docs-theme 0.3.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.

Select from 2 files

Attestation for moodle_docs_theme-0.3.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 log

A 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.

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