mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-22 09:50:37 +00:00
Generate task graph data through sphinx conf.py
This commit is contained in:
parent
fc29266c97
commit
c089301f79
6 changed files with 16 additions and 9 deletions
0
docs/__init__.py
Normal file
0
docs/__init__.py
Normal file
1
docs/_static/.gitignore
vendored
Normal file
1
docs/_static/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
graph.json
|
1
docs/_static/graph.json
vendored
1
docs/_static/graph.json
vendored
File diff suppressed because one or more lines are too long
13
docs/conf.py
13
docs/conf.py
|
@ -14,8 +14,6 @@
|
|||
|
||||
import sys
|
||||
import os
|
||||
import glob
|
||||
import os.path
|
||||
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
|
@ -267,6 +265,9 @@ texinfo_documents = [('index', 'bootstrap-vz', u'bootstrap-vz Documentation',
|
|||
|
||||
# -- Link to rst files scattered throughout the project -------------------
|
||||
|
||||
import glob
|
||||
import os.path
|
||||
|
||||
for readme_path in glob.glob('../bootstrapvz/providers/*/README.rst'):
|
||||
provider_name = os.path.basename(os.path.dirname(readme_path))
|
||||
include_path = os.path.join('providers', provider_name + '.rst')
|
||||
|
@ -281,3 +282,11 @@ for readme_path in glob.glob('../bootstrapvz/plugins/*/README.rst'):
|
|||
path_to_readme = os.path.join('../../bootstrapvz/plugins', plugin_name, 'README.rst')
|
||||
with open(include_path, 'w') as include:
|
||||
include.write('.. include:: ' + path_to_readme)
|
||||
|
||||
|
||||
# -- Create task overview graph data --------------------------------------
|
||||
|
||||
from docs import taskoverview
|
||||
|
||||
data = taskoverview.generate_graph_data()
|
||||
taskoverview.write_data(data, '_static/graph.json')
|
||||
|
|
|
@ -5,7 +5,7 @@ import os.path
|
|||
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
|
||||
|
||||
|
||||
def main(opts):
|
||||
def generate_graph_data():
|
||||
from bootstrapvz.base.tasklist import get_all_tasks
|
||||
tasks = get_all_tasks()
|
||||
|
||||
|
@ -49,13 +49,11 @@ def main(opts):
|
|||
link[key] = tasks.index(link[key])
|
||||
return link
|
||||
|
||||
data = {'phases': map(mk_phase, phases.order),
|
||||
return {'phases': map(mk_phase, phases.order),
|
||||
'modules': map(mk_module, modules),
|
||||
'nodes': map(mk_node, tasks),
|
||||
'links': map(mk_link, task_links)}
|
||||
|
||||
write_data(data, opts.get('--output', None))
|
||||
|
||||
|
||||
def write_data(data, output_path=None):
|
||||
import json
|
||||
|
@ -77,4 +75,5 @@ if __name__ == '__main__' and __package__ is None:
|
|||
"""
|
||||
opts = docopt(usage)
|
||||
|
||||
main(opts)
|
||||
data = generate_graph_data()
|
||||
write_data(data, opts.get('--output', None))
|
||||
|
|
1
tox.ini
1
tox.ini
|
@ -20,7 +20,6 @@ changedir = docs
|
|||
deps =
|
||||
sphinx
|
||||
commands =
|
||||
./taskoverview.py --output _static/graph.json
|
||||
sphinx-build -W -b html -d _build/html/doctrees . _build/html
|
||||
|
||||
[testenv:docs-serve]
|
||||
|
|
Loading…
Add table
Reference in a new issue