Skip to content

Commit 9718ef0

Browse files
committed
Merge pull request #68
b1ec8eb Single source version and update user agent string (Jacob Welsh) 64e2e61 Explicitly use "classic" theme on Sphinx 1.3+ (Jacob Welsh) caec1fb README: document the documentation (Jacob Welsh) e0b69e5 Add Sphinx doc skeleton (Jacob Welsh)
2 parents d4f7ed3 + b1ec8eb commit 9718ef0

File tree

13 files changed

+805
-2
lines changed

13 files changed

+805
-2
lines changed

README

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,15 @@ Under bitcoin/tests using test data from Bitcoin Core. To run them:
110110
python -m unittest discover && python3 -m unittest discover
111111

112112
Please run the tests on both Python2 and Python3 for your pull-reqs!
113+
114+
115+
Documentation
116+
-------------
117+
118+
Sphinx documentation is in the "doc" subdirectory. Run "make help" from there
119+
to see how to build. You will need the Python "sphinx" package installed.
120+
121+
Currently this is just API documentation generated from the code and
122+
docstrings. Higher level written docs would be useful, perhaps starting with
123+
much of this README. Pages are written in reStructuredText and linked from
124+
index.rst.

bitcoin/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313

1414
import bitcoin.core
1515

16+
# Note that setup.py can break if __init__.py imports any external
17+
# dependencies, as these might not be installed when setup.py runs. In this
18+
# case __version__ could be moved to a separate version.py and imported here.
19+
__version__ = '0.4.1.dev0'
20+
1621
class MainParams(bitcoin.core.CoreMainParams):
1722
MESSAGE_START = b'\xf9\xbe\xb4\xd9'
1823
DEFAULT_PORT = 8333

bitcoin/messages.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ def __init__(self, protover=PROTO_VERSION):
121121
self.addrTo = CAddress(PROTO_VERSION)
122122
self.addrFrom = CAddress(PROTO_VERSION)
123123
self.nNonce = random.getrandbits(64)
124-
self.strSubVer = b'/python-bitcoin-0.0.1/'
124+
self.strSubVer = (b'/python-bitcoinlib:' +
125+
bitcoin.__version__.encode('ascii') + b'/')
125126
self.nStartingHeight = -1
126127

127128
@classmethod

doc/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_build

