Skip to content

Commit

Permalink
Merge pull request #1 from es-ude/add-readthedocs-support
Browse files Browse the repository at this point in the history
add readthedocs-support
  • Loading branch information
glencoe committed Jun 10, 2019
2 parents 2dd5ed8 + 27b8d35 commit cf6ce02
Show file tree
Hide file tree
Showing 6 changed files with 258 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

# Build documentation with MkDocs
#mkdocs:
# configuration: mkdocs.yml

# Optionally build your docs in additional formats such as PDF and ePub
formats: all

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.7
install:
- requirements: docs/requirements.txt
22 changes: 22 additions & 0 deletions docs/Debug.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
-----
Debug
-----

Debug is a header only library.
It provides macros that allow
to create debug output, that
can be completely removed via
compiler optimization. The
advantage lies in the fact
that the compiler still sees
the statements and one can
be sure the functions are
still used correctly even
when debugging was not enabled
for a long time.

The listed function declarations
have to be implemented by the
user.

.. doxygenfile:: Debug.h
193 changes: 193 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config

# -- 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('.'))

import subprocess, sys


def run_doxygen(file):
"""Run the doxygen make command in the designated folder"""
filedir = os.path.dirname(file)
try:
retcode = subprocess.call("sed -e \"s:@@OUTPUT_DIRECTORY@@:{}:\" <{} | doxygen -".format(filedir, file), shell=True)
if retcode < 0:
sys.stderr.write("doxygen terminated by signal %s" % (-retcode))
except OSError as e:
sys.stderr.write("doxygen execution failed: %s" % e)


# read_the_docs_build = os.environ.get('READTHEDOCS', None) == 'True'

# if read_the_docs_build:
# run_doxygen("./doxy.conf")

run_doxygen("./doxy.conf")
# def generate_doxygen_xml(app):
# """Run the doxygen make commands if we're on the ReadTheDocs server"""
#
# read_the_docs_build = os.environ.get('READTHEDOCS', None) == 'True'
#
# if read_the_docs_build:
#
# run_doxygen("./doxy.conf")

# def setup(app):
#
# # Add hook for building doxygen xml when needed
# app.connect("builder-inited", generate_doxygen_xml)

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

project = 'EmbeddedUtil'
copyright = '2019, Embedded Systems Department University Duisburg-Essen'
author = 'Embedded Systems Department University Duisburg-Essen'

# The short X.Y version
version = ''
# The full version, including alpha/beta/rc tags
release = 'v0.3'


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

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'

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

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

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'

# The master toctree document.
master_doc = 'index'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None

# 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 = ['_build', 'Thumbs.db', '.DS_Store']

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = None


# -- 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 = 'sphinx_rtd_theme'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}

# 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 = []

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# The default sidebars (for documents that don't match any pattern) are
# defined by theme itself. Builtin themes are using these templates by
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
# 'searchbox.html']``.
#
# html_sidebars = {}


# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'HtmlHelpdoc'


# -- Options for LaTeX output ------------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}

# --- Breathe ----


breathe_projects = {"EmbeddedUtil": "xml/"}
breathe_default_project = "EmbeddedUtil"

# -- Options for Epub output -------------------------------------------------

# Bibliographic Dublin Core info.
epub_title = project

# The unique identifier of the text. This can be a ISBN number
# or the project homepage.
#
# epub_identifier = ''

# A unique identification for the text.
#
# epub_uid = ''

# A list of files that should not be packed into the epub file.
epub_exclude_files = ['search.html']


# -- Extension configuration -------------------------------------------------

# -- Options for intersphinx extension ---------------------------------------

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}
5 changes: 5 additions & 0 deletions docs/doxy.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
INPUT = ../Util/
GENERATE_XML = YES
GENERATE_LATEX = NO
GENERATE_HTML = NO
XML_OUTPUT = @@OUTPUT_DIRECTORY@@/xml
13 changes: 13 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
============
EmbeddedUtil
============

This is a collection of small utilities
that can be used on resource constraint
embedded systems.

.. toctree::
:maxdepth: 2
:caption: For Users

Debug
2 changes: 2 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Sphinx >= 2
breathe

0 comments on commit cf6ce02

Please sign in to comment.