Salome HOME
Merge branch V7_3_1_BR
[tools/yacsgen.git] / module_generator / doc_tmpl.py
1 # Copyright (C) 2009-2014  EDF R&D
2 #
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
7 #
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 # Lesser General Public License for more details.
12 #
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 #
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 #
19
20 try:
21   from string import Template
22 except:
23   from compat import Template,set
24
25 docmakefile="""
26 include $$(top_srcdir)/adm_local/make_common_starter.am
27
28 salomedoc_DATA=html/index.html
29 salomeres_DATA = ${others}
30
31 html/index.html:
32         make htm
33
34 SPHINXOPTS      =
35 SOURCEDIR       = $$(srcdir)
36 SPHINXBUILD     = sphinx-build
37 PAPEROPT_a4     = -D latex_paper_size=a4
38 ALLSPHINXOPTS   = -d doctrees $$(PAPEROPT_a4) $$(SPHINXOPTS) $$(SOURCEDIR)
39
40 htm:
41         mkdir -p html doctrees
42         $$(SPHINXBUILD) -b html $$(ALLSPHINXOPTS) html
43         @echo
44         @echo "Build finished. The HTML pages are in html."
45
46 install-data-local:
47         $$(INSTALL) -d $$(DESTDIR)$$(salomedocdir)
48         cp -rf html/* $$(DESTDIR)$$(salomedocdir) ;
49
50 uninstall-local:
51         chmod -R +w $$(DESTDIR)$$(salomedocdir)
52         rm -rf $$(DESTDIR)$$(salomedocdir)/*
53
54 clean-local:
55         -rm -rf html latex doctrees
56         if test -d "html"; then rm -rf html ; fi
57
58 """
59 docmakefile=Template(docmakefile)
60
61 docconf="""# -*- coding: utf-8 -*-
62 #
63 # ${module} documentation build configuration file, created by
64 # sphinx-quickstart on Sun Sep 19 16:20:14 2010.
65 #
66 # This file is execfile()d with the current directory set to its containing dir.
67 #
68 # Note that not all possible configuration values are present in this
69 # autogenerated file.
70 #
71 # All configuration values have a default; values that are commented out
72 # serve to show the default.
73
74 import sys, os
75
76 # If extensions (or modules to document with autodoc) are in another directory,
77 # add these directories to sys.path here. If the directory is relative to the
78 # documentation root, use os.path.abspath to make it absolute, like shown here.
79 #sys.path.insert(0, os.path.abspath('.'))
80
81 # -- General configuration -----------------------------------------------------
82
83 # If your documentation needs a minimal Sphinx version, state it here.
84 #needs_sphinx = '1.0'
85
86 # Add any Sphinx extension module names here, as strings. They can be extensions
87 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
88 extensions = []
89
90 # Add any paths that contain templates here, relative to this directory.
91 templates_path = ['_templates']
92
93 # The suffix of source filenames.
94 source_suffix = '.rst'
95
96 # The encoding of source files.
97 #source_encoding = 'utf-8-sig'
98
99 # The master toctree document.
100 master_doc = 'index'
101
102 # General information about the project.
103 project = u'${module}'
104 copyright = u'2010-2014'
105
106 # The version info for the project you're documenting, acts as replacement for
107 # |version| and |release|, also used in various other places throughout the
108 # built documents.
109 #
110 # The short X.Y version.
111 version = '1'
112 # The full version, including alpha/beta/rc tags.
113 release = '1'
114
115 # The language for content autogenerated by Sphinx. Refer to documentation
116 # for a list of supported languages.
117 #language = None
118
119 # There are two options for replacing |today|: either, you set today to some
120 # non-false value, then it is used:
121 #today = ''
122 # Else, today_fmt is used as the format for a strftime call.
123 #today_fmt = '%B %d, %Y'
124
125 # List of patterns, relative to source directory, that match files and
126 # directories to ignore when looking for source files.
127 exclude_patterns = ['_build']
128
129 # The reST default role (used for this markup: `text`) to use for all documents.
130 #default_role = None
131
132 # If true, '()' will be appended to :func: etc. cross-reference text.
133 #add_function_parentheses = True
134
135 # If true, the current module name will be prepended to all description
136 # unit titles (such as .. function::).
137 #add_module_names = True
138
139 # If true, sectionauthor and moduleauthor directives will be shown in the
140 # output. They are ignored by default.
141 #show_authors = False
142
143 # The name of the Pygments (syntax highlighting) style to use.
144 pygments_style = 'sphinx'
145
146 # A list of ignored prefixes for module index sorting.
147 #modindex_common_prefix = []
148
149
150 # -- Options for HTML output ---------------------------------------------------
151
152 # The theme to use for HTML and HTML Help pages.  See the documentation for
153 # a list of builtin themes.
154 html_theme = 'default'
155
156 # Theme options are theme-specific and customize the look and feel of a theme
157 # further.  For a list of options available for each theme, see the
158 # documentation.
159 #html_theme_options = {}
160
161 # Add any paths that contain custom themes here, relative to this directory.
162 #html_theme_path = []
163
164 # The name for this set of Sphinx documents.  If None, it defaults to
165 # "<project> v<release> documentation".
166 #html_title = None
167
168 # A shorter title for the navigation bar.  Default is the same as html_title.
169 #html_short_title = None
170
171 # The name of an image file (relative to this directory) to place at the top
172 # of the sidebar.
173 #html_logo = None
174
175 # The name of an image file (within the static path) to use as favicon of the
176 # docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
177 # pixels large.
178 #html_favicon = None
179
180 # Add any paths that contain custom static files (such as style sheets) here,
181 # relative to this directory. They are copied after the builtin static files,
182 # so a file named "default.css" will overwrite the builtin "default.css".
183 html_static_path = ['_static']
184
185 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
186 # using the given strftime format.
187 #html_last_updated_fmt = '%b %d, %Y'
188
189 # If true, SmartyPants will be used to convert quotes and dashes to
190 # typographically correct entities.
191 #html_use_smartypants = True
192
193 # Custom sidebar templates, maps document names to template names.
194 #html_sidebars = {}
195
196 # Additional templates that should be rendered to pages, maps page names to
197 # template names.
198 #html_additional_pages = {}
199
200 # If false, no module index is generated.
201 #html_domain_indices = True
202
203 # If false, no index is generated.
204 #html_use_index = True
205
206 # If true, the index is split into individual pages for each letter.
207 #html_split_index = False
208
209 # If true, links to the reST sources are added to the pages.
210 #html_show_sourcelink = True
211
212 # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
213 #html_show_sphinx = True
214
215 # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
216 #html_show_copyright = True
217
218 # If true, an OpenSearch description file will be output, and all pages will
219 # contain a <link> tag referring to it.  The value of this option must be the
220 # base URL from which the finished HTML is served.
221 #html_use_opensearch = ''
222
223 # This is the file name suffix for HTML files (e.g. ".xhtml").
224 #html_file_suffix = None
225
226 # Output file base name for HTML help builder.
227 htmlhelp_basename = '${module}doc'
228
229
230 # -- Options for LaTeX output --------------------------------------------------
231
232 # The paper size ('letter' or 'a4').
233 #latex_paper_size = 'letter'
234
235 # The font size ('10pt', '11pt' or '12pt').
236 #latex_font_size = '10pt'
237
238 # Grouping the document tree into LaTeX files. List of tuples
239 # (source start file, target name, title, author, documentclass [howto/manual]).
240 latex_documents = [
241   ('index', '${module}.tex', u'${module} Documentation',
242    u'cc', 'manual'),
243 ]
244
245 # The name of an image file (relative to this directory) to place at the top of
246 # the title page.
247 #latex_logo = None
248
249 # For "manual" documents, if this is true, then toplevel headings are parts,
250 # not chapters.
251 #latex_use_parts = False
252
253 # If true, show page references after internal links.
254 #latex_show_pagerefs = False
255
256 # If true, show URL addresses after external links.
257 #latex_show_urls = False
258
259 # Additional stuff for the LaTeX preamble.
260 #latex_preamble = ''
261
262 # Documents to append as an appendix to all manuals.
263 #latex_appendices = []
264
265 # If false, no module index is generated.
266 #latex_domain_indices = True
267
268
269 # -- Options for manual page output --------------------------------------------
270
271 # One entry per manual page. List of tuples
272 # (source start file, name, description, authors, manual section).
273 man_pages = [
274     ('index', '${module}', u'${module} Documentation',
275      [u'cc'], 1)
276 ]
277 """
278
279 docconf=Template(docconf)
280
281 docsalomeapp="""
282 <document>
283   <section name="${module}">
284     <parameter name="name" value="${module}"/>
285   </section>
286   <section name="resources">
287     <parameter name="${module}" value="$${${module}_ROOT_DIR}/share/salome/resources/${lmodule}"/>
288   </section>
289 </document>
290 """
291 docsalomeapp=Template(docsalomeapp)
292