File tree 7 files changed +50
-159
lines changed
7 files changed +50
-159
lines changed Original file line number Diff line number Diff line change
1
+ api.md
Original file line number Diff line number Diff line change 1
1
# Makefile for Sphinx documentation
2
2
#
3
+ SHELL := /bin/bash
3
4
PYVERSION =$(shell python -c "import sys;v=sys.version_info[0];sys.stdout.write(str(v) )")
4
5
HTTP_PORT = 8068
5
6
@@ -166,13 +167,16 @@ watch:
166
167
serve :
167
168
@echo ' =============================================================='
168
169
@echo
169
- @echo ' docs server running at http://0.0.0.0:${HTTP_PORT}/_build/html '
170
+ @echo ' docs server running at http://0.0.0.0:${HTTP_PORT}/'
170
171
@echo
171
172
@echo ' =============================================================='
172
173
@if test ${PYVERSION} -eq 2; then $(MAKE ) serve_py2; else make serve_py3; fi
173
174
174
175
serve_py2 :
175
- python -m SimpleHTTPServer ${HTTP_PORT}
176
+ pushd _build/html ; python2 -m SimpleHTTPServer ${HTTP_PORT} ; popd
176
177
177
178
serve_py3 :
178
- python -m http.server ${HTTP_PORT}
179
+ python -m http.server ${HTTP_PORT} --directory _build/html
180
+
181
+ dev :
182
+ $(MAKE ) -j watch serve
Original file line number Diff line number Diff line change 1
1
.. _ api:
2
2
3
- =============
4
- API Reference
5
- =============
3
+ # API Reference
6
4
7
- Creating a repo object
8
- ----------------------
5
+ ## Creating a repo object
9
6
10
7
Helper methods are available in `` libvcs.shortcuts `` which
11
8
can return a repo object from a single entry-point.
12
9
10
+ ``` eval_rst
13
11
.. autofunction:: libvcs.shortcuts.create_repo
14
12
15
13
.. autofunction:: libvcs.shortcuts.create_repo_from_pip_url
14
+ ```
16
15
17
- Instantiating a repo by hand
18
- ----------------------------
16
+ ## Instantiating a repo by hand
19
17
20
18
Tools like :func:` libvcs.shortcuts.create_repo ` and
21
19
:func:` libvcs.shortcuts.create_repo_from_pip_url ` are just wrappers
22
20
around instantiated these classes.
23
21
24
22
See examples below of git, mercurial, and subversion.
25
23
26
- Git
27
- ---
24
+ ### Git
28
25
26
+ ``` eval_rst
29
27
.. autoclass:: libvcs.git.GitRepo
30
28
:members:
31
29
:show-inheritance:
35
33
:show-inheritance:
36
34
37
35
.. autofunction:: libvcs.git.extract_status
36
+ ```
38
37
39
- Mercurial
40
- ---------
38
+ ### Mercurial
41
39
42
40
aka `` hg(1) ``
43
41
42
+ ``` eval_rst
44
43
.. autoclass:: libvcs.hg.MercurialRepo
45
44
:members:
46
45
:show-inheritance:
46
+ ```
47
47
48
- Subversion
49
- ----------
48
+ ### Subversion
50
49
51
50
aka `` svn(1) ``
52
51
52
+ ``` eval_rst
53
53
.. autoclass:: libvcs.svn.SubversionRepo
54
54
:members:
55
55
:show-inheritance:
56
+ ```
56
57
57
- Adding your own VCS
58
- -------------------
58
+ ### Adding your own VCS
59
59
60
60
Extending libvcs can be done through subclassing `` BaseRepo `` .
61
61
62
+ ``` eval_rst
62
63
.. autoclass:: libvcs.base.BaseRepo
63
64
:members:
64
65
:show-inheritance:
66
+ ```
65
67
66
- Utility stuff
67
- -------------
68
+ ### Utility stuff
68
69
70
+ ``` eval_rst
69
71
.. automodule:: libvcs.util
70
72
:members:
73
+ ```
Original file line number Diff line number Diff line change 12
12
with open ("../libvcs/__about__.py" ) as fp :
13
13
exec (fp .read (), about )
14
14
15
+ import recommonmark
16
+ from recommonmark .transform import AutoStructify
17
+
15
18
extensions = [
16
19
'sphinx.ext.autodoc' ,
17
20
'sphinx.ext.intersphinx' ,
18
21
'sphinx.ext.todo' ,
19
22
'sphinx.ext.napoleon' ,
20
23
'alagitpull' ,
21
24
'sphinx_issues' ,
25
+ 'recommonmark' ,
22
26
]
23
27
24
28
releases_unstable_prehistory = True
30
34
31
35
templates_path = ['_templates' ]
32
36
33
- source_suffix = '.rst'
37
+ source_suffix = { '.rst' : 'restructuredtext' , '.md' : 'markdown' }
34
38
35
39
master_doc = 'index'
36
40
41
+ # app setup hook
42
+ def setup (app ):
43
+ app .add_config_value (
44
+ 'recommonmark_config' ,
45
+ {
46
+ #'url_resolver': lambda url: github_doc_root + url,
47
+ 'enable_auto_toc_tree' : True ,
48
+ 'auto_toc_tree_section' : 'Contents' ,
49
+ 'enable_auto_doc_ref' : True ,
50
+ 'auto_code_block' : True ,
51
+ 'enable_eval_rst' : True ,
52
+ },
53
+ True ,
54
+ )
55
+ app .add_transform (AutoStructify )
56
+
57
+
37
58
project = about ['__title__' ]
38
59
copyright = about ['__copyright__' ]
39
60
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments