moodle-docs-theme 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,28 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2026, Contribuições de KelsonCM à comunidade Moodle
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,6 @@
1
+ include LICENSE
2
+ include README.md
3
+ include moodle_docs_theme/theme.conf
4
+ include moodle_docs_theme/theme.toml
5
+ include moodle_docs_theme/*.html
6
+ recursive-include moodle_docs_theme/static *
@@ -0,0 +1,179 @@
1
+ Metadata-Version: 2.4
2
+ Name: moodle-docs-theme
3
+ Version: 0.1.0
4
+ Summary: Um tema Sphinx reutilizável inspirado visualmente na documentação oficial do Moodle (docs.moodle.org)
5
+ Home-page: https://github.com/moodle-by-kelsoncm/moodle-docs-theme
6
+ Author: KelsonCM
7
+ Author-email: KelsonCM <kelsoncm@gmail.com>
8
+ License-Expression: BSD-3-Clause
9
+ Project-URL: Homepage, https://github.com/moodle-by-kelsoncm/moodle-docs-theme
10
+ Project-URL: Repository, https://github.com/moodle-by-kelsoncm/moodle-docs-theme
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Environment :: Web Environment
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.8
17
+ Classifier: Programming Language :: Python :: 3.9
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Topic :: Documentation
22
+ Classifier: Topic :: Documentation :: Sphinx
23
+ Classifier: Topic :: Software Development :: Documentation
24
+ Requires-Python: >=3.8
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE
27
+ Requires-Dist: sphinx>=4.0
28
+ Dynamic: author
29
+ Dynamic: home-page
30
+ Dynamic: license-file
31
+ Dynamic: requires-python
32
+
33
+ # moodle-docs-theme
34
+
35
+ Tema sphinx baseado do Moodle Docs.
36
+
37
+ Um **tema Sphinx reutilizável** inspirado visualmente na documentação oficial do Moodle
38
+ ([docs.moodle.org](https://docs.moodle.org/)), criado para temas e plugins Moodle
39
+ mantidos por organizações no GitHub. Mantém a mesma identidade visual — cabeçalho claro
40
+ com faixa de destaque laranja, títulos em roxo, links em azul — em toda a documentação
41
+ da sua organização.
42
+
43
+ ![Python](https://img.shields.io/badge/python-3.8%2B-blue)
44
+ ![Sphinx](https://img.shields.io/badge/sphinx-4.0%2B-green)
45
+ ![CI & Docs](https://github.com/moodle-by-kelsoncm/moodle-docs-theme/actions/workflows/ci.yml/badge.svg)
46
+ ![License](https://img.shields.io/badge/license-BSD--3--Clause-blue)
47
+
48
+ ---
49
+
50
+ ## Recursos principais
51
+
52
+ - **Design inspirado no MoodleDocs**: cabeçalho claro com faixa de destaque laranja
53
+ (`#f98012`), títulos em roxo (`#6c336d`), links em azul (`#3366cc`) — a mesma
54
+ linguagem visual do docs.moodle.org.
55
+ - **Modo escuro**: alternância de tema claro/escuro com detecção de preferência do
56
+ sistema e persistência em `localStorage`.
57
+ - **Customização simples**: cores, logotipo, fontes e links de navegação configuráveis
58
+ via `conf.py`, sem editar CSS.
59
+ - **Blocos de código interativos**: botão para copiar snippets com um clique.
60
+ - **Editar no GitHub**: link automático para editar a página no repositório
61
+ correspondente.
62
+ - **100% responsivo**: menu adaptado para dispositivos móveis e desktop.
63
+ - **Automação GitHub Actions**: build e deploy de docs no GitHub Pages, publicação no
64
+ PyPI via *Trusted Publishing* a cada release.
65
+
66
+ ---
67
+
68
+ ## Instalação
69
+
70
+ ### Via PyPI
71
+
72
+ ```bash
73
+ pip install moodle-docs-theme
74
+ ```
75
+
76
+ ### Instalação direta do GitHub
77
+
78
+ ```bash
79
+ pip install git+https://github.com/moodle-by-kelsoncm/moodle-docs-theme.git
80
+ ```
81
+
82
+ ### Desenvolvimento local
83
+
84
+ ```bash
85
+ git clone https://github.com/moodle-by-kelsoncm/moodle-docs-theme.git
86
+ cd moodle-docs-theme
87
+ python3 -m venv .venv
88
+ source .venv/bin/activate
89
+ pip install -e .
90
+ ```
91
+
92
+ ---
93
+
94
+ ## Configuração básica no `conf.py`
95
+
96
+ No arquivo `conf.py` da documentação do seu tema ou plugin Moodle, adicione:
97
+
98
+ ```python
99
+ import moodle_docs_theme
100
+
101
+ html_theme = "moodle_docs_theme"
102
+ html_theme_path = [moodle_docs_theme.get_html_theme_path()]
103
+
104
+ extensions = [
105
+ "sphinx.ext.githubpages",
106
+ ]
107
+
108
+ html_theme_options = {
109
+ "primary_color": "#6c336d",
110
+ "secondary_color": "#f98012",
111
+ "project_name": "Meu Plugin Moodle",
112
+ "logo": "logo.png",
113
+ "logo_height": "32px",
114
+ "github_url": "https://github.com/usuario/meu-plugin",
115
+ "github_repo": "usuario/meu-plugin",
116
+ "github_version": "main",
117
+ "doc_path": "docs/",
118
+ "show_edit_on_github": True,
119
+ "enable_dark_mode": True,
120
+ "navigation_links": "Início|index.html, Instalação|installation.html",
121
+ }
122
+
123
+ html_static_path = ["_static"]
124
+ ```
125
+
126
+ Veja a [documentação completa](https://moodle-by-kelsoncm.github.io/moodle-docs-theme/)
127
+ para a lista completa de opções.
128
+
129
+ ---
130
+
131
+ ## Estrutura do repositório
132
+
133
+ ```
134
+ moodle-docs-theme/
135
+ ├── .github/
136
+ │ └── workflows/
137
+ │ ├── ci.yml # Integração contínua e deploy no GitHub Pages
138
+ │ └── publish-pypi.yml # Deploy automático no PyPI via Trusted Publishing
139
+ ├── docs/ # Documentação oficial do tema
140
+ │ ├── conf.py
141
+ │ ├── index.rst
142
+ │ ├── installation.rst
143
+ │ └── configuration.rst
144
+ ├── moodle_docs_theme/ # Código fonte do tema Sphinx
145
+ │ ├── static/
146
+ │ │ ├── css/
147
+ │ │ │ ├── base.css
148
+ │ │ │ └── colors.css
149
+ │ │ └── js/
150
+ │ │ └── theme.js
151
+ │ ├── layout.html
152
+ │ ├── page.html
153
+ │ ├── searchbox.html
154
+ │ ├── breadcrumbs.html
155
+ │ ├── theme.conf
156
+ │ ├── theme.toml
157
+ │ └── __init__.py
158
+ ├── setup.py
159
+ ├── pyproject.toml
160
+ ├── MANIFEST.in
161
+ ├── LICENSE
162
+ └── README.md
163
+ ```
164
+
165
+ ---
166
+
167
+ ## Compilando a documentação localmente
168
+
169
+ ```bash
170
+ pip install -e .
171
+ sphinx-build -b html docs docs/_build/html
172
+ ```
173
+
174
+ ---
175
+
176
+ ## Licença
177
+
178
+ Este projeto está licenciado sob a Licença BSD 3-Clause. Consulte o arquivo
179
+ [LICENSE](LICENSE) para mais detalhes.
@@ -0,0 +1,147 @@
1
+ # moodle-docs-theme
2
+
3
+ Tema sphinx baseado do Moodle Docs.
4
+
5
+ Um **tema Sphinx reutilizável** inspirado visualmente na documentação oficial do Moodle
6
+ ([docs.moodle.org](https://docs.moodle.org/)), criado para temas e plugins Moodle
7
+ mantidos por organizações no GitHub. Mantém a mesma identidade visual — cabeçalho claro
8
+ com faixa de destaque laranja, títulos em roxo, links em azul — em toda a documentação
9
+ da sua organização.
10
+
11
+ ![Python](https://img.shields.io/badge/python-3.8%2B-blue)
12
+ ![Sphinx](https://img.shields.io/badge/sphinx-4.0%2B-green)
13
+ ![CI & Docs](https://github.com/moodle-by-kelsoncm/moodle-docs-theme/actions/workflows/ci.yml/badge.svg)
14
+ ![License](https://img.shields.io/badge/license-BSD--3--Clause-blue)
15
+
16
+ ---
17
+
18
+ ## Recursos principais
19
+
20
+ - **Design inspirado no MoodleDocs**: cabeçalho claro com faixa de destaque laranja
21
+ (`#f98012`), títulos em roxo (`#6c336d`), links em azul (`#3366cc`) — a mesma
22
+ linguagem visual do docs.moodle.org.
23
+ - **Modo escuro**: alternância de tema claro/escuro com detecção de preferência do
24
+ sistema e persistência em `localStorage`.
25
+ - **Customização simples**: cores, logotipo, fontes e links de navegação configuráveis
26
+ via `conf.py`, sem editar CSS.
27
+ - **Blocos de código interativos**: botão para copiar snippets com um clique.
28
+ - **Editar no GitHub**: link automático para editar a página no repositório
29
+ correspondente.
30
+ - **100% responsivo**: menu adaptado para dispositivos móveis e desktop.
31
+ - **Automação GitHub Actions**: build e deploy de docs no GitHub Pages, publicação no
32
+ PyPI via *Trusted Publishing* a cada release.
33
+
34
+ ---
35
+
36
+ ## Instalação
37
+
38
+ ### Via PyPI
39
+
40
+ ```bash
41
+ pip install moodle-docs-theme
42
+ ```
43
+
44
+ ### Instalação direta do GitHub
45
+
46
+ ```bash
47
+ pip install git+https://github.com/moodle-by-kelsoncm/moodle-docs-theme.git
48
+ ```
49
+
50
+ ### Desenvolvimento local
51
+
52
+ ```bash
53
+ git clone https://github.com/moodle-by-kelsoncm/moodle-docs-theme.git
54
+ cd moodle-docs-theme
55
+ python3 -m venv .venv
56
+ source .venv/bin/activate
57
+ pip install -e .
58
+ ```
59
+
60
+ ---
61
+
62
+ ## Configuração básica no `conf.py`
63
+
64
+ No arquivo `conf.py` da documentação do seu tema ou plugin Moodle, adicione:
65
+
66
+ ```python
67
+ import moodle_docs_theme
68
+
69
+ html_theme = "moodle_docs_theme"
70
+ html_theme_path = [moodle_docs_theme.get_html_theme_path()]
71
+
72
+ extensions = [
73
+ "sphinx.ext.githubpages",
74
+ ]
75
+
76
+ html_theme_options = {
77
+ "primary_color": "#6c336d",
78
+ "secondary_color": "#f98012",
79
+ "project_name": "Meu Plugin Moodle",
80
+ "logo": "logo.png",
81
+ "logo_height": "32px",
82
+ "github_url": "https://github.com/usuario/meu-plugin",
83
+ "github_repo": "usuario/meu-plugin",
84
+ "github_version": "main",
85
+ "doc_path": "docs/",
86
+ "show_edit_on_github": True,
87
+ "enable_dark_mode": True,
88
+ "navigation_links": "Início|index.html, Instalação|installation.html",
89
+ }
90
+
91
+ html_static_path = ["_static"]
92
+ ```
93
+
94
+ Veja a [documentação completa](https://moodle-by-kelsoncm.github.io/moodle-docs-theme/)
95
+ para a lista completa de opções.
96
+
97
+ ---
98
+
99
+ ## Estrutura do repositório
100
+
101
+ ```
102
+ moodle-docs-theme/
103
+ ├── .github/
104
+ │ └── workflows/
105
+ │ ├── ci.yml # Integração contínua e deploy no GitHub Pages
106
+ │ └── publish-pypi.yml # Deploy automático no PyPI via Trusted Publishing
107
+ ├── docs/ # Documentação oficial do tema
108
+ │ ├── conf.py
109
+ │ ├── index.rst
110
+ │ ├── installation.rst
111
+ │ └── configuration.rst
112
+ ├── moodle_docs_theme/ # Código fonte do tema Sphinx
113
+ │ ├── static/
114
+ │ │ ├── css/
115
+ │ │ │ ├── base.css
116
+ │ │ │ └── colors.css
117
+ │ │ └── js/
118
+ │ │ └── theme.js
119
+ │ ├── layout.html
120
+ │ ├── page.html
121
+ │ ├── searchbox.html
122
+ │ ├── breadcrumbs.html
123
+ │ ├── theme.conf
124
+ │ ├── theme.toml
125
+ │ └── __init__.py
126
+ ├── setup.py
127
+ ├── pyproject.toml
128
+ ├── MANIFEST.in
129
+ ├── LICENSE
130
+ └── README.md
131
+ ```
132
+
133
+ ---
134
+
135
+ ## Compilando a documentação localmente
136
+
137
+ ```bash
138
+ pip install -e .
139
+ sphinx-build -b html docs docs/_build/html
140
+ ```
141
+
142
+ ---
143
+
144
+ ## Licença
145
+
146
+ Este projeto está licenciado sob a Licença BSD 3-Clause. Consulte o arquivo
147
+ [LICENSE](LICENSE) para mais detalhes.
@@ -0,0 +1,92 @@
1
+ """
2
+ moodle_docs_theme - A reusable Sphinx HTML theme inspired by docs.moodle.org (MoodleDocs).
3
+ """
4
+
5
+ import os
6
+ from typing import Dict, Any
7
+
8
+ __version__ = "0.1.0"
9
+
10
+
11
+ def get_html_theme_path() -> str:
12
+ """
13
+ Return the absolute path to the directory containing theme.conf.
14
+
15
+ This function is maintained for backward compatibility with older Sphinx theme patterns.
16
+ Modern Sphinx 1.6+ discovers the theme automatically via entry points.
17
+ """
18
+ return os.path.abspath(os.path.dirname(__file__))
19
+
20
+
21
+ def validate_github_actions_config(app: Any) -> None:
22
+ """
23
+ Validate Sphinx configuration when running inside GitHub Actions.
24
+
25
+ If GITHUB_ACTIONS == 'true', ensures that:
26
+ 1. 'moodle_docs_theme' is present in app.config.extensions
27
+ 2. 'sphinx.ext.githubpages' is present in app.config.extensions
28
+
29
+ Raises ExtensionError if requirements are not met.
30
+ """
31
+ is_github_actions = (
32
+ os.environ.get("GITHUB_ACTIONS") == "true" or "GITHUB_RUN_ID" in os.environ
33
+ )
34
+
35
+ if not is_github_actions:
36
+ return
37
+
38
+ extensions = getattr(app.config, "extensions", []) or []
39
+ missing_requirements = []
40
+
41
+ if "moodle_docs_theme" not in extensions:
42
+ missing_requirements.append(
43
+ "• 'moodle_docs_theme' deve estar listado em 'extensions = [...]' no seu docs/conf.py."
44
+ )
45
+
46
+ if "sphinx.ext.githubpages" not in extensions:
47
+ missing_requirements.append(
48
+ "• 'sphinx.ext.githubpages' deve estar listado em 'extensions = [...]' no seu docs/conf.py para gerar o arquivo .nojekyll e evitar que o GitHub Pages bloqueie a pasta _static/."
49
+ )
50
+
51
+ if missing_requirements:
52
+ error_msg = (
53
+ "\n"
54
+ "================================================================================\n"
55
+ "[moodle_docs_theme] ERRO DE CONFIGURAÇÃO NO GITHUB ACTIONS\n"
56
+ "================================================================================\n"
57
+ "Foi detectada a execução dentro do ambiente GitHub Actions, mas as configurações\n"
58
+ "obrigatórias do tema não foram encontradas no seu 'docs/conf.py':\n\n"
59
+ + "\n".join(missing_requirements)
60
+ + "\n\n"
61
+ "Por favor, certifique-se de atualizar o 'docs/conf.py' do seu projeto:\n\n"
62
+ " extensions = [\n"
63
+ " 'sphinx.ext.autodoc',\n"
64
+ " 'sphinx.ext.githubpages',\n"
65
+ " 'moodle_docs_theme',\n"
66
+ " ]\n\n"
67
+ "================================================================================\n"
68
+ )
69
+ from sphinx.errors import ExtensionError
70
+ raise ExtensionError(error_msg)
71
+
72
+
73
+ def setup(app: Any) -> Dict[str, Any]:
74
+ """
75
+ Sphinx extension setup function.
76
+
77
+ Registers the theme with Sphinx when activated in conf.py.
78
+ """
79
+ theme_path = get_html_theme_path()
80
+ app.add_html_theme("moodle_docs_theme", theme_path)
81
+
82
+ app.add_css_file("css/colors.css")
83
+ app.add_css_file("css/base.css")
84
+ app.add_js_file("js/theme.js")
85
+
86
+ app.connect("builder-inited", validate_github_actions_config)
87
+
88
+ return {
89
+ "version": __version__,
90
+ "parallel_read_safe": True,
91
+ "parallel_write_safe": True,
92
+ }
@@ -0,0 +1,38 @@
1
+ {# Breadcrumbs navigation bar #}
2
+ <div class="moodle-breadcrumbs-bar">
3
+ <div class="moodle-breadcrumbs-inner">
4
+ <nav aria-label="Breadcrumbs">
5
+ <ul class="moodle-breadcrumbs">
6
+ <li>
7
+ <a href="{{ pathto(master_doc) }}">{{ _('Início') }}</a>
8
+ </li>
9
+ {% for parent in parents %}
10
+ <li>
11
+ <a href="{{ parent.link|e }}">{{ parent.title }}</a>
12
+ </li>
13
+ {% endfor %}
14
+ {% if pagename != master_doc %}
15
+ <li aria-current="page">
16
+ <span>{{ title|striptags }}</span>
17
+ </li>
18
+ {% endif %}
19
+ </ul>
20
+ </nav>
21
+
22
+ {# Edit on GitHub link #}
23
+ {% if theme_show_edit_on_github|tobool and (theme_github_url or theme_github_repo) %}
24
+ {% set gh_repo = theme_github_repo if theme_github_repo else (theme_github_url.rstrip('/').split('/')[-2:] | join('/')) %}
25
+ {% set gh_version = theme_github_version if theme_github_version else 'main' %}
26
+ {% set gh_doc_path = theme_doc_path if theme_doc_path else 'docs/' %}
27
+ {% set file_ext = page_source_suffix if page_source_suffix and page_source_suffix is string else '.rst' %}
28
+ {% set edit_url = "https://github.com/" ~ gh_repo ~ "/edit/" ~ gh_version ~ "/" ~ gh_doc_path.rstrip('/') ~ "/" ~ pagename ~ file_ext %}
29
+ <a href="{{ edit_url }}" class="edit-on-github-link" target="_blank" rel="noopener noreferrer" title="Editar esta página no GitHub">
30
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
31
+ <path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"></path>
32
+ <path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"></path>
33
+ </svg>
34
+ <span>Editar no GitHub</span>
35
+ </a>
36
+ {% endif %}
37
+ </div>
38
+ </div>
@@ -0,0 +1,179 @@
1
+ {% extends "basic/layout.html" %}
2
+
3
+ {% block doctype %}
4
+ <!DOCTYPE html>
5
+ {% endblock %}
6
+
7
+ {% block htmltag %}
8
+ <html lang="{{ language if language else 'pt-BR' }}">
9
+ {% endblock %}
10
+
11
+ {% block extrahead %}
12
+ {{ super() }}
13
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
14
+
15
+ {# Script inline de inicialização instantânea do Dark Mode (Evita FOUC) #}
16
+ <script>
17
+ (function() {
18
+ try {
19
+ var storedTheme = localStorage.getItem('moodle-theme');
20
+ var systemPrefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
21
+ var theme = storedTheme || (systemPrefersDark ? 'dark' : 'light');
22
+ if (theme === 'dark') {
23
+ document.documentElement.setAttribute('data-theme', 'dark');
24
+ } else {
25
+ document.documentElement.removeAttribute('data-theme');
26
+ }
27
+ } catch (e) {}
28
+ })();
29
+ </script>
30
+
31
+ {# Carregamento da fonte Open Sans via Google Fonts (mesma família usada no docs.moodle.org) #}
32
+ <link rel="preconnect" href="https://fonts.googleapis.com">
33
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
34
+ <link href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,600;0,700;1,400&display=swap" rel="stylesheet">
35
+
36
+ {# Dynamic CSS Variable overrides from theme_options #}
37
+ <style>
38
+ :root {
39
+ {% if theme_primary_color %}--moodle-primary: {{ theme_primary_color }};{% endif %}
40
+ {% if theme_secondary_color %}--moodle-accent: {{ theme_secondary_color }}; --moodle-header-border: {{ theme_secondary_color }};{% endif %}
41
+ {% if theme_accent_color %}--moodle-sub-header-bg: {{ theme_accent_color }};{% endif %}
42
+ {% if theme_text_color %}--moodle-text: {{ theme_text_color }};{% endif %}
43
+ {% if theme_bg_color %}--moodle-bg: {{ theme_bg_color }};{% endif %}
44
+ {% if theme_code_bg_color %}--moodle-code-bg: {{ theme_code_bg_color }};{% endif %}
45
+ {% if theme_link_color %}--moodle-link: {{ theme_link_color }};{% endif %}
46
+ {% if theme_link_hover_color %}--moodle-link-hover: {{ theme_link_hover_color }};{% endif %}
47
+ {% if theme_sidebar_bg %}--moodle-sidebar-bg: {{ theme_sidebar_bg }};{% endif %}
48
+ {% if theme_nav_text_color %}--moodle-nav-text: {{ theme_nav_text_color }};{% endif %}
49
+ }
50
+ </style>
51
+ {% endblock %}
52
+
53
+ {% block header %}
54
+ <div class="moodle-site-wrapper">
55
+ {# 1. Top Header Bar (Estilo MoodleDocs: fundo claro, marca à esquerda, faixa laranja inferior) #}
56
+ <header class="moodle-header">
57
+ <div class="moodle-header-inner">
58
+ {# Brand Logo & Name #}
59
+ <div class="moodle-brand-group">
60
+ <a href="{{ pathto(master_doc) }}" class="moodle-brand">
61
+ {% if theme_logo %}
62
+ <img src="{{ pathto('_static/' ~ theme_logo, 1) }}" alt="{{ project }}" class="moodle-brand-logo" style="{% if theme_logo_height %}height: {{ theme_logo_height }};{% endif %}" />
63
+ {% elif logo_url %}
64
+ <img src="{{ logo_url }}" alt="{{ project }}" class="moodle-brand-logo" />
65
+ {% elif logo %}
66
+ <img src="{{ pathto('_static/' ~ logo, 1) }}" alt="{{ project }}" class="moodle-brand-logo" />
67
+ {% else %}
68
+ <span class="moodle-brand-title">
69
+ {% if theme_project_name %}{{ theme_project_name }}{% else %}{{ project }}{% endif %}
70
+ </span>
71
+ {% endif %}
72
+ </a>
73
+ <span class="moodle-tagline">
74
+ {% if theme_tagline %}{{ theme_tagline }}{% else %}Documentação inspirada no MoodleDocs{% endif %}
75
+ </span>
76
+ </div>
77
+
78
+ {# Right-side tools: Header Search & Dark Mode Toggle #}
79
+ <div class="moodle-header-tools">
80
+ <form action="{{ pathto('search') }}" method="get" class="moodle-header-search">
81
+ <input type="text" name="q" placeholder="Buscar..." aria-label="Buscar na documentação" required />
82
+ <input type="hidden" name="check_keywords" value="yes" />
83
+ <input type="hidden" name="area" value="default" />
84
+ <button type="submit" title="Buscar">🔍</button>
85
+ </form>
86
+
87
+ {% if theme_enable_dark_mode|tobool %}
88
+ <button id="theme-toggle" class="theme-toggle-btn" aria-label="Alternar modo claro/escuro" title="Alternar modo claro/escuro">
89
+ <span id="theme-toggle-icon">🌙</span>
90
+ </button>
91
+ {% endif %}
92
+ </div>
93
+ </div>
94
+ </header>
95
+
96
+ {# 2. Sub-Header Banner Strip (Estilo barra de contexto do MoodleDocs) #}
97
+ <section class="moodle-sub-header">
98
+ <div class="moodle-sub-header-inner">
99
+ <div class="moodle-sub-header-title">
100
+ <span>Documentação</span>
101
+ {% if release %}
102
+ <span class="moodle-version-badge">v{{ release }}</span>
103
+ {% endif %}
104
+ </div>
105
+ <div>
106
+ {% if theme_github_url %}
107
+ <a href="{{ theme_github_url }}" class="moodle-sub-header-link" target="_blank" rel="noopener noreferrer">Repositório no GitHub ↗</a>
108
+ {% endif %}
109
+ </div>
110
+ </div>
111
+ </section>
112
+ {% endblock %}
113
+
114
+ {% block content %}
115
+ {# 3. Main Layout Container (Artigo na ESQUERDA, Navegação na DIREITA, como no docs.moodle.org) #}
116
+ <div class="moodle-main-container">
117
+ {# Main Article Content (Esquerda) #}
118
+ <main class="moodle-content" role="main">
119
+ {% block body %}{% endblock %}
120
+ </main>
121
+
122
+ {# Sidebar Navegação (DIREITA - Estilo MoodleDocs) #}
123
+ {% block sidebar1 %}
124
+ <aside class="moodle-sidebar" id="moodle-sidebar" role="navigation" aria-label="Navegação Principal">
125
+ {% if theme_navigation_links %}
126
+ <div class="moodle-sidebar-section-title">Seções &amp; Links</div>
127
+ <nav>
128
+ <ul>
129
+ {% if theme_navigation_links is string %}
130
+ {% for item in theme_navigation_links.split(',') %}
131
+ {% set parts = item.strip().split('|') %}
132
+ {% set title = parts[0].strip() %}
133
+ {% set target = parts[1].strip() if parts|length > 1 else master_doc %}
134
+ <li class="{% if pagename in target or (target == master_doc and pagename == master_doc) %}current{% endif %}">
135
+ {% if target.startswith('http://') or target.startswith('https://') %}
136
+ <a href="{{ target }}" target="_blank" rel="noopener noreferrer">{{ title }} ↗</a>
137
+ {% else %}
138
+ {% set clean_target = target[:-5] if target.endswith('.html') else target %}
139
+ <a href="{{ pathto(clean_target) }}" class="{% if pagename == clean_target %}current{% endif %}">{{ title }}</a>
140
+ {% endif %}
141
+ </li>
142
+ {% endfor %}
143
+ {% endif %}
144
+ </ul>
145
+ </nav>
146
+ {% endif %}
147
+ </aside>
148
+ {% endblock %}
149
+ </div>
150
+ {% endblock %}
151
+
152
+ {% block footer %}
153
+ {# Footer #}
154
+ <footer class="moodle-footer" role="contentinfo">
155
+ <div class="moodle-footer-inner">
156
+ <div>
157
+ {% if copyright %}
158
+ &copy; {{ copyright }}.
159
+ {% else %}
160
+ &copy; {{ last_updated_year if last_updated_year else '' }} {{ project }}.
161
+ {% endif %}
162
+ {% if theme_footer_custom_text %}
163
+ {{ theme_footer_custom_text }}
164
+ {% endif %}
165
+ </div>
166
+ <div>
167
+ Desenvolvido com inspiração na documentação oficial do
168
+ <a href="https://docs.moodle.org/" target="_blank" rel="noopener noreferrer">MoodleDocs</a> &amp;
169
+ <a href="https://www.sphinx-doc.org/" target="_blank" rel="noopener noreferrer">Sphinx</a>.
170
+ </div>
171
+ {% if theme_github_url %}
172
+ <div>
173
+ <a href="{{ theme_github_url }}" target="_blank" rel="noopener noreferrer">Ver código no GitHub</a>
174
+ </div>
175
+ {% endif %}
176
+ </div>
177
+ </footer>
178
+ </div> {# End site wrapper #}
179
+ {% endblock %}
@@ -0,0 +1,7 @@
1
+ {% extends "layout.html" %}
2
+
3
+ {% block body %}
4
+ <article class="moodle-page">
5
+ {{ body }}
6
+ </article>
7
+ {% endblock %}