summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorMichal Minar <miminar@redhat.com>2013-09-12 08:34:05 +0200
committerMichal Minar <miminar@redhat.com>2013-09-12 08:34:05 +0200
commit083de6a52ccbaa9c5f2843bd3b3b4031eda16acb (patch)
treec1493f13fd159e6c0031875ed24725f47d7e2b78 /doc
parent09483cca62da1b7758858f33ec3af4deaf46296a (diff)
downloadopenlmi-scripts-083de6a52ccbaa9c5f2843bd3b3b4031eda16acb.tar.gz
openlmi-scripts-083de6a52ccbaa9c5f2843bd3b3b4031eda16acb.tar.xz
openlmi-scripts-083de6a52ccbaa9c5f2843bd3b3b4031eda16acb.zip
fixed generating of pdf
Latex output made possible. Also fixed reading of readme, where error has been incorrectly handled. Synced version of documentation with package.
Diffstat (limited to 'doc')
-rw-r--r--doc/Makefile8
-rw-r--r--doc/conf.py39
-rw-r--r--doc/script-development.rst48
3 files changed, 76 insertions, 19 deletions
diff --git a/doc/Makefile b/doc/Makefile
index 55f5b05..68eab5d 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -16,7 +16,7 @@ I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext mof generated
-all: html
+all: html epub latexpdf
help:
@echo "Please use \`make <target>' where <target> is one of"
@@ -107,19 +107,19 @@ devhelp:
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/AnacondaStorageProvider"
@echo "# devhelp"
-epub:
+epub:figures api.rst
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
-latex:
+latex: figures api.rst
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."
-latexpdf:
+latexpdf: figures api.rst
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
diff --git a/doc/conf.py b/doc/conf.py
index 7dfd8ae..8fb4359 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -48,9 +48,9 @@ copyright = u'2013, Michal Minář'
# built documents.
#
# The short X.Y version.
-version = '0.2.0'
+version = '0.2.1'
# The full version, including alpha/beta/rc tags.
-release = '0.2.0'
+release = '0.2.1'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@@ -177,7 +177,40 @@ latex_elements = {
#'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
-#'preamble': '',
+'preamble': u"""
+\\usepackage{tikz}
+
+\\makeatletter
+\\newcount\\dirtree@lvl
+\\newcount\\dirtree@plvl
+\\newcount\\dirtree@clvl
+\\def\\dirtree@growth{%
+ \\ifnum\\tikznumberofcurrentchild=1\\relax
+ \\global\\advance\\dirtree@plvl by 1
+ \\expandafter\\xdef\\csname dirtree@p@\\the\\dirtree@plvl\\endcsname{\\the\\dirtree@lvl}
+ \\fi
+ \\global\\advance\\dirtree@lvl by 1\\relax
+ \\dirtree@clvl=\\dirtree@lvl
+ \\advance\\dirtree@clvl by -\\csname dirtree@p@\\the\\dirtree@plvl\\endcsname
+ \\pgf@xa=0.5cm\\relax
+ \\pgf@ya=-0.5cm\\relax
+ \\pgf@ya=\\dirtree@clvl\\pgf@ya
+ \\pgftransformshift{\\pgfqpoint{\\the\\pgf@xa}{\\the\\pgf@ya}}%
+ \\ifnum\\tikznumberofcurrentchild=\\tikznumberofchildren
+ \\global\\advance\\dirtree@plvl by -1
+ \\fi
+}
+
+\\tikzset{
+ dirtree/.style={
+ growth function=\\dirtree@growth,
+ every node/.style={anchor=north},
+ every child node/.style={anchor=west},
+ edge from parent path={(\\tikzparentnode\\tikzparentanchor) |- (\\tikzchildnode\\tikzchildanchor)}
+ }
+}
+\\makeatother
+""",
}
# Grouping the document tree into LaTeX files. List of tuples
diff --git a/doc/script-development.rst b/doc/script-development.rst
index 4c87428..02fc540 100644
--- a/doc/script-development.rst
+++ b/doc/script-development.rst
@@ -341,18 +341,42 @@ Script library is distributed as an python egg, making it easy to distribute
and install either to system or user directory.
Following tree shows directory structure of *service* egg residing in
-`upstream git`_: ::
-
- commands/service
- ├── lmi
- │ ├── __init__.py
- │ └── scripts
- │ ├── __init__.py
- │ └── service
- │ ├── cmd.py
- │ └── __init__.py
- ├── README.md
- └── setup.py
+`upstream git`_:
+
+.. only:: not latex
+
+ ::
+
+ commands/service
+ ├── lmi
+ │ ├── __init__.py
+ │ └── scripts
+ │ ├── __init__.py
+ │ └── service
+ │ ├── cmd.py
+ │ └── __init__.py
+ ├── README.md
+ └── setup.py
+
+.. raw:: latex
+
+ \begin{center}
+ \begin{tikzpicture}[dirtree]
+ \node {commands/service}
+ child { node {lmi}
+ child { node {\_\_init\_\_.py} }
+ child { node {scripts}
+ child { node {\_\_init\_\_.py} }
+ child { node {service}
+ child { node {cmd.py} }
+ child { node {\_\_init\_\_.py} }
+ }
+ }
+ }
+ child { node {README.md} }
+ child { node {setup.py} };
+ \end{tikzpicture} \\
+ \end{center}
This library then can be imported with: ::