Skip to content

Commit 37bc64e

Browse files
authored
Add sphinx documentation (#40)
* added sphinx documentation * fix readthedocs build error master_doc has to be specified as readthedocs expects contents.rst as master_doc otherwise See: https://stackoverflow.com/questions/56336234/build-fail-sphinx-error-contents-rst-not-found * improve documentation fonts (sans-serif now)
1 parent bdd7419 commit 37bc64e

36 files changed

+15275
-37
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ share/
99
./contracts/
1010
./invoices/
1111
./settings.yaml
12+
docs/_build/*

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,13 @@ uninstall: ## Remove the currently installed version of rechnung
6666

6767
.PHONY: reinstall
6868
reinstall: uninstall install
69+
70+
.PHONY: docs
71+
docs:
72+
.PHONY: docs
73+
docs:
74+
rm -f docs/rechnung.rst
75+
rm -f docs/modules.rst
76+
sphinx-apidoc -o docs rechnung
77+
$(MAKE) -C docs clean
78+
$(MAKE) -C docs html
Lines changed: 63 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,121 @@
1-
# rechnung
1+
rechnung
2+
========
23

34
**rechnung** is a command line based invoice generation system.
45

5-
![westnetz and reudnetz logos](assets/westnetz_reudnetz.png?raw=true "westnetz and reudnetz")
6+
.. image:: assets/westnetz_reudnetz.png
67

7-
## Features
8+
Features
9+
--------
810

911
* purely file based (no database)
1012
* customizeable (invoice layout is HTML/CSS)
1113

12-
## Installation
14+
Installation
15+
------------
1316

1417
Clone this repository to your machine:
1518

16-
```
17-
$ git clone https://github.com/westnetz/rechnung
18-
```
19+
.. code:: zsh
20+
21+
$ git clone https://github.com/westnetz/rechnung
22+
1923
2024
Install the package
2125

22-
```
23-
$ make install
24-
```
26+
.. code:: zsh
27+
28+
$ make install
2529
26-
**Note:** At the moment installation via pip only works, if you provide the -e option. Therefore it is recommended to use the provided *make install* method.
2730
28-
## Getting Started
31+
*Note:* At the moment installation via pip only works, if you provide the -e option. Therefore it is recommended to use the provided *make install* method.
32+
33+
Getting Started
34+
---------------
2935

3036
This section is a quick walkthrough all the features.
3137

32-
### Initialization
38+
Initialization
39+
~~~~~~~~~~~~~~
3340

3441
Before you can start generating your own invoices you need to setup your working directory for *rechnung*. By invoking
3542

36-
```
37-
$ rechnung init
38-
```
43+
.. code:: zsh
44+
45+
$ rechnung init
46+
3947
4048
all required directory and configuration files will be placed in the current working directory. It is recommended to do this in a clean directory.
4149

42-
### Configuration and Customization
50+
Configuration and Customization
51+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4352

4453
You can now edit the *rechnung.config.yaml* file to your needs. You need to enter the credentials for the mail server if you want to send out your invoices by email.
4554

4655
Customization of the invoices can be done by editing the invoice template *templates/invoice_template.j2.html* and the corresponding stylesheet in *assets/inovice.css*.
4756

48-
### Invoice Creation
57+
Creating invoices
58+
~~~~~~~~~~~~~~~~~
4959

5060
After creating your customers, you can create your first invoices.
5161
The following command
5262

53-
```
54-
$ rechnung create 01.01.2019 31.03.2019 3 2019 Q1
55-
```
63+
.. code:: zsh
64+
65+
$ rechnung create-invoices 2019 10
66+
67+
will create invoices for all customers who have a contract starting before and ending after october 2019.
68+
69+
You can force overwrite of existing invoices by giving the *--force/-f* option
5670

57-
will create invoices for all customers for the period from Jan 1st 2019 to Mar 31 2019 which is 3 months in the year 2019 and the suffix Q1.
71+
.. code:: zsh
5872
59-
Of course the amount of months and the year could be parsed from the given dates, but we found it more failsafe if they are explicitly given.
73+
$ rechnung create-invoices --force 2019 10
74+
75+
Individual invoices can be created by giving a specific customer id (cid)
6076

61-
This step will generate the invoice yaml files. These files are meant to be imported into your bookkeeping system. You can inspect them and even adjust/correct them if you spot errors.
77+
.. code:: zsh
6278
63-
### PDF Creation
79+
$ rechnung create-invoices -c 1000 2019 10
80+
81+
82+
After creating your invoices you can doublecheck for correctness.
83+
84+
Rendering invoices (create pdf files)
85+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6486

6587
If everything is correct, you are ready to create your pdf invoice documents.
6688

67-
```
68-
$ rechnung render
69-
```
89+
.. code:: zsh
90+
91+
$ rechnung render-all
7092
7193
This command will render all invoice yaml files, which have no corresponding pdf file. I.e. if you happen to spot an error in an invoice pdf. Simply delete the pdf file, correct the mistake in the invoice yaml, and run the command again.
7294

73-
### Invoice Delivery
95+
Sending invoices
96+
~~~~~~~~~~~~~~~~
7497

75-
If you want to use the included mail delivery service, you should customize the invoice mail template to your needs: *templates/invoice_mail_template.j2*.
98+
If you want to use the included mail delivery service, you should customize the invoice mail template to your needs: *assets/invoice_mail_template.j2*.
7699

77100
After doing that, you can send all the invoices you just created to your customers:
78101

79-
```
80-
$ rechnung send 2019 09
81-
```
102+
.. code:: zsh
103+
104+
$ rechnung send 2019 09
105+
82106
83107
This command will send all invoices with the given suffix to the customer given
84108
in the invoice yaml file.
85109

86110
And that's it!
87111

88-
## Copyright
112+
Copyright
113+
---------
89114

90-
F. Rämisch, 2019
91-
Paul Spooren, 2019
115+
* Florian Rämisch, 2019
116+
* Paul Spooren, 2019
92117

93-
## License
118+
License
119+
-------
94120

95121
GNU General Public License v3

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
32.8 KB
Binary file not shown.

docs/_build/doctrees/index.doctree

8.9 KB
Binary file not shown.

docs/_build/html/.buildinfo

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Sphinx build info version 1
2+
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3+
config: db653583af1b66e7d64bec72de431ba5
4+
tags: 645f666f9bcd5a90fca523b33c5a78b7
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
.. rechnung documentation master file, created by
2+
sphinx-quickstart on Thu Oct 17 16:06:37 2019.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
rechnung - file based cli for invoice and contract management
7+
=============================================================
8+
9+
*rechnung* is a file based tool to manage invoices and contracts. It's designed for tech people, who'd like to generate bullet proof invoices without leaving their well known environment: the terminal.
10+
11+
*rechnung* provides easy-to-use batch functions and an intuitive CLI to all functionality.To allow for even the craziest modifications, all generated content, can be reedited by yourself, scripts or whatever you like, as everything is stored in files.
12+
13+
Getting started
14+
===============
15+
16+
.. toctree::
17+
:maxdepth: 2
18+
:caption: Contents:
19+
20+
readme
21+
modules
22+
23+
* :ref:`genindex`
24+
* :ref:`modindex`
25+
* :ref:`search`
26+
27+
Authors, Copyright, License
28+
===========================
29+
30+
*rechnung* is developed by Florian Rämisch and Paul Spooren on behalf of *Westnetz w.V.* and *Reudnetz w.V.* two independent not-for-profit internet service providers (ISPs). It is licensed under the `GNU General Public License v3 <https://www.gnu.org/licenses/gpl-3.0.en.html>`_. Copyright is by *Florian Rämisch and Paul Spooren, 2019*.

0 commit comments

Comments
 (0)