1
# -*- coding: utf-8 -*-
4
from docutils import nodes
6
# openobject-doc documentation build configuration file, created by
7
# sphinx-quickstart on Tue Dec 9 11:16:22 2008.
9
# This file is execfile()d with the current directory set to its containing dir.
11
# The contents of this file are pickled, so don't put values in the namespace
12
# that aren't pickleable (module imports are okay, they're removed automatically).
14
# All configuration values have a default; values that are commented out
15
# serve to show the default.
17
# If your extensions are in another directory, add it here. If the directory
18
# is relative to the documentation root, use os.path.abspath to make it
19
# absolute, like shown here.
21
# WARNING: if you want to generate the OpenERP ORM docstrings
22
# you need to make sure that OpenERP server is in the python path
23
# by setting a PYTHONPATH environment variable containing the path
24
# to the server's 'bin' directory, or by explicitly adding it below.
25
# sys.path.append(os.path.abspath('.'))
27
# General configuration
28
# ---------------------
30
# Add any Sphinx extension module names here, as strings. They can be extensions
31
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
34
'sphinx.ext.ifconfig',
37
todo_include_todos = False
39
# Add any paths that contain templates here, relative to this directory.
40
templates_path = ['.templates']
42
# The suffix of source filenames.
43
source_suffix = '.rst'
45
# The encoding of source files.
46
#source_encoding = 'utf-8'
48
# The master toctree document.
51
# The version info for the project you're documenting, acts as replacement for
52
# |version| and |release|, also used in various other places throughout the
55
# The short X.Y version.
57
# The full version, including alpha/beta/rc tags.
60
# The language for content autogenerated by Sphinx. Refer to documentation
61
# for a list of supported languages.
64
# There are two options for replacing |today|: either, you set today to some
65
# non-false value, then it is used:
67
# Else, today_fmt is used as the format for a strftime call.
68
today_fmt = '%Y-%m-%d'
70
# List of documents that shouldn't be included in the build.
72
'contribute/10_irc_meeting', #Out of date? IRC meetings not held anymore?
73
'contribute/summary_of_ressources',
74
'customize/index', #empty
75
'developer/17_Web_services/index', #Should be merged with 6_21_web_services?
76
'developer/7_School/index',
79
'install/windows/allinone',
82
# List of directories, relative to source directory, that shouldn't be searched
95
'developer/old_dev', # Tmp fix while refactoring dev book
98
# The reST default role (used for this markup: `text`) to use for all documents.
101
# If true, '()' will be appended to :func: etc. cross-reference text.
102
#add_function_parentheses = True
104
# If true, the current module name will be prepended to all description
105
# unit titles (such as .. function::).
106
#add_module_names = True
108
# If true, sectionauthor and moduleauthor directives will be shown in the
109
# output. They are ignored by default.
110
#show_authors = False
112
# The name of the Pygments (syntax highlighting) style to use.
113
pygments_style = 'sphinx'
115
# Options for HTML output
116
# -----------------------
118
# The style sheet to use for HTML and HTML Help pages. A file of that name
119
# must exist either in Sphinx' static/ path, or in one of the custom paths
120
# given in html_static_path.
121
html_style = 'default.css'
123
# The name for this set of Sphinx documents. If None, it defaults to
124
# "<project> v<release> documentation".
125
html_title = 'OpenERP v6'
127
# A shorter title for the navigation bar. Default is the same as html_title.
128
#html_short_title = None
130
# The name of an image file (relative to this directory) to place at the top
135
# The name of an image file (within the static path) to use as favicon of the
136
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
138
html_favicon = 'favicon.ico'
140
# Add any paths that contain custom static files (such as style sheets) here,
141
# relative to this directory. They are copied after the builtin static files,
142
# so a file named "default.css" will overwrite the builtin "default.css".
143
html_static_path = ['.static']
145
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
146
# using the given strftime format.
147
html_last_updated_fmt = '%Y-%m-%d'
149
# If true, SmartyPants will be used to convert quotes and dashes to
150
# typographically correct entities.
151
#html_use_smartypants = True
153
# Custom sidebar templates, maps document names to template names.
156
# Additional templates that should be rendered to pages, maps page names to
158
#html_additional_pages = {}
160
# If false, no module index is generated.
161
#html_use_modindex = True
163
# If false, no index is generated.
164
#html_use_index = True
166
# If true, the index is split into individual pages for each letter.
167
#html_split_index = False
169
# If true, the reST sources are included in the HTML build as _sources/<name>.
170
html_copy_source = True
172
# If true, an OpenSearch description file will be output, and all pages will
173
# contain a <link> tag referring to it. The value of this option must be the
174
# base URL from which the finished HTML is served.
175
#html_use_opensearch = ''
177
# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
178
#html_file_suffix = ''
180
# Output file base name for HTML help builder.
181
htmlhelp_basename = 'openobject-doc'
184
# Options for LaTeX output
185
# ------------------------
187
# The paper size ('letter' or 'a4').
188
latex_paper_size = 'a4'
190
# The font size ('10pt', '11pt' or '12pt').
191
latex_font_size = '9pt'
193
# Grouping the document tree into LaTeX files. List of tuples
194
# (source start file, target name, title, author, document class [howto/manual]).
196
# ('index', 'openobject-doc.tex', ur'openobject Documentation',
197
# ur'OpenObject Community', 'manual'),
201
('book/index', 'openerp-book.tex', ur'Open ERP, a modern approach to integrated business management', ur'Fabien Pinckaers\\Geoff Gardiner\\Els Van Vossel', 'manual'),
202
#('bi/index', 'openobject-bi.tex', ur'Open Object Business Intelligence', ur'OpenERP SA', 'manual'),
203
#('customize', 'openobject-customize.tex', ur'Open Object Customization Book', ur'OpenERP SA', 'manual'),
204
('install/index', 'openobject-install.tex', ur'Open Object Installation Manuals', ur'OpenERP SA', 'manual'),
205
#('contribute/index', 'openobject-contribute.tex', ur'Open Object Community Book', ur'OpenERP SA', 'manual'),
206
('developer/index', 'openobject-developer.tex', ur'Open Object Developer Book', ur'OpenERP SA', 'manual'),
207
#('features/index', 'openobject-features.tex', ur'Open ERP Features', ur'OpenERP SA', 'manual'),
208
#('verticalisations', 'openobject-verticalisations.tex', ur'Open Object verticalisations', ur'OpenERP SA', 'manual'),
209
('technical_guide/index', 'openobject-technical_guide.tex', ur'Open Object Technical Guide', ur'OpenERP SA', 'manual'),
210
('training_material/user_training/v5/exercises/index', 'openerp-user-training-v5-exercises.tex', ur'User Training - Exercises', ur'OpenERP', 'howto'),
211
('training_material/user_training/v5/solutions/index', 'openerp-user-training-v5-solutions.tex', ur'User Training - Solutions', ur'OpenERP', 'howto'),
212
#('training_material/user_training/v6/exercises/index', 'openerp-user-training-v6-exercises.tex', ur'User Training - Exercises', ur'OpenERP', 'howto'),
213
#('training_material/user_training/v6/solutions/index', 'openerp-user-training-v6-solutions.tex', ur'User Training - Solutions', ur'OpenERP', 'howto'),
214
#('training_material/technical_training/v5/exercises/index', 'openerp-technical-training-v5-exercises.tex', ur'Technical Training - Exercises', ur'OpenERP', 'howto'),
215
#('training_material/technical_training/v5/solutions/index', 'openerp-technical-training-v5-solutions.tex', ur'Technical Training - Solutions', ur'OpenERP', 'howto'),
218
# The name of an image file (relative to this directory) to place at the top of
220
latex_logo = '.static/openerp.jpg'
222
# For "manual" documents, if this is true, then toplevel headings are parts,
224
latex_use_parts = True
226
# Additional stuff for the LaTeX preamble.
227
#latex_preamble = '' # DEPRECATED sinc sphinx 0.5 (use 'latex_elements')
229
tiny_latex_include = r"""
230
\usepackage{flowfram}
232
\DeclareUnicodeCharacter{00A0}{~}
234
\definecolor{MyGray}{rgb}{0.80,0.80,0.80}
236
\makeatletter\newenvironment{graybox}{%
237
\begin{lrbox}{\@tempboxa}\begin{minipage}{\columnwidth}}{\end{minipage}\end{lrbox}%
238
\colorbox{MyGray}{\usebox{\@tempboxa}}
242
\renewenvironment{notice}[2]{
245
\def\py@noticetype{#1}
247
\csname py@noticestart@#1\endcsname
250
\csname py@noticeend@\py@noticetype\endcsname
255
\renewenvironment{figure}[6]{
261
%% Stupid workaround for stuff that is defined in howto.cls but
262
%% overwritten by sphinx.sty!!
265
%\let\py@OldTableofcontents=\tableofcontents
266
\renewcommand{\tableofcontents}{
269
\py@OldTableofcontents
272
%\rule{\textwidth}{1pt}
278
\pagenumbering{arabic}
279
\thispagestyle{empty}
284
'preamble': tiny_latex_include,
285
'papersize': 'a4paper',
288
# Documents to append as an appendix to all manuals.
289
#latex_appendices = ['doc_copyright.rst']
291
# If false, no module index is generated.
292
#latex_use_modindex = True
294
def end_foreword_directive(name, arguments, options, content, lineno,
295
content_offset, block_text, state, state_machine):
296
return [nodes.Text('')]
298
def begin_conclusion_directive(name, arguments, options, content, lineno,
299
content_offset, block_text, state, state_machine):
300
return [nodes.Text('')]
302
# add js-kit comments or not
303
# Disabled by ODO on 2012-10-22 as Echo service as been discontinued, and comments
304
# were rarely useful anyhow
305
js_kit_comments = False
308
from sphinx import __version__
309
revisions = map(lambda x: x.isdigit() and int(x) or 0, __version__.split('.'))
310
major, minor = revisions[0], revisions[1]
311
if major*10+minor < 6:
312
raise Exception("You should upgrade Sphinx to version 0.6 or higher")
314
from sphinx.writers.html import HTMLTranslator, BaseTranslator
317
# load unique_path dict:
318
comments_path_pickle_filename = "comments_path.pickle"
319
if os.path.exists(comments_path_pickle_filename):
320
comments_path_pickle_file = open(comments_path_pickle_filename, 'r')
321
comments_path_dict = pickle.load(comments_path_pickle_file)
322
comments_path_pickle_file.close()
324
comments_path_dict = {}
325
this_build_comments_path_dict = {}
327
def save_comments_path_dict():
328
comments_path_pickle_file = open(comments_path_pickle_filename, 'w')
329
pickle.dump(comments_path_dict, comments_path_pickle_file)
330
comments_path_pickle_file.close()
333
atexit.register(save_comments_path_dict)
335
def depart_title_new(self, node):
336
res = old_depart_title(self, node) # call the original depart_title.
338
if self.builder.globalcontext.get('builder') == 'html':
339
parent_class_name = node.parent.__class__.__name__
340
if parent_class_name == 'section' and self.section_level == 2:
341
title_id = "/" + node.parent.attributes['ids'][0]
342
link_anchor = "#" + node.parent.attributes['ids'][0]
343
## paths should be unique:
344
## -> build a database (pickled dict) with already used paths and
345
## create a new unique path if already used.
346
title_path = self.document['source']
347
path_start = title_path.find('%ssource%s' % (os.sep, os.sep))
348
title_path = title_path[path_start+8:].replace('.rst', '')
350
if title_id not in this_build_comments_path_dict: # first time we process this path
351
title_id = comments_path_dict.get(title_id, title_id)
352
this_build_comments_path_dict[title_id] = title_id
353
comments_path_dict[title_id] = title_id
354
else: # it's a double
355
title_id = u"""/%s%s""" % (title_path, title_id, )
356
this_build_comments_path_dict[title_id] = title_id
357
comments_path_dict[title_id] = title_id
359
# we need a uniq attribute that never changes, but the permalink will be computed after rendering
360
# the page so we can figure out the final URL, up to the correct anchor (Echo generates a default
361
# permalink using the document.location if it's missing, but that will cause twitter post etc. to
362
# appear on each section, as it is not able to distinguish sections on the same page!
363
# See http://wiki.js-kit.com/Echo+-+Install+-+A+custom+website#Settinguptheuniqandpermalinkattributes
364
# See the runtime computation in source/.templates/layout.html
365
self.body.append(u"""<div class="js-kit-comments" uniq="%s" permalink_anchor="%s" ></div>""" % (title_id, link_anchor))
370
old_depart_title = HTMLTranslator.depart_title
371
HTMLTranslator.depart_title = depart_title_new
373
app.add_directive('end_foreword', end_foreword_directive, 1, (0, 0, 0))
374
app.add_directive('begin_conclusion', begin_conclusion_directive, 1, (0, 0, 0))