Skip to content

Commit bab1ef4

Browse files
glaslosafeena
authored andcommitted
docs build cleanup (#178)
* docs build cleanup * make pycodestyle happy... * readthedocs config
1 parent e4dfe4a commit bab1ef4

10 files changed

+59
-522
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ target/
1212
# Developer
1313
.idea/
1414
.venv
15+
.vscode

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ Basic Concepts
2323
Getting started
2424
---------------
2525

26-
- You need Python3. We tested primarily with >=3.4
26+
- You need Python3. We tested primarily with >=3.5
2727
- This was tested with a recent Ubuntu based Linux.
2828

2929
#### Steps to setup
3030
1. Get SNARE: `git clone https://github.com/mushorg/snare.git` and `cd snare`
31-
2. Install requirements: `pip3 install -r requirements.txt`
31+
2. Install requirements: `sudo pip3 install -r requirements.txt`
3232
3. Setup snare: `sudo python3 setup.py install`
3333
3. Clone a page: `sudo clone --target http://example.com`
3434
4. Run SNARE: `sudo snare --port 8080 --page-dir example.com`
@@ -44,7 +44,7 @@ You obviously want to bind to 0.0.0.0 and port 80 when running in <i>production<
4444

4545
```shell
4646
# sudo snare --port 8080 --page-dir example.com
47-
47+
4848
_____ _ _____ ____ ______
4949
/ ___// | / / | / __ \/ ____/
5050
\__ \/ |/ / /| | / /_/ / __/
@@ -56,9 +56,9 @@ You obviously want to bind to 0.0.0.0 and port 80 when running in <i>production<
5656
serving with uuid 9c10172f-7ce2-4fb4-b1c6-abc70141db56
5757
Debug logs will be stored in /opt/snare/snare.log
5858
Error logs will be stored in /opt/snare/snare.err
59-
======== Running on http://localhost:8080 ========
59+
======== Running on http://127.0.0.1:8080 ========
6060
(Press CTRL+C to quit)
6161
you are running the latest version
6262

6363
```
64-
64+

docs/Makefile

+10-216
Original file line numberDiff line numberDiff line change
@@ -1,225 +1,19 @@
1-
# Makefile for Sphinx documentation
1+
# Minimal makefile for Sphinx documentation
22
#
33

44
# You can set these variables from the command line.
55
SPHINXOPTS =
66
SPHINXBUILD = sphinx-build
7-
PAPER =
8-
BUILDDIR = build
7+
SOURCEDIR = .
8+
BUILDDIR = _build
99

10-
# Internal variables.
11-
PAPEROPT_a4 = -D latex_paper_size=a4
12-
PAPEROPT_letter = -D latex_paper_size=letter
13-
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
14-
# the i18n builder cannot share the environment and doctrees with the others
15-
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
16-
17-
.PHONY: help
10+
# Put it first so that "make" without argument is like "make help".
1811
help:
19-
@echo "Please use \`make <target>' where <target> is one of"
20-
@echo " html to make standalone HTML files"
21-
@echo " dirhtml to make HTML files named index.html in directories"
22-
@echo " singlehtml to make a single large HTML file"
23-
@echo " pickle to make pickle files"
24-
@echo " json to make JSON files"
25-
@echo " htmlhelp to make HTML files and a HTML help project"
26-
@echo " qthelp to make HTML files and a qthelp project"
27-
@echo " applehelp to make an Apple Help Book"
28-
@echo " devhelp to make HTML files and a Devhelp project"
29-
@echo " epub to make an epub"
30-
@echo " epub3 to make an epub3"
31-
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
32-
@echo " latexpdf to make LaTeX files and run them through pdflatex"
33-
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
34-
@echo " text to make text files"
35-
@echo " man to make manual pages"
36-
@echo " texinfo to make Texinfo files"
37-
@echo " info to make Texinfo files and run them through makeinfo"
38-
@echo " gettext to make PO message catalogs"
39-
@echo " changes to make an overview of all changed/added/deprecated items"
40-
@echo " xml to make Docutils-native XML files"
41-
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
42-
@echo " linkcheck to check all external links for integrity"
43-
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
44-
@echo " coverage to run coverage check of the documentation (if enabled)"
45-
@echo " dummy to check syntax errors of document sources"
46-
47-
.PHONY: clean
48-
clean:
49-
rm -rf $(BUILDDIR)/*
50-
51-
.PHONY: html
52-
html:
53-
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
54-
@echo
55-
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
56-
57-
.PHONY: dirhtml
58-
dirhtml:
59-
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
60-
@echo
61-
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
62-
63-
.PHONY: singlehtml
64-
singlehtml:
65-
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
66-
@echo
67-
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
68-
69-
.PHONY: pickle
70-
pickle:
71-
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
72-
@echo
73-
@echo "Build finished; now you can process the pickle files."
74-
75-
.PHONY: json
76-
json:
77-
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
78-
@echo
79-
@echo "Build finished; now you can process the JSON files."
80-
81-
.PHONY: htmlhelp
82-
htmlhelp:
83-
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
84-
@echo
85-
@echo "Build finished; now you can run HTML Help Workshop with the" \
86-
".hhp project file in $(BUILDDIR)/htmlhelp."
87-
88-
.PHONY: qthelp
89-
qthelp:
90-
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
91-
@echo
92-
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
93-
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
94-
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/snare.qhcp"
95-
@echo "To view the help file:"
96-
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/snare.qhc"
97-
98-
.PHONY: applehelp
99-
applehelp:
100-
$(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
101-
@echo
102-
@echo "Build finished. The help book is in $(BUILDDIR)/applehelp."
103-
@echo "N.B. You won't be able to view it unless you put it in" \
104-
"~/Library/Documentation/Help or install it in your application" \
105-
"bundle."
106-
107-
.PHONY: devhelp
108-
devhelp:
109-
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
110-
@echo
111-
@echo "Build finished."
112-
@echo "To view the help file:"
113-
@echo "# mkdir -p $$HOME/.local/share/devhelp/snare"
114-
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/snare"
115-
@echo "# devhelp"
116-
117-
.PHONY: epub
118-
epub:
119-
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
120-
@echo
121-
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
122-
123-
.PHONY: epub3
124-
epub3:
125-
$(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3
126-
@echo
127-
@echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3."
128-
129-
.PHONY: latex
130-
latex:
131-
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
132-
@echo
133-
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
134-
@echo "Run \`make' in that directory to run these through (pdf)latex" \
135-
"(use \`make latexpdf' here to do that automatically)."
136-
137-
.PHONY: latexpdf
138-
latexpdf:
139-
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
140-
@echo "Running LaTeX files through pdflatex..."
141-
$(MAKE) -C $(BUILDDIR)/latex all-pdf
142-
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
143-
144-
.PHONY: latexpdfja
145-
latexpdfja:
146-
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
147-
@echo "Running LaTeX files through platex and dvipdfmx..."
148-
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
149-
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
150-
151-
.PHONY: text
152-
text:
153-
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
154-
@echo
155-
@echo "Build finished. The text files are in $(BUILDDIR)/text."
156-
157-
.PHONY: man
158-
man:
159-
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
160-
@echo
161-
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
162-
163-
.PHONY: texinfo
164-
texinfo:
165-
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
166-
@echo
167-
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
168-
@echo "Run \`make' in that directory to run these through makeinfo" \
169-
"(use \`make info' here to do that automatically)."
170-
171-
.PHONY: info
172-
info:
173-
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
174-
@echo "Running Texinfo files through makeinfo..."
175-
make -C $(BUILDDIR)/texinfo info
176-
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
177-
178-
.PHONY: gettext
179-
gettext:
180-
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
181-
@echo
182-
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
183-
184-
.PHONY: changes
185-
changes:
186-
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
187-
@echo
188-
@echo "The overview file is in $(BUILDDIR)/changes."
189-
190-
.PHONY: linkcheck
191-
linkcheck:
192-
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
193-
@echo
194-
@echo "Link check complete; look for any errors in the above output " \
195-
"or in $(BUILDDIR)/linkcheck/output.txt."
196-
197-
.PHONY: doctest
198-
doctest:
199-
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
200-
@echo "Testing of doctests in the sources finished, look at the " \
201-
"results in $(BUILDDIR)/doctest/output.txt."
202-
203-
.PHONY: coverage
204-
coverage:
205-
$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
206-
@echo "Testing of coverage in the sources finished, look at the " \
207-
"results in $(BUILDDIR)/coverage/python.txt."
208-
209-
.PHONY: xml
210-
xml:
211-
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
212-
@echo
213-
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
12+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
21413

215-
.PHONY: pseudoxml
216-
pseudoxml:
217-
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
218-
@echo
219-
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
14+
.PHONY: help Makefile
22015

221-
.PHONY: dummy
222-
dummy:
223-
$(SPHINXBUILD) -b dummy $(ALLSPHINXOPTS) $(BUILDDIR)/dummy
224-
@echo
225-
@echo "Build finished. Dummy builder generates no files."
16+
# Catch-all target: route all unknown targets to Sphinx using the new
17+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
18+
%: Makefile
19+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/source/cloner.rst docs/cloner.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Cloner
22
======
33
.. _cloner:
4+
45
Cloner clones the website that we require to be served by snare.
56

67
Cloner command line parameters
@@ -11,4 +12,4 @@ Description
1112
~~~~~~~~~~~
1213

1314
* **target** -- url of website to be cloned
14-
* **max--depth** -- maximum depth of the web-pages desired to be cloned (optional), default: full depth of the site
15+
* **max--depth** -- maximum depth of the web-pages desired to be cloned (optional), default: full depth of the site

docs/source/conf.py docs/conf.py

+32-14
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# This file does only contain a selection of the most common options. For a
66
# full list see the documentation:
7-
# http://www.sphinx-doc.org/en/stable/config
7+
# http://www.sphinx-doc.org/en/master/config
88

99
# -- Path setup --------------------------------------------------------------
1010

@@ -19,14 +19,14 @@
1919

2020
# -- Project information -----------------------------------------------------
2121

22-
project = 'snare'
23-
copyright = '2016, mushorg'
24-
author = 'mushorg'
22+
project = 'SNARE'
23+
copyright = '2018, mushmush'
24+
author = 'mushmush'
2525

2626
# The short X.Y version
27-
version = '0.2'
27+
version = ''
2828
# The full version, including alpha/beta/rc tags
29-
release = '0.2'
29+
release = 'v0.3'
3030

3131

3232
# -- General configuration ---------------------------------------------------
@@ -62,11 +62,11 @@
6262

6363
# List of patterns, relative to source directory, that match files and
6464
# directories to ignore when looking for source files.
65-
# This pattern also affects html_static_path and html_extra_path .
65+
# This pattern also affects html_static_path and html_extra_path.
6666
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
6767

6868
# The name of the Pygments (syntax highlighting) style to use.
69-
pygments_style = 'sphinx'
69+
pygments_style = None
7070

7171

7272
# -- Options for HTML output -------------------------------------------------
@@ -101,7 +101,7 @@
101101
# -- Options for HTMLHelp output ---------------------------------------------
102102

103103
# Output file base name for HTML help builder.
104-
htmlhelp_basename = 'snaredoc'
104+
htmlhelp_basename = 'SNAREdoc'
105105

106106

107107
# -- Options for LaTeX output ------------------------------------------------
@@ -128,8 +128,8 @@
128128
# (source start file, target name, title,
129129
# author, documentclass [howto, manual, or own class]).
130130
latex_documents = [
131-
(master_doc, 'snare.tex', 'snare Documentation',
132-
u'viswak', 'manual'),
131+
(master_doc, 'SNARE.tex', 'SNARE Documentation',
132+
'mushmush', 'manual'),
133133
]
134134

135135

@@ -138,7 +138,7 @@
138138
# One entry per manual page. List of tuples
139139
# (source start file, name, description, authors, manual section).
140140
man_pages = [
141-
(master_doc, 'snare', u'snare Documentation',
141+
(master_doc, 'snare', 'SNARE Documentation',
142142
[author], 1)
143143
]
144144

@@ -149,7 +149,25 @@
149149
# (source start file, target name, title, author,
150150
# dir menu entry, description, category)
151151
texinfo_documents = [
152-
(master_doc, 'snare', 'snare Documentation',
153-
author, 'snare', 'One line description of project.',
152+
(master_doc, 'SNARE', 'SNARE Documentation',
153+
author, 'SNARE', 'One line description of project.',
154154
'Miscellaneous'),
155155
]
156+
157+
158+
# -- Options for Epub output -------------------------------------------------
159+
160+
# Bibliographic Dublin Core info.
161+
epub_title = project
162+
163+
# The unique identifier of the text. This can be a ISBN number
164+
# or the project homepage.
165+
#
166+
# epub_identifier = ''
167+
168+
# A unique identification for the text.
169+
#
170+
# epub_uid = ''
171+
172+
# A list of files that should not be packed into the epub file.
173+
epub_exclude_files = ['search.html']

0 commit comments

Comments
 (0)