Skip to content

docs based on BTD and deployed with CI #1

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

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
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
6 changes: 6 additions & 0 deletions .btd.yml
Original file line number Diff line number Diff line change
@@ -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
28 changes: 28 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
__pycache__/
vunit_out/
/docs/_build
/docs/_theme
/docs/tutorial
*.tgz
23 changes: 23 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -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
Binary file added docs/_static/VUnit_logo_175x175.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/vunit.ico
Binary file not shown.
100 changes: 100 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -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/", "#"),
}
25 changes: 25 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions tutorial/exercise_01/instructions.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.. VUnit:Tutorial:Exercise01:

Exercise 01
###########
4 changes: 4 additions & 0 deletions tutorial/exercise_02/instructions.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.. VUnit:Tutorial:Exercise02:

Exercise 02
###########