Skip to content

Commit

Permalink
new doc
Browse files Browse the repository at this point in the history
  • Loading branch information
tqchen committed Aug 3, 2015
1 parent f538187 commit 5934950
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 28 deletions.
9 changes: 5 additions & 4 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
libpath = os.path.join(curr_path, '../wrapper/')
sys.path.insert(0, os.path.join(curr_path, '../wrapper/'))
sys.path.insert(0, curr_path)
from sphinx_util import MarkdownParser
from sphinx_util import MarkdownParser, AutoStructify

# -- General configuration ------------------------------------------------

Expand Down Expand Up @@ -157,6 +157,7 @@ def generate_doxygen_xml(app):
def setup(app):
# Add hook for building doxygen xml when needed
app.connect("builder-inited", generate_doxygen_xml)



app.add_config_value('recommonmark_config', {
'url_resolver': lambda url: github_doc_root + url,
}, True)
app.add_transform(AutoStructify)
4 changes: 2 additions & 2 deletions doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Rabit Documentation
rabit is a light weight library that provides a fault tolerant interface of Allreduce and Broadcast. It is designed to support easy implementations of distributed machine learning programs, many of which fall naturally under the Allreduce abstraction. The goal of rabit is to support **portable** , **scalable** and **reliable** distributed machine learning programs.

API Documents
=============
-------------
```eval_rst
.. toctree::
Expand All @@ -15,7 +15,7 @@ API Documents
guide.md
```
Indices and tables
==================
------------------

```eval_rst
* :ref:`genindex`
Expand Down
2 changes: 1 addition & 1 deletion doc/python_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ This page contains document of python API of rabit.
.. automodule:: rabit
:members:
:show-inheritance:
```
```
23 changes: 2 additions & 21 deletions doc/sphinx_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,5 @@
sys.path.insert(0, os.path.abspath('..'))
from recom import parser, transform

class MarkdownParser(docutils.parsers.Parser):
github_doc_root = None


def __init__(self):
self.parser = parser.CommonMarkParser()

def parse(self, inputstring, document):
self.parser.parse(inputstring, document)
transform.AutoStructify.setup_url_resolver(resolve_url)
for trans in self.get_transforms():
transform.AutoStructify(document).apply()

def get_transforms(self):
return [transform.AutoStructify]

def resolve_url(url):
if MarkdownParser.github_doc_root is None or url is None:
return url
else:
return MarkdownParser.github_doc_root + url
MarkdownParser = parser.CommonMarkParser
AutoStructify = transform.AutoStructify

0 comments on commit 5934950

Please sign in to comment.