Skip to content

Commit 0744922

Browse files
committed
[DOCS-#3] Github : Added Workflow to Publish Docs
1 parent 0a2bb01 commit 0744922

File tree

5 files changed

+198
-0
lines changed

5 files changed

+198
-0
lines changed

.github/workflows/docs.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Publish Documentation
2+
3+
# publish the documentation on every merge to main branch
4+
on:
5+
push:
6+
branches: [main]
7+
paths: [docs/mkdocs/**]
8+
9+
pull_request:
10+
branches: [main]
11+
paths: [docs/mkdocs/**]
12+
13+
workflow_dispatch:
14+
15+
# we don't want to have concurrent jobs, and we don't want to cancel running jobs to avoid broken publications
16+
concurrency:
17+
group: documentation
18+
cancel-in-progress: false
19+
20+
permissions:
21+
contents: read
22+
23+
jobs:
24+
publish:
25+
name: Build & Publish Documentation to GitHub Pages.
26+
27+
permissions:
28+
contents: write
29+
30+
defaults:
31+
run:
32+
working-directory: ./docs/mkdocs
33+
34+
if: github.repository == 'djoezeke/mytoml'
35+
36+
runs-on: ubuntu-latest
37+
38+
steps:
39+
- uses: actions/checkout@v5
40+
41+
- name: Set up Python
42+
uses: actions/setup-python@v5
43+
with:
44+
python-version: "3.13"
45+
46+
- name: Install dependencies
47+
run: |
48+
python -m pip install --upgrade pip
49+
pip install -r requirements.txt
50+
- name: Build distributions & Docs
51+
run: |
52+
mkdocs build
53+
54+
- name: Publish documentation 📚 to GitHub Pages
55+
run: mkdocs gh-deploy --force
56+
env:
57+
# This token is automatically provided by GitHub Actions
58+
# and has the necessary permissions to push to gh-pages.
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

docs/README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Documentation
2+
3+
Note on documentation: The source files contain links to the online documentation at https://djoezeke.github.io/mytoml.
4+
5+
> [!NOTE]
6+
> This URL contains the most recent [documentation](https://djoezeke.github.io/mytoml).
7+
8+
## Generate documentation
9+
10+
> [!TIP]
11+
> If you want to see the documentation for a specific tag or commit hash, you can generate it as follows (here for tag`v1.0.0`):
12+
>
13+
> ```
14+
> git clone https://github.com/djoezeke/mytoml.git
15+
> cd mytoml
16+
> git checkout v1.0.0
17+
> ```
18+
19+
### Mkdocs
20+
21+
Generating documentation with mkdocs:
22+
23+
```bash
24+
git clone https://github.com/djoezeke/mytoml.git
25+
cd mytoml
26+
```
27+
28+
> Open URL <http://127.0.0.1:8000/> in your browser to see the documentation.
29+
30+
### Doxygen
31+
32+
Generating documentation with doxygen:
33+
34+
```bash
35+
git clone https://github.com/djoezeke/mytoml.git
36+
cd mytoml
37+
```

docs/mkdocs/docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Mytoml

docs/mkdocs/mkdocs.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# Project information
2+
site_name: Mytoml | TOML for Modern C/C++
3+
site_url: https://djoezeke.github.io/mytoml
4+
site_dir: site/mytoml
5+
site_author: djoezeke
6+
site_description: Simple and Fast Tom's Obvious Markup Language (TOML) Parser for Modern C/C++.
7+
strict: true
8+
9+
# Repository
10+
repo_url: https://github.com/djoezeke/mytoml
11+
repo_name: djoezeke/mytoml
12+
edit_uri: edit/main/docs/mkdocs/docs
13+
14+
# Copyright
15+
copyright: Copyright &copy; 2025 Sackey Ezekiel Etrue
16+
17+
# https://www.mkdocs.org/user-guide/configuration/#validation
18+
validation:
19+
omitted_files: warn
20+
absolute_links: warn
21+
unrecognized_links: warn
22+
23+
# Configuration
24+
theme:
25+
name: material
26+
features:
27+
- navigation.instant
28+
- navigation.tracking
29+
- navigation.tabs
30+
- navigation.indexes
31+
- navigation.top
32+
- content.tabs.link
33+
- content.action.edit
34+
- content.action.view
35+
palette:
36+
- media: "(prefers-color-scheme: light)"
37+
scheme: default
38+
primary: indigo
39+
accent: indigo
40+
toggle:
41+
icon: material/brightness-7
42+
name: Switch to dark mode
43+
- media: "(prefers-color-scheme: dark)"
44+
scheme: slate
45+
primary: black
46+
accent: indigo
47+
toggle:
48+
icon: material/brightness-4
49+
name: Switch to system preference
50+
icon:
51+
repo: fontawesome/brands/github
52+
font:
53+
text: Roboto
54+
code: JetBrains Mono
55+
56+
# Additional configuration
57+
extra:
58+
status:
59+
new: Recently added
60+
deprecated: Deprecated
61+
social:
62+
- icon: fontawesome/brands/github
63+
link: https://github.com/djoezeke
64+
generator: false
65+
66+
# Extensions
67+
markdown_extensions:
68+
- admonition
69+
- pymdownx.details
70+
- pymdownx.snippets:
71+
- pymdownx.magiclink:
72+
- attr_list:
73+
- toc:
74+
permalink: true
75+
anchorlink: true
76+
anchorlink_class: "toclink"
77+
- md_in_html:
78+
- pymdownx.inlinehilite:
79+
- pymdownx.superfences:
80+
- markdown.extensions.attr_list:
81+
- pymdownx.keys:
82+
- pymdownx.tasklist:
83+
custom_checkbox: true
84+
- pymdownx.highlight:
85+
anchor_linenums: true
86+
- pymdownx.tabbed:
87+
alternate_style: true
88+
89+
# Hooks
90+
91+
# Plugins
92+
plugins:
93+
- search
94+
95+
# Page tree
96+
nav:
97+
- Introduction: index.md

docs/mkdocs/requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
mkdocs # Documentation framework
2+
mkdocs-material # Theme for mkdocs
3+
mkdocstrings # Support for docstrings
4+
mkdocstrings-python # Python support for mkdocstrings

0 commit comments

Comments
 (0)