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.


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

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.2.1
File Size Uploaded Provenance
moodle_docs_theme-0.2.1.tar.gz 27.4 kB With provenance Details

Built distribution (wheel)

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

Total release size: 55.7 kB

Release files / moodle_docs_theme-0.2.1.tar.gz

Download URL moodle_docs_theme-0.2.1.tar.gz
Size 27.4 kB
Tags Source
SHA-256 checksum
How to use checksums
dcb64c1b044987da1363cf39dd413ede12d7ebdd5b6e202734f1d0abe63c0bbc
BLAKE2b-256 checksum
How to use checksums
9bdfe40e1c1668a29b8d3825b09b7cd0ca30513713f8c1fa2bfbc41aa75b6309
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.2.1-py3-none-any.whl

Download URL moodle_docs_theme-0.2.1-py3-none-any.whl
Size 28.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
df134e63f33a2911a217c86fef02dbe103429772cbd02c9896ee871b00826cbd
BLAKE2b-256 checksum
How to use checksums
87b46e704651c2cdb4b42a278ef3b773a4fd64c6786fdd1411902692160e44af
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.2.1

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