diff --git a/.btd.yml b/.btd.yml new file mode 100644 index 0000000..ed99d3d --- /dev/null +++ b/.btd.yml @@ -0,0 +1,6 @@ +input: docs +output: _build +requirements: requirements.txt +target: gh-pages +formats: [ html ] +theme: https://codeload.github.com/buildthedocs/sphinx.theme/tar.gz/v1 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..56cc653 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,28 @@ +name: Docs + +on: + push: + pull_request: + workflow_dispatch: + +jobs: + + BuildTheDocs: + name: BuildTheDocs + runs-on: ubuntu-latest + + steps: + + - name: 'Checkout' + uses: actions/checkout@v2 + + - name: 'Run BuildTheDocs and publish to GitHub Pages' + uses: buildthedocs/btd@v0 + with: + token: ${{ github.token }} + + - name: 'Upload artifacts' + uses: actions/upload-artifact@master + with: + name: doc + path: docs/_build/html diff --git a/.gitignore b/.gitignore index c19ddd9..8768884 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,6 @@ __pycache__/ vunit_out/ +/docs/_build +/docs/_theme +/docs/tutorial +*.tgz diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..ecb35e3 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,23 @@ +SPHINXOPTS = +SPHINXBUILD = sphinx-build +PAPER = +BUILDDIR = _build + +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees -T -D language=en $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . + +#--- + +man: + $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man + +#--- + +html: + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + +#--- + +latex: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex diff --git a/docs/_static/VUnit_logo_175x175.png b/docs/_static/VUnit_logo_175x175.png new file mode 100644 index 0000000..3836371 Binary files /dev/null and b/docs/_static/VUnit_logo_175x175.png differ diff --git a/docs/_static/vunit.ico b/docs/_static/vunit.ico new file mode 100644 index 0000000..b336d84 Binary files /dev/null and b/docs/_static/vunit.ico differ diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..2717b8b --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,100 @@ +# -*- coding: utf-8 -*- + +import os +import sys +from json import loads +from pathlib import Path +from shutil import copyfile + +ROOT = Path(__file__).resolve().parent + +TUTORIAL = ROOT / "tutorial" + +if not TUTORIAL.exists(): + TUTORIAL.mkdir(exist_ok=True) + +for idx in range(1,8): + instructions = ROOT.parent / "tutorial/exercise_0{}/instructions.rst".format(idx) + if instructions.exists(): + copyfile(instructions, TUTORIAL / "ex0{}.rst".format(idx)) + +# -- Sphinx Options ----------------------------------------------------------- + +# If your project needs a minimal Sphinx version, state it here. +needs_sphinx = "3.0" + +extensions = [ + "sphinx.ext.extlinks", + "sphinx.ext.intersphinx", + "sphinx.ext.todo" +] + +# The suffix(es) of source filenames. +source_suffix = { + ".rst": "restructuredtext" +} + +master_doc = "index" + +project = u"VUnit: Introduction to TDD and CI" +copyright = u"2014-2021, Lars Asplund" +author = u"LarsAsplund and contributors" + +version = "" +release = "" + +language = None + +exclude_patterns = [] + +pygments_style = "sphinx" + +todo_include_todos = False + +# -- Options for HTML output ---------------------------------------------- + +html_theme_path = ["."] +html_theme = "_theme" + +html_theme_options = { + "analytics_id": "UA-abcdefghi-j", + "logo_only": True, + "vcs_pageview_mode": "blob", + "style_nav_header_background": "#0c479d", + "home_breadcrumbs": False, +} + +html_context = {} +ctx = Path(__file__).resolve().parent / 'context.json' +if ctx.is_file(): + html_context.update(loads(ctx.open('r').read())) + + +html_static_path = ["_static"] + +html_logo = str(Path(html_static_path[0]) / "VUnit_logo_175x175.png") + +html_favicon = str(Path(html_static_path[0]) / "vunit.ico") + +# Output file base name for HTML help builder. +htmlhelp_basename = "VUnitDoc" + +# -- InterSphinx ---------------------------------------------------------- + +intersphinx_mapping = { + "ghdl": ("https://ghdl.github.io/ghdl", None), + "python": ("https://docs.python.org/3.8/", None), + "vunit": ("https://vunit.github.io", None), +} + +# -- ExtLinks ------------------------------------------------------------- + +extlinks = { + "vunit_example": ("https://github.com/VUnit/vunit/tree/master/examples/%s/", ""), + "vunit_file": ("https://github.com/VUnit/vunit/tree/master/%s/", ""), + "vunit_commit": ("https://github.com/VUnit/vunit/tree/%s/", "@"), + "vunit_issue": ("https://github.com/VUnit/vunit/issues/%s/", "#"), + "tdd_file": ("https://github.com/VUnit/tdd-intro/tree/master/%s/", ""), + "tdd_commit": ("https://github.com/VUnit/tdd-intro/tree/%s/", "@"), + "tdd_issue": ("https://github.com/VUnit/tdd-intro/issues/%s/", "#"), +} diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..14fe42d --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,25 @@ +.. VUnit:TDDIntro: + +.. centered:: |shieldTdd|_ |shieldVunit|_ |shieldGitter|_ |shieldTwitter|_ + +.. |shieldTdd| image:: https://img.shields.io/badge/VUnit/tdd--intro-0c479d.svg?longCache=true&style=flat-square&logo=github +.. _shieldTdd: https://github.com/VUnit/tdd-intro + +.. |shieldVunit| image:: https://img.shields.io/badge/VUnit/vunit-0c479d.svg?longCache=true&style=flat-square&logo=github +.. _shieldVunit: https://github.com/VUnit/vunit + +.. |shieldGitter| image:: https://img.shields.io/gitter/room/VUnit/vunit.svg?longCache=true&style=flat-square&logo=gitter&logoColor=4db797&color=4db797 +.. _shieldGitter: https://gitter.im/VUnit/vunit + +.. |shieldTwitter| image:: https://img.shields.io/twitter/follow/VUnitFramework.svg?longCache=true&style=flat-square&color=1DA1F2&label=%40VUnitFramework&logo=twitter&logoColor=fff +.. _shieldTwitter: https://www.twitter.com/VUnitFramework + +Introduction to Test-Driven Development and Continuous Integration with VUnit +============================================================================= + +.. toctree:: + :caption: Tutorial + :hidden: + + tutorial/ex01.rst + tutorial/ex02.rst diff --git a/tutorial/exercise_01/instructions.rst b/tutorial/exercise_01/instructions.rst new file mode 100644 index 0000000..448b563 --- /dev/null +++ b/tutorial/exercise_01/instructions.rst @@ -0,0 +1,4 @@ +.. VUnit:Tutorial:Exercise01: + +Exercise 01 +########### diff --git a/tutorial/exercise_02/instructions.rst b/tutorial/exercise_02/instructions.rst new file mode 100644 index 0000000..f83ae57 --- /dev/null +++ b/tutorial/exercise_02/instructions.rst @@ -0,0 +1,4 @@ +.. VUnit:Tutorial:Exercise02: + +Exercise 02 +###########