Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
tev
plugin_event
Commits
3532c472
Commit
3532c472
authored
Feb 26, 2015
by
LE GAC Renaud
Browse files
Generate the PDF version of the documentation.
parent
a50e5117
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
6 deletions
+55
-6
buildVersion.py
buildVersion.py
+48
-3
documentations/userguide/conf.py
documentations/userguide/conf.py
+1
-1
views/default/documentations.html
views/default/documentations.html
+6
-2
No files found.
buildVersion.py
View file @
3532c472
...
...
@@ -51,7 +51,9 @@ EXTJSSRC = 'static/plugin_extjs/src'
JSDOC
=
'static/docs/jsduck'
JSLIBMIN
=
'static/%s-min.js'
%
APP
JSLIBSRC
=
'static/src'
LATEXDOC
=
'static/docs/latex'
PYDOC
=
'static/docs/epydoc'
PDFDOC
=
'static/docs/pdf'
SPHINXDOC
=
'static/docs/sphinx'
SPHINXSRC
=
'documentations/userguide/'
...
...
@@ -60,6 +62,7 @@ NOW = datetime.datetime.now()
# basic commands
JSDUCK
=
os
.
path
.
expandvars
(
"$HOME/bin/jsduck"
)
GIT
=
'/usr/bin/git'
PDFLATEX
=
'/usr/bin/pdflatex'
SENCHA
=
os
.
path
.
expandvars
(
"$HOME/bin/sencha"
)
SPHINX
=
'/usr/bin/sphinx-build'
...
...
@@ -257,15 +260,57 @@ def sphinx():
print
'
\t
Skip this step.
\n
'
return
print
1
,
SPHINXSRC
if
not
os
.
path
.
exists
(
SPHINXSRC
):
return
# generate the HTML version
cmd
=
[
SPHINX
,
"-b"
,
"html"
,
SPHINXSRC
,
SPHINXDOC
]
print
2
,
cmd
subprocess
.
call
(
cmd
)
print
"
\n
Sphinx HTML documentation in"
,
SPHINXDOC
,
"
\n
"
print
"Sphinx documentation in"
,
SPHINXDOC
# generate the PDF version
if
not
os
.
path
.
exists
(
PDFLATEX
):
print
'
\n\t
The application pdflatex is missing !'
print
'
\t
Skip this step.
\n
'
return
rep
=
raw_input
(
"Produce the sphinx pdf (y/N) [n]:"
)
if
not
rep
.
lower
().
startswith
(
"y"
):
return
if
not
os
.
path
.
exists
(
PDFDOC
):
os
.
makedirs
(
PDFDOC
)
# generate the latex
cmd
=
[
SPHINX
,
"-b"
,
"latex"
,
SPHINXSRC
,
LATEXDOC
]
subprocess
.
call
(
cmd
)
# find the tex file
cwd
=
os
.
getcwd
()
os
.
chdir
(
LATEXDOC
)
li
=
[
el
for
el
in
os
.
listdir
(
'.'
)
if
el
.
endswith
(
'.tex'
)]
fn
=
(
li
[
0
]
if
len
(
li
)
==
1
else
None
)
if
fn
:
pdf
=
fn
.
replace
(
'.tex'
,
'.pdf'
)
cmd
=
[
PDFLATEX
,
"-output-directory"
,
"../pdf"
,
fn
]
# run pdflatex twice to get reference right
subprocess
.
call
(
cmd
)
subprocess
.
call
(
cmd
)
# clean the pdf directory
os
.
chdir
(
cwd
)
for
el
in
os
.
listdir
(
PDFDOC
):
if
el
.
endswith
(
'.pdf'
):
continue
os
.
remove
(
os
.
path
.
join
(
PDFDOC
,
el
))
cmd
=
[
"rm"
,
"-rf"
,
LATEXDOC
]
subprocess
.
call
(
cmd
)
print
"
\n
Sphinx PDF documentation in"
,
PDFDOC
,
"
\n
"
if
__name__
==
'__main__'
:
...
...
documentations/userguide/conf.py
View file @
3532c472
...
...
@@ -187,7 +187,7 @@ latex_elements = {
'papersize'
:
'a4paper'
,
# The font size ('10pt', '11pt' or '12pt').
'pointsize'
:
'1
1
pt'
,
'pointsize'
:
'1
2
pt'
,
# Additional stuff for the LaTeX preamble.
#'preamble': '',
...
...
views/default/documentations.html
View file @
3532c472
...
...
@@ -5,9 +5,13 @@
</p>
<ul>
<li
class=
"dbui-p"
>
{{=T("User guides")}} (
<a
href=
"/{{=request.application}}/static/docs/sphinx/index.html"
target=
"_blank"
>
{{=T("User guides")}}
</a>
html
</a>
,
<a
href=
"/{{=request.application}}/static/docs/pdf/track_events.pdf"
target=
"_blank"
>
pdf
</a>
)
</li>
<li
class=
"dbui-p"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment