Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Sphinx documentation #174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Dec 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: github pages

on:
push:
branches:
- main # Set a branch name to trigger deployment

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release

jobs:
deploy:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
submodules: true

- name: Setup
run: |
sudo apt-get install ninja-build doxygen graphviz python3-sphinx
pip install breathe sphinx_rtd_theme furo

- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}
run: |
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILDCC_DOCUMENTATION=ON

- name: Build
working-directory: ${{github.workspace}}
shell: bash
run: cmake --build build --config $BUILD_TYPE

- name: Doxygen + Sphinx
working-directory: ${{github.workspace}}/build
shell: bash
run: |
cmake --build . --target doxygen_documentation
cmake --build . --target sphinx_documentation

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/output
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ _deps
.vs/
.idea/
.cache/
docs/output

# Files
*.gcov
Expand Down
6 changes: 3 additions & 3 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"BUILDCC_TESTING": true,
"BUILDCC_CLANGTIDY": true,
"BUILDCC_CPPCHECK": true,
"BUILDCC_DOCUMENTATION": true,
"BUILDCC_DOCUMENTATION": false,
"BUILDCC_NO_DEPRECATED": false
}
},
Expand All @@ -52,7 +52,7 @@
"BUILDCC_TESTING": true,
"BUILDCC_CLANGTIDY": true,
"BUILDCC_CPPCHECK": true,
"BUILDCC_DOCUMENTATION": true,
"BUILDCC_DOCUMENTATION": false,
"BUILDCC_NO_DEPRECATED": false
}
},
Expand All @@ -77,7 +77,7 @@
"BUILDCC_TESTING": true,
"BUILDCC_CLANGTIDY": true,
"BUILDCC_CPPCHECK": true,
"BUILDCC_DOCUMENTATION": true,
"BUILDCC_DOCUMENTATION": false,
"BUILDCC_NO_DEPRECATED": false
}
},
Expand Down
19 changes: 12 additions & 7 deletions cmake/tool/doxygen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,21 @@ if (${BUILDCC_DOCUMENTATION})
*test/*
*mock/*
)
set(DOXYGEN_BUILTIN_STL_SUPPORT YES)
set(DOXYGEN_EXTRACT_ALL YES)
set(DOXYGEN_MARKDOWN_SUPPORT YES)
set(DOXYGEN_WARN_IF_UNDOCUMENTED NO)
set(DOXYGEN_USE_MDFILE_AS_MAINPAGE ${CMAKE_CURRENT_SOURCE_DIR}/README.md)
set(DOXYGEN_WARN_IF_UNDOCUMENTED YES)
set(DOXYGEN_GENERATE_XML YES)
doxygen_add_docs(doxygen_documentation
${CMAKE_CURRENT_SOURCE_DIR}/README.md
${CMAKE_CURRENT_SOURCE_DIR}/TODO.md
${CMAKE_CURRENT_SOURCE_DIR}/example/README.md
${CMAKE_CURRENT_SOURCE_DIR}/buildcc
COMMENT "Doxygen documentation"
)

find_program(sphinx_build
NAMES "sphinx-build"
REQUIRED
)
add_custom_target(sphinx_documentation
COMMAND ${sphinx_build} -b html -Dbreathe_projects.buildcc_documentation=${CMAKE_CURRENT_BINARY_DIR}/xml . ../output
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/docs/source
VERBATIM USES_TERMINAL
)
endif()
2 changes: 2 additions & 0 deletions docs/source/arch/design_patterns.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Design Patterns
===============
2 changes: 2 additions & 0 deletions docs/source/arch/namespaces.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Namespaces
==========
2 changes: 2 additions & 0 deletions docs/source/arch/outputs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Outputs
=======
2 changes: 2 additions & 0 deletions docs/source/arch/project_layout.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Project Layout
==============
2 changes: 2 additions & 0 deletions docs/source/arch/software_heirarchy.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Software Heirarchy
==================
2 changes: 2 additions & 0 deletions docs/source/arch/testing.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Testing
=======
59 changes: 59 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))


# -- Project information -----------------------------------------------------

project = 'BuildCC'
copyright = '2021, Niket Naidu'
author = 'Niket Naidu'

# The full version, including alpha/beta/rc tags
release = '0.1.1'


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"breathe"
]

breathe_default_project = "buildcc_documentation"
breathe_default_members = ("members", "undoc-members")

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'furo'

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
30 changes: 30 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.. BuildCC documentation master file, created by
sphinx-quickstart on Sun Dec 19 02:26:23 2021.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.

Welcome to BuildCC's documentation!
===================================

.. toctree::
:maxdepth: 2
:caption: Contents

page/user_api

.. toctree::
:caption: Architecture

arch/project_layout
arch/software_heirarchy
arch/namespaces
arch/design_patterns
arch/testing
arch/outputs

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
106 changes: 106 additions & 0 deletions docs/source/page/user_api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
*********
User API
*********

Environment
===========

env.h
-----

.. doxygenfunction:: is_init

.. doxygenfunction:: get_project_root_dir

.. doxygenfunction:: get_project_build_dir

logging.h
---------

.. doxygenfunction:: log_trace

.. doxygenfunction:: log_debug

.. doxygenfunction:: log_info

.. doxygenfunction:: log_warning

.. doxygenfunction:: log_critical

assert_fatal.h
--------------

assert_throw.h
--------------

command.h
---------

Toolchain
=========

toolchain.h
------------

toolchain_verify.h
------------------

Generator
=========

generator.h
-----------

TargetInfo
==========

target_info.h
--------------

Target
=======

target.h
---------

Toolchain specialized
=====================

toolchain_gcc.h
----------------

toolchain_msvc.h
-----------------

Target specialized
==================

target_custom.h
---------------

target_gcc.h
-------------

target_msvc.h
-------------

target_generic.h
-----------------

Args
====

args.h
-------

Register
========

register.h
-----------

First Party Plugins
===================

clang_compile_commands.h
------------------------