Skip to content

Commit

Permalink
doc: Add documentation engine (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
LecrisUT authored Dec 15, 2023
2 parents cee25b2 + 9731381 commit d362749
Show file tree
Hide file tree
Showing 11 changed files with 308 additions and 1 deletion.
160 changes: 160 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,167 @@
CMakeUserPresets.json
compile_commands.json

## Python patterns
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
.idea/


## Other common pattern
build/
# Jetbrains default
cmake-build-*/
*.tar.gz
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ repos:
additional_dependencies:
- mdformat-gfm
- mdformat-tables
# Disable because of sphinx compatibility
stages: [ manual ]
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.21.0
hooks:
Expand Down
11 changes: 11 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2

python:
install:
- path: .
extra_requirements:
- docs
build:
os: ubuntu-22.04
tools:
python: "3.11"
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Modern CMake example project

<!-- SPHINX-START -->

An example CMake project highlighting various modern practices. Feel free to
use this project as a template for bootstrapping or modernizing your own CMake
project.
Expand Down Expand Up @@ -59,6 +61,8 @@ In this template we focus on packaging to Fedora due to their vast CI tools:
- [`tmt`][tmt] and [testing-farm]: Used to test your project as if it has been
installed and run locally

<!-- SPHINX-END -->

## License

This template project is licensed under MIT license. Please update the
Expand Down
48 changes: 48 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
project = 'CMake Template'
copyright = '2023, Cristian Le'
author = 'Cristian Le'

extensions = [
"myst_parser",
"sphinx_design",
"sphinx_togglebutton",
"sphinx_copybutton",
"sphinx_prompt",
"breathe",
"sphinx.ext.intersphinx",
"sphinx_tippy",
]

templates_path = []
exclude_patterns = [
'build',
'_build',
'Thumbs.db',
'.DS_Store',
]
source_suffix = [".md"]


html_theme = 'furo'

myst_enable_extensions = [
"tasklist",
"colon_fence",
]

intersphinx_mapping = {
"cmake": ("https://cmake.org/cmake/help/latest", None),
"sphinx": ("https://www.sphinx-doc.org/en/master", None),
"rtd": ("https://docs.readthedocs.io/en/stable", None),
"tmt": ("https://tmt.readthedocs.io/en/stable", None),
}

tippy_rtd_urls = [
## Only works with RTD hosted intersphinx
# "https://cmake.org/cmake/help/latest",
# "https://www.sphinx-doc.org/en/master",
"https://docs.readthedocs.io/en/stable",
"https://tmt.readthedocs.io/en/stable",
]

copybutton_exclude = ".linenos, .gp, .go"
6 changes: 6 additions & 0 deletions docs/guides/developer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Developer guide

This is a developer's guide intended to explain many of the paradigms used in
this template project

**Coming soon**
11 changes: 11 additions & 0 deletions docs/guides/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Guides

```{toctree}
---
maxdepth: 2
titlesonly: true
caption: Guides
glob: true
---
*
```
6 changes: 6 additions & 0 deletions docs/guides/user.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# User guide

This is a general guide for how a user can interact with modern CMake project
that follows such a template

**Coming soon**
29 changes: 29 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# CMake Template

```{toctree}
---
maxdepth: 2
titlesonly: true
caption: Contents
hidden: true
glob: true
---
self
guides/index.md
```

```{include} ../README.md
---
start-after: <!-- SPHINX-START -->
end-before: <!-- SPHINX-END -->
---
```

[cmake-presets]: inv:cmake:std:doc#manual/cmake-presets.7
[copr]: https://copr.fedorainfracloud.org/
[fedora]: https://src.fedoraproject.org/
[packit]: https://packit.dev
[pre-commit]: https://pre-commit.com/
[sphinx]: inv:rtd:std:doc#intro/getting-started-with-sphinx
[testing-farm]: https://docs.testing-farm.io/Testing%20Farm/0.1/index.html
[tmt]: inv:tmt:std:doc#index
30 changes: 30 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "CMake-Template-dev"
version = "0.0.0"
description = "Development environment for CMake Template"
readme = "README.md"
license = { file = "LICENSE" }


[project.optional-dependencies]
docs = [
"sphinx >= 7.0",
"furo",
"sphinx-design",
"sphinx-togglebutton",
"myst-parser",
"breathe",
"sphinx-tippy",
"sphinx-copybutton",
"sphinx-prompt",
]
dev = [
"pre-commit",
]

[tool.setuptools]
packages = []
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ sonar.projectKey=LecrisUT_CMake-Template
sonar.organization=lecris

sonar.projectName="CMake Template"
sonar.coverage.exclusions=test/**
sonar.coverage.exclusions=test/**, docs/**

0 comments on commit d362749

Please sign in to comment.