Commit 6ef255e2 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Refactor documentations page.

parent 5da13116
......@@ -51,15 +51,14 @@ EXTJSSRC = 'static/plugin_extjs/src'
JSDOC = 'static/docs/jsduck'
JSLIBMIN = 'static/%s-min.js' % APP
JSLIBSRC = 'static/src'
LYXDOC = 'static/docs/lyx'
PYDOC = 'static/docs/epydoc'
SPHINXDIR = 'static/docs/userguide/'
NOW = datetime.datetime.now()
# basic commands
JSDUCK = os.path.expandvars("$HOME/bin/jsduck")
GIT = '/usr/bin/git'
LYX = '/usr/bin/lyx'
SENCHA = os.path.expandvars("$HOME/bin/sencha")
# message
......@@ -219,42 +218,6 @@ def jsduck():
print "JavaScript documentation in", JSDOC
def lyx():
"""Generate the Lyxdocumentation.
"""
if not os.path.exists(LYX):
print '\n\tThe application lyx is missing !'
print '\tSkip this step.\n'
return
# protection
if not os.path.exists(LYXDOC):
return
# clean previous version
for path in os.listdir(LYXDOC):
if path.endswith('.pdf'):
os.remove(os.path.join(LYXDOC, path))
# run LyX
for path in os.listdir(LYXDOC):
root, ext = os.path.splitext(path)
if ext == '.lyx':
lyx_path = os.path.join(LYXDOC, path)
pdf_path = os.path.join(LYXDOC, "%s.pdf" % root)
cmd = ["lyx",
"--export-to", "pdflatex", pdf_path,
lyx_path]
subprocess.call(cmd)
print "Lyx documentation in", LYXDOC
def set_version(version):
"""Set version identifier in CHANGELOG
......@@ -283,10 +246,30 @@ def set_version(version):
os.remove("%s~" % CHANGELOG )
def sphinx():
"""Generate the Sphinx documentation.
"""
# protection
if not os.path.exists(SPHINXDIR):
return
# current working directory
cwd = os.getcwd()
# move to the sphinx directory and run the make command
os.chdir(SPHINXDIR)
cmd = ["make", "html"]
subprocess.call(cmd)
# go back to current directory
os.chdir(cwd)
print "Sphinx documentation in", "%s/buid" % SPHINXDIR
if __name__ == '__main__':
# define script options
ops = optparse.OptionParser()
ops.add_option("-a", "--all",
......@@ -314,22 +297,20 @@ if __name__ == '__main__':
dest= "jsduck",
help= "generate the JavaScript documentation.")
ops.add_option("-l", "--lyx",
action="store_true",
dest= "lyx",
help= "generate the lyx documentation (guides).")
ops.add_option("-r", "--release",
action="store_true",
dest= "get",
help= "get the tag of the current release and exit.")
ops.add_option("-s", "--set_version",
ops.add_option("-s", "--sphinx",
action="store_true",
dest= "set",
dest= "sphinx",
help= "generate the sphinx documentation.")
ops.add_option("-v", "--version",
action="store_true",
dest= "version",
help= "set the version.")
ops.set_defaults(all=False,
compile=False,
......@@ -337,8 +318,8 @@ if __name__ == '__main__':
get=False,
git=False,
jsduck=False,
lyx=False,
set=False)
sphinx=False,
version=False)
(opt, args) = ops.parse_args()
......@@ -349,7 +330,7 @@ if __name__ == '__main__':
version = get_version()
print "\nThe version of the current release is %s\n" % version
if opt.set:
if opt.version:
version = (args[0] if args else raw_input(MSG_VERSION))
set_version(version)
......@@ -362,8 +343,8 @@ if __name__ == '__main__':
if opt.jsduck:
jsduck()
if opt.lyx:
lyx()
if opt.sphinx:
sphinx()
if opt.compile:
compile()
......@@ -380,7 +361,7 @@ if __name__ == '__main__':
git()
epydoc()
jsduck()
lyx()
sphinx()
compile()
print 'Exit buidVersion\n'
......
""" Controllers """
def guides():
"""Main controller to give access to the user guides.
def documentations():
"""Main controller to give access to the documentation.
"""
return dict()
......
......@@ -126,6 +126,8 @@
'Filter teams': 'Filtrer les équipes',
'First name': 'First name',
'First Name': 'Prénom',
'For developpers': 'Pour les développeurs',
'For users': 'Pour les utilisateurs',
'Forgot username?': 'Forgot username?',
'Format': 'Format',
'Formats': 'Formats',
......
......@@ -35,18 +35,18 @@ loader = dict(autoLoad=True,
aboutLeaf = Panel(loader=loader, autoScroll=True)
loader = dict(autoLoad=True,
renderer='html',
scripts=True,
url=URL('plugin_dbui', 'documentations'))
docLeaf = Panel(loader=loader, plugins=['pPanelLoaderException'], autoScroll=True)
# loader = dict(autoLoad=True,
# renderer='html',
# scripts=True,
# url=URL('plugin_dbui', 'documentations'))
#
# docLeaf = Panel(loader=loader, plugins=['pPanelLoaderException'], autoScroll=True)
loader = dict(autoLoad=True,
renderer='html',
url=URL('default', 'guides'))
url=URL('default', 'documentations'))
guideLeaf = Panel(loader=loader, plugins=['pPanelLoaderException'])
docLeaf = Panel(loader=loader, plugins=['pPanelLoaderException'])
loader = dict(autoLoad=True,
renderer='html',
......@@ -57,8 +57,7 @@ versionLeaf = Panel(loader=loader, plugins=['pPanelLoaderException'])
helpNode = Node(T('Help'))
helpNode.add_child(T('about'), aboutLeaf)
helpNode.add_child(T('software'), docLeaf)
helpNode.add_child(T('user guides'), guideLeaf)
helpNode.add_child(T('documentations'), docLeaf)
helpNode.add_child(T('versions'), versionLeaf)
helpNode.sort_children()
......
<h2 class="dbui-h2 dbui-small-cap">{{=T("Documentations")}}</h2>
<p class="dbui-p dbui-small-cap">{{=T("For users")}}</p>
<ul>
<li class="dbui-p">
<a href="/{{=request.application}}/static/docs/userguide/build/html/index.html" target="_blank">
{{=T("User guides")}}
</a>
</li>
<li class="dbui-p">
<a href="/{{=request.application}}/static/docs/database.png" target="_blank">
{{=T("Database scheme")}}
</a>
</li>
</ul>
<p class="dbui-p dbui-small-cap">{{=T("For developpers")}}</p>
<ul>
<li class="dbui-p">
<a href="/{{=request.application}}/static/docs/epydoc/index.html" target="_blank">
{{=request.application}} python API
</a>
</li>
<li class="dbui-p">
<a href="/{{=request.application}}/static/docs/jsduck/index.html" target="_blank">
{{=request.application}} javascript API
</a>
</li>
<li class="dbui-p">
<a href="/{{=request.application}}/static/plugin_dbui/docs/epydoc/index.html" target="_blank">
plugin_dbui python API
</a>
</li>
<li class="dbui-p">
<a href="/{{=request.application}}/static/plugin_dbui/docs/jsduck/index.html" target="_blank">
plugin_dbui javascript API
</a>
</li>
<li class="dbui-p">
<a href="http://docs-origin.sencha.com/extjs/4.2.1/#!/api" target="_blank">
Ext JS 4.2.1 javasript API
</a>
</li>
<li class="dbui-p">
<a href="http://pandas.pydata.org/pandas-docs/stable/" target="_blank">
Pandas data analysis toolkit
</a>
</li>
<li class="dbui-p">
<a href="http://epydoc.sourceforge.net/" target="_blank">
Epydoc automatic API generation for python
</a>
</li>
<li class="dbui-p">
<a href="http://sphinx-doc.org/" target="_blank">
Sphinx documentation generator
</a>
</li>
</ul>
\ No newline at end of file
<h2 class="dbui-h2 dbui-small-cap">{{=T("User guides")}}</h2>
<ul>
<li class="dbui-p">
<a href="/{{=request.application}}/static/docs/guides/list-metric-graph.pdf" target="_blank">
{{=T("List, metric and graph")}}
</a>
</li>
<li class="dbui-p">
<a href="/{{=request.application}}/static/docs/database.png" target='_blank'>
{{=T("Database scheme")}}
</a>
</li>
</ul>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment