From d47cf53d80d61a885409a4ffcd6843b25be2084b Mon Sep 17 00:00:00 2001 From: Tom Clark Date: Sun, 26 Jul 2020 07:58:50 +0100 Subject: [PATCH] DOC Added basic docs --- docs/.gitignore | 4 + docs/requirements.txt | 8 + docs/source/conf.py | 281 ++++++++++++++++++ docs/source/example_chapter.rst | 60 ++++ docs/source/favicon.ico | Bin 0 -> 1150 bytes .../images/digital_twin_component_basic.svg | 1 + docs/source/index.rst | 42 +++ docs/source/installation.rst | 37 +++ docs/source/license.rst | 20 ++ docs/source/quick_start.rst | 19 ++ docs/source/version_history.rst | 51 ++++ 11 files changed, 523 insertions(+) create mode 100644 docs/.gitignore create mode 100644 docs/requirements.txt create mode 100644 docs/source/conf.py create mode 100644 docs/source/example_chapter.rst create mode 100644 docs/source/favicon.ico create mode 100644 docs/source/images/digital_twin_component_basic.svg create mode 100644 docs/source/index.rst create mode 100644 docs/source/installation.rst create mode 100644 docs/source/license.rst create mode 100644 docs/source/quick_start.rst create mode 100644 docs/source/version_history.rst diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 0000000..a8a5878 --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1,4 @@ +doctrees +html +source/doxyoutput* +source/library_api* diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..959002e --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,8 @@ + +# Required by the python script for building documentation. You probably won't have to install this (because you can +# pre-commit hook builds docs for you and manages the environment). +Sphinx==1.8.3 +sphinx-rtd-theme==0.4.2 +sphinx-tabs==1.1.10 +breathe==4.11.1 +exhale==0.2.1 diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 0000000..c0446d6 --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,281 @@ +# -*- coding: utf-8 -*- +# +# Documentation build configuration file +# +# This file is execfile()d with the current directory set to its containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import os +import sphinx_rtd_theme + +# 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. +# sys.path.insert(0, os.path.abspath('.')) + +# -- 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. +# Breate and exhale are added as recommended by: +# https://exhale.readthedocs.io/en/latest/usage.html#usage-quickstart-guide +extensions = [ + 'sphinx.ext.todo', + 'sphinx_tabs.tabs', + 'sphinx.ext.mathjax', + 'sphinx.ext.ifconfig', + 'breathe', + 'exhale' +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix of source filenames. +source_suffix = '.rst' + +# The encoding of source files. +# source_encoding = 'utf-8-sig' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = u'cpplot' +copyright = u'Copyright 2017-20 Tom Clark' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. + +# The full version, including alpha/beta/rc tags. +release = os.getenv('RELEASE_TAG', 'x.y.unknown') + +# The short X.Y version. +version = '.'.join(release.split('.')[0:2]) + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# language = None + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +# today = '' +# Else, today_fmt is used as the format for a strftime call. +# today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = [] + +# The reST default role (used for this markup: `text`) to use for all documents. +# default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +# add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +# add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +# show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# A list of ignored prefixes for module index sorting. +# modindex_common_prefix = [] + +# -- Breathe and Exhale Configuration ------------------------------------------ + +# Setup the breathe extension +breathe_projects = { + "My Project": "./doxyoutput/xml" +} +breathe_default_project = "My Project" + +# Setup the exhale extension +exhale_args = { + # These arguments are required + "containmentFolder": "./library_api", + "rootFileName": "library_root.rst", + "rootFileTitle": "Library API", + "doxygenStripFromPath": "../../", + # Suggested optional arguments + "createTreeView": True, + # TIP: if using the sphinx-bootstrap-theme, you need + # "treeViewIsBootstrap": True, + "exhaleExecutesDoxygen": True, + "exhaleDoxygenStdin": "INPUT = ../../source" +} + +# Tell sphinx what the primary language being documented is +primary_domain = 'python' + +# Tell sphinx what the pygments highlight language should be +highlight_language = 'python' + + +# -- 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 themes here, relative to this directory. +# html_theme_path = ["_themes",] +html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +html_title = "cpplot: JSON based figures for C++" + +# A shorter title for the navigation bar. Default is the same as html_title. +# html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +# html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +html_favicon = 'favicon.ico' + +# 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'] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +# html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +# html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +# html_additional_pages = {} + +# If false, no module index is generated. +html_domain_indices = True + +# If false, no index is generated. +html_use_index = True + +# If true, the index is split into individual pages for each letter. +html_split_index = False + +# If true, links to the reST sources are added to the pages. +html_show_sourcelink = False + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +html_show_sphinx = False + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +# html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +# html_file_suffix = None + +# Output file base name for HTML help builder. +htmlhelp_basename = 'libraryDoc' + +# -- 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': '', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, author, documentclass [howto/manual]). +latex_documents = [ + ('index', 'cpplot.tex', u'cpplot', + u'T. Clark', 'manual'), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +# latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +# latex_use_parts = False + +# If true, show page references after internal links. +# latex_show_pagerefs = False + +# If true, show URL addresses after external links. +# latex_show_urls = False + +# Documents to append as an appendix to all manuals. +# latex_appendices = [] + +# If false, no module index is generated. +# latex_domain_indices = True + + +# -- Options for manual page output -------------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ('index', 'cpplot', u'cpplot', + [u'T. Clark'], 1) +] + +# If true, show URL addresses after external links. +# man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------------ + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + ('index', 'cpplot', u'cpplot', + u'T. Clark', 'cpplot', 'JSON based figures for C++', + 'Miscellaneous'), +] + +# Documents to append as an appendix to all manuals. +# texinfo_appendices = [] + +# If false, no module index is generated. +# texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +# texinfo_show_urls = 'footnote' diff --git a/docs/source/example_chapter.rst b/docs/source/example_chapter.rst new file mode 100644 index 0000000..80e9b95 --- /dev/null +++ b/docs/source/example_chapter.rst @@ -0,0 +1,60 @@ +.. _a_chapter: + +========= +A Chapter +========= + +Here is a paragraph + +Here are: + - several + - bullet + - points + +.. figure:: images/digital_twin_component_basic.svg + :width: 400px + :align: center + :figclass: align-center + :alt: Text description of the image + + This is the caption of an svg file + + +.. _a_section: + +A Section +========= + +A link in rst is like +`this `_. + +You cna create numbered bullets too. Here are some things that were important in the library which I made this template from: + +#. Openness +#. Federation +#. Security +#. Public Good (cross ref other parts of the docs like this... :ref:`using_group_tabs`) + + +.. _using_group_tabs: + +[Simple] Using Group Tabs +========================= + +.. tabs:: + + .. group-tab:: Scenario + + Some text appears in a tabbed box + + .. group-tab:: Twine + + A box can have ``code_values``. + + And multiple paragraphs + + .. code-block:: javascript + + { + "and": "A Code Block", + } diff --git a/docs/source/favicon.ico b/docs/source/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..97f2f385efe4238217885f7221afbc306f7d6627 GIT binary patch literal 1150 zcmbu8JugF17{{N|YB97SEzx>Ox`?3`G1bdv@C68wGzJnMKx{ghh)5(B#AvXIq|!k& z5ki?vmeR#SB@B{=`aQSzB&F9t+x+gi=iLAQInQ%mL|ps>0pZyr^KOxli1Y$OjFiV| zMEDksm9hF2kN)VP*mTj(z`*$6t~~Db$=%k#FeIQ8v|r&A<7>b(1vl^s>2NU9^swFE zg8mXdAPbY=0V@VN^?P6m-k<~pSZQlLbLY2XKD6slfD*jIB3LodsbA+c-ecb5p!rz2 zqVkwlU-!l|p4*db> z+(+O8W2tJAhV8#VU#q{?{QtUsBjjGWe*fLSE8^(> z>6%T$U(b)8V{5(fI-TFuj$p={--$J&+XTn+t9xbV@bmthM?$B5&VM`JTX4KTX0PoS z8cWwB0dbL%;IG3w2D4CgfA9SwC-oxBE|FwX#G4cGzm(~I7g0=Kzo|yG>dE2#0zB|~ A-2eap literal 0 HcmV?d00001 diff --git a/docs/source/images/digital_twin_component_basic.svg b/docs/source/images/digital_twin_component_basic.svg new file mode 100644 index 0000000..b49800f --- /dev/null +++ b/docs/source/images/digital_twin_component_basic.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 0000000..3b4bd8b --- /dev/null +++ b/docs/source/index.rst @@ -0,0 +1,42 @@ + +.. ATTENTION:: + This library is in use in several projects, but it's still early days. + Like the idea of it? Please + `star us on GitHub `_ and contribute via the + `issues board `_ and + `roadmap `_. + + +============= +Library Title +============= + +**{{library_name}}** is a library to do stuff. + +.. epigraph:: + *"cpplot" ~ figures from C++, viewable in browser* + +Introduce the library here. + +Some parts of ReStructuredText (rst) are shown to help you write your docs in :ref:`a_chapter`. + + + +.. _reason_for_being: + +Raison d'etre +============= + +Insert your personal rant here... + + + +.. toctree:: + :maxdepth: 2 + + self + installation + quick_start + example_chapter + license + version_history diff --git a/docs/source/installation.rst b/docs/source/installation.rst new file mode 100644 index 0000000..3e2d381 --- /dev/null +++ b/docs/source/installation.rst @@ -0,0 +1,37 @@ +.. _installation: + +============ +Installation +============ + +.. ATTENTION:: + We're working on it. I promise. + +TODO + +.. code-block:: py + + TODO + + +.. _compilation: + +Compilation +============ + +TODO + +.. _third_party_library_installation: + +Third party library installation +================================ + +TODO + + +.. _third_party_build_requirements: + +Third party build requirements +============================== + +TODO diff --git a/docs/source/license.rst b/docs/source/license.rst new file mode 100644 index 0000000..e8dbbc2 --- /dev/null +++ b/docs/source/license.rst @@ -0,0 +1,20 @@ +.. _license: + +======= +License +======= + + +The boring bit +============== + +Your license here. + + +Third Party Libraries +===================== + +**cpplot** includes or is linked against the following third party libraries: + +Stuff here. + diff --git a/docs/source/quick_start.rst b/docs/source/quick_start.rst new file mode 100644 index 0000000..0d40824 --- /dev/null +++ b/docs/source/quick_start.rst @@ -0,0 +1,19 @@ +.. _quick_start: + +============ +Quick Start +============ + +.. _create_a_twine: + +Create your blah blah +===================== + +Show your users how to do things... + +.. code-block:: py + + { + "title": "My first atomising discombobulator", + "description": "A simple example... estimates the `foz` value of an atomising discombobulator." + } diff --git a/docs/source/version_history.rst b/docs/source/version_history.rst new file mode 100644 index 0000000..8fa6368 --- /dev/null +++ b/docs/source/version_history.rst @@ -0,0 +1,51 @@ +.. _version_history: + +=============== +Version History +=============== + +Origins +======= + +A bit of background.... + +.. _version_0.0.x: + +0.0.x +===== + +Something about this release + +New Features +------------ +#. Blah +#. Bleep + +Backward Incompatible API Changes +--------------------------------- +#. n/a (Initial release) + +Bug Fixes & Minor Changes +------------------------- +#. n/a (Initial Release) + + +.. _version_0.0.y: + +0.0.y +===== + +You get it... + +New Features +------------ +#. Blah +#. Bleep + +Backward Incompatible API Changes +--------------------------------- +#. n/a (Initial release) + +Bug Fixes & Minor Changes +------------------------- +#. n/a (Initial Release) \ No newline at end of file