Skip to content

Commit ada398a

Browse files
feat(docs): documentação automatizada com Sphinx, MyST, Redoc e deploy via GitHub Actions
1 parent 33ddd2e commit ada398a

File tree

6 files changed

+78
-0
lines changed

6 files changed

+78
-0
lines changed

.github/workflows/docs.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ jobs:
3232
run: |
3333
python scripts/export_openapi.py app.main:app openapi.json
3434
35+
- name: Export OpenAPI JSON
36+
run: |
37+
python scripts/export_openapi.py app.main:app openapi.json
38+
3539
- name: Set up Node.js
3640
uses: actions/setup-node@v4
3741
with:

docs/api.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# API
2+
3+
Abaixo está a especificação OpenAPI do PyNewsServer:
4+
5+
```{redoc}
6+
../openapi.json
7+
```

docs/conf.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# -- Project information -----------------------------------------------------
2+
project = "pynewsserver"
3+
author = "PyNews"
4+
5+
# -- General configuration ---------------------------------------------------
6+
extensions = [
7+
"myst_parser",
8+
"sphinx_rtd_theme",
9+
"sphinxcontrib.redoc",
10+
"sphinx_copybutton",
11+
]
12+
13+
myst_enable_extensions = [
14+
"colon_fence",
15+
"deflist",
16+
"linkify",
17+
"substitution",
18+
]
19+
20+
source_suffix = {
21+
".rst": "restructuredtext",
22+
".md": "markdown",
23+
}
24+
25+
master_doc = "index"
26+
27+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
28+
29+
# -- Options for HTML output -------------------------------------------------
30+
html_theme = "sphinx_rtd_theme"
31+
html_title = "Documentação - PyNewsServer"
32+
html_static_path = ['_static']
33+
34+
# -- Options for sphinxcontrib-redoc -----------------------------------------
35+
redoc = [
36+
{
37+
"name": "OpenAPI",
38+
"page": "api",
39+
"spec": "../openapi.json",
40+
"embed": True,
41+
"opts": {
42+
"hide-hostname": True
43+
}
44+
},
45+
]

docs/index.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Documentação do PyNewsServer
2+
3+
```{toctree}
4+
:maxdepth: 2
5+
:caption: Sumário
6+
7+
readme
8+
api
9+
```

docs/readme.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<!-- Este arquivo será sobrescrito automaticamente pelo workflow do GitHub Actions. -->
2+
3+
# PyNewsServer
4+
5+
[README.md no GitHub](https://github.com/PythonFloripa/PyNewsServer?tab=readme-ov-file#pynewsserver)

requirements.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# --- Dependências para documentação Sphinx ---
2+
sphinx>=7.0.0
3+
myst-parser>=2.0.0
4+
sphinx-rtd-theme>=2.0.0
5+
sphinx-copybutton>=0.5.2
6+
sphinxcontrib-redoc>=1.6.0
7+
linkify-it-py>=2.0.0
8+
# --- Fim dependências documentação ---
19
aiosqlite==0.21.0 ; python_version >= "3.12" and python_version < "4.0"
210
annotated-types==0.7.0 ; python_version >= "3.12" and python_version < "4.0"
311
anyio==4.9.0 ; python_version >= "3.12" and python_version < "4.0"

0 commit comments

Comments
 (0)