Skip to content

Commit

Permalink
docs: Store ONIE documentation in repo
Browse files Browse the repository at this point in the history
This commit goes back to the style of including the ONIE documentation
in the repo.  The documentation can be built from the Makefile, as
such:

  linux:$ cd build-config
  linux:$ make html

The resulting documentation is located in build/docs/html

The resulting html documentation is then committed to the gh-pages
branch of the ONIE repo, where it finally shows up as:

  https://opencomputeproject.github.io/onie

Signed-off-by: Curt Brune <[email protected]>
  • Loading branch information
Curt Brune committed Jul 12, 2017
1 parent 448c849 commit b7c6e83
Show file tree
Hide file tree
Showing 58 changed files with 6,752 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ONIE is a small operating system, pre-installed on bare
metal network switches, that provides an environment for automated
provisioning.

Read the `Documentation <https://opencomputeproject.github.io/onie>`_ for more info.
Read the `ONIE Documentation <https://opencomputeproject.github.io/onie>`_ for more info.

******************************
Mailing List and Collaboration
Expand Down
9 changes: 7 additions & 2 deletions build-config/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
# │ └── zlib
# ├── download
# ├── x-tools
# ├── docs
# └── images
#
#<
Expand Down Expand Up @@ -188,7 +189,7 @@ KNOWN_ASIC_VENDORS = \
qemu

ifneq (,$(MAKECMDGOALS))
ifeq (,$(filter onie-release-tag help distclean %build-host, $(MAKECMDGOALS)))
ifeq (,$(filter onie-release-tag help distclean %build-host doc% %html, $(MAKECMDGOALS)))
ifeq ($(wildcard $(MACHINEDIR)/*),)
$(warning Unable to find machine directory '$(MACHINEDIR)')
$(warning You must set the MACHINE= variable when invoking make.)
Expand Down Expand Up @@ -405,6 +406,7 @@ ifeq ($(IPMITOOL_ENABLE),yes)
endif
include make/images.make
include make/demo.make
include make/docs.make

# By default do not enable building firmware updates
FIRMWARE_UPDATE_ENABLE ?= no
Expand Down Expand Up @@ -462,6 +464,9 @@ distclean: download-clean $(DIST_CLEAN)
$(Q) rm -f $(PROJECT_STAMP)
$(Q) echo "=== Finished making $@ ==="

PHONY += docs
docs: html

PHONY += onie-release-tag
onie-release-tag:
$(Q) echo $(ONIE_RELEASE_TAG)
Expand All @@ -480,7 +485,7 @@ DEBIAN_BUILD_HOST_PACKAGES = build-essential stgit u-boot-tools util-linux \
autoconf automake bison flex texinfo libtool libtool-bin \
realpath gawk libncurses5 libncurses5-dev bc \
dosfstools mtools pkg-config git wget help2man libexpat1 \
libexpat1-dev fakeroot
libexpat1-dev fakeroot python-sphinx rst2pdf

PHONY += debian-prepare-build-host
debian-prepare-build-host:
Expand Down
173 changes: 173 additions & 0 deletions build-config/make/docs.make
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
#
# Copyright (C) 2013-2014 Curt Brune <[email protected]>
#
# SPDX-License-Identifier: GPL-2.0
#
# Makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
DOCSRCDIR = $(PROJECTDIR)/docs
DOCBUILDDIR ?= $(BUILDDIR)/docs

# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
DOCVERSIONOPTS = -D release=$(LSB_RELEASE_TAG) -D version="$(shell date --rfc-3339='seconds')"
ALLSPHINXOPTS = -W -n -E -d $(DOCBUILDDIR)/doctrees $(DOCVERSIONOPTS) $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(DOCSRCDIR)
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(DOCSRCDIR)

.PHONY: help clean html dirhtml singlehtml pickle pdf json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext

doc-help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pdf to make PDF files"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"

CLEAN += doc-clean
doc-clean:
$(Q) rm -rf $(DOCBUILDDIR)/*

html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(DOCBUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(DOCBUILDDIR)/html."

dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(DOCBUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(DOCBUILDDIR)/dirhtml."

singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(DOCBUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(DOCBUILDDIR)/singlehtml."

pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(DOCBUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."

pdf:
$(SPHINXBUILD) -b pdf $(ALLSPHINXOPTS) $(DOCBUILDDIR)/pdf
@echo
@echo "Build finished. The PDF files are in _build/pdf."

json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(DOCBUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."

htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(DOCBUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(DOCBUILDDIR)/htmlhelp."

qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(DOCBUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(DOCBUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(DOCBUILDDIR)/qthelp/CumulusNetworks-HardwareCompatibilityList.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(DOCBUILDDIR)/qthelp/CumulusNetworks-HardwareCompatibilityList.qhc"

devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(DOCBUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/CumulusNetworks-HardwareCompatibilityList"
@echo "# ln -s $(DOCBUILDDIR)/devhelp $$HOME/.local/share/devhelp/CumulusNetworks-HardwareCompatibilityList"
@echo "# devhelp"

epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(DOCBUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(DOCBUILDDIR)/epub."

latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(DOCBUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(DOCBUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."

latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(DOCBUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(DOCBUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(DOCBUILDDIR)/latex."

text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(DOCBUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(DOCBUILDDIR)/text."

man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(DOCBUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(DOCBUILDDIR)/man."

texinfo:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(DOCBUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(DOCBUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."

info:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(DOCBUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(DOCBUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(DOCBUILDDIR)/texinfo."

gettext:
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(DOCBUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(DOCBUILDDIR)/locale."

changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(DOCBUILDDIR)/changes
@echo
@echo "The overview file is in $(DOCBUILDDIR)/changes."

linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(DOCBUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(DOCBUILDDIR)/linkcheck/output.txt."

doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(DOCBUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(DOCBUILDDIR)/doctest/output.txt."

################################################################################
#
# Local Variables:
# mode: makefile-gmake
# End:
25 changes: 25 additions & 0 deletions docs/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
###########################
Building ONIE Documentation
###########################

Requirements
============

The ONIE documentation is built using sphinx and ReStructured Text.
See http://thomas-cokelaer.info/tutorials/sphinx/rest_syntax.html

Install the following packages to use sphinx on a Debian based
system::

apt-get install python-sphinx rst2pdf

Building Documentation
======================

Do the following to build the documentation::

$ cd onie/build-config
$ make html

The documentation is available in ``onie/build/html``.

5 changes: 5 additions & 0 deletions docs/_static/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

Loading

0 comments on commit b7c6e83

Please sign in to comment.