doc/Makefile

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
# Makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = sphinx-build
7+
PAPER =
8+
BUILDDIR = _build
9+
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) .
14+
# the i18n builder cannot share the environment and doctrees with the others
15+
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
16+
17+
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
18+
19+
help:
20+
@echo "Please use \`make <target>' where <target> is one of"
21+
@echo " html to make standalone HTML files"
22+
@echo " dirhtml to make HTML files named index.html in directories"
23+
@echo " singlehtml to make a single large HTML file"
24+
@echo " pickle to make pickle files"
25+
@echo " json to make JSON files"
26+
@echo " htmlhelp to make HTML files and a HTML help project"
27+
@echo " qthelp to make HTML files and a qthelp project"
28+
@echo " devhelp to make HTML files and a Devhelp project"
29+
@echo " epub to make an epub"
30+
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
31+
@echo " latexpdf to make LaTeX files and run them through pdflatex"
32+
@echo " text to make text files"
33+
@echo " man to make manual pages"
34+
@echo " texinfo to make Texinfo files"
35+
@echo " info to make Texinfo files and run them through makeinfo"
36+
@echo " gettext to make PO message catalogs"
37+
@echo " changes to make an overview of all changed/added/deprecated items"
38+
@echo " linkcheck to check all external links for integrity"
39+
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
40+
41+
clean:
42+
-rm -rf $(BUILDDIR)/*
43+
44+
html:
45+
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
46+
@echo
47+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
48+
49+
dirhtml:
50+
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
51+
@echo
52+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
53+
54+
singlehtml:
55+
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
56+
@echo
57+
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
58+
59+
pickle:
60+
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
61+
@echo
62+
@echo "Build finished; now you can process the pickle files."
63+
64+
json:
65+
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
66+
@echo
67+
@echo "Build finished; now you can process the JSON files."
68+
69+
htmlhelp:
70+
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
71+
@echo
72+
@echo "Build finished; now you can run HTML Help Workshop with the" \
73+
".hhp project file in $(BUILDDIR)/htmlhelp."
74+
75+
qthelp:
76+
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
77+
@echo
78+
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
79+
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
80+
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/bitcoin.qhcp"
81+
@echo "To view the help file:"
82+
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/bitcoin.qhc"
83+
84+
devhelp:
85+
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
86+
@echo
87+
@echo "Build finished."
88+
@echo "To view the help file:"
89+
@echo "# mkdir -p $$HOME/.local/share/devhelp/bitcoin"
90+
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/bitcoin"
91+
@echo "# devhelp"
92+
93+
epub:
94+
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
95+
@echo
96+
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
97+
98+
latex:
99+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
100+
@echo
101+
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
102+
@echo "Run \`make' in that directory to run these through (pdf)latex" \
103+
"(use \`make latexpdf' here to do that automatically)."
104+
105+
latexpdf:
106+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
107+
@echo "Running LaTeX files through pdflatex..."
108+
$(MAKE) -C $(BUILDDIR)/latex all-pdf
109+
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
110+
111+
text:
112+
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
113+
@echo
114+
@echo "Build finished. The text files are in $(BUILDDIR)/text."
115+
116+
man:
117+
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
118+
@echo
119+
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
120+
121+
texinfo:
122+
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
123+
@echo
124+
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
125+
@echo "Run \`make' in that directory to run these through makeinfo" \
126+
"(use \`make info' here to do that automatically)."
127+
128+
info:
129+
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
130+
@echo "Running Texinfo files through makeinfo..."
131+
make -C $(BUILDDIR)/texinfo info
132+
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
133+
134+
gettext:
135+
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
136+
@echo
137+
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
138+
139+
changes:
140+
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
141+
@echo
142+
@echo "The overview file is in $(BUILDDIR)/changes."
143+
144+
linkcheck:
145+
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
146+
@echo
147+
@echo "Link check complete; look for any errors in the above output " \
148+
"or in $(BUILDDIR)/linkcheck/output.txt."
149+
150+
doctest:
151+
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
152+
@echo "Testing of doctests in the sources finished, look at the " \
153+
"results in $(BUILDDIR)/doctest/output.txt."

doc/_static/.placeholder

Whitespace-only changes.

doc/_templates/.placeholder

Whitespace-only changes.

doc/bitcoin.core.rst

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
bitcoin.core
2+
============
3+
4+
Everything consensus critical is found in the core subpackage.
5+
6+
:mod:`core`
7+
-----------
8+
9+
.. automodule:: bitcoin.core
10+
:members:
11+
:undoc-members:
12+
:show-inheritance:
13+
14+
:mod:`key`
15+
----------
16+
17+
.. automodule:: bitcoin.core.key
18+
:members:
19+
:undoc-members:
20+
:show-inheritance:
21+
22+
:mod:`script`
23+
-------------
24+
25+
.. automodule:: bitcoin.core.script
26+
:members:
27+
:undoc-members:
28+
:show-inheritance:
29+
30+
:mod:`scripteval`
31+
-----------------
32+
33+
.. automodule:: bitcoin.core.scripteval
34+
:members:
35+
:undoc-members:
36+
:show-inheritance:
37+
38+
:mod:`serialize`
39+
----------------
40+
41+
.. automodule:: bitcoin.core.serialize
42+
:members:
43+
:undoc-members:
44+
:show-inheritance:
45+

doc/bitcoin.rst

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
bitcoin
2+
=======
3+
4+
:mod:`bitcoin`
5+
--------------
6+
7+
.. automodule:: bitcoin
8+
:members:
9+
:undoc-members:
10+
:show-inheritance:
11+
12+
:mod:`base58`
13+
-------------
14+
15+
.. automodule:: bitcoin.base58
16+
:members:
17+
:undoc-members:
18+
:show-inheritance:
19+
20+
:mod:`bloom`
21+
------------
22+
23+
.. automodule:: bitcoin.bloom
24+
:members:
25+
:undoc-members:
26+
:show-inheritance:
27+
28+
:mod:`messages`
29+
---------------
30+
31+
.. automodule:: bitcoin.messages
32+
:members:
33+
:undoc-members:
34+
:show-inheritance:
35+
36+
:mod:`net`
37+
----------
38+
39+
.. automodule:: bitcoin.net
40+
:members:
41+
:undoc-members:
42+
:show-inheritance:
43+
44+
:mod:`rpc`
45+
----------
46+
47+
.. automodule:: bitcoin.rpc
48+
:members:
49+
:undoc-members:
50+
:show-inheritance:
51+
52+
:mod:`wallet`
53+
-------------
54+
55+
.. automodule:: bitcoin.wallet
56+
:members:
57+
:undoc-members:
58+
:show-inheritance:

0 commit comments

Comments
 (0)