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