|
SfePy
X.Y
|
00001 # -*- coding: utf-8 -*- 00002 # 00003 # SfePy documentation build configuration file, created by 00004 # sphinx-quickstart on Wed Oct 14 00:02:22 2009. 00005 # 00006 # This file is execfile()d with the current directory set to its containing dir. 00007 # 00008 # Note that not all possible configuration values are present in this 00009 # autogenerated file. 00010 # 00011 # All configuration values have a default; values that are commented out 00012 # serve to show the default. 00013 00014 import sys, os 00015 00016 # If extensions (or modules to document with autodoc) are in another directory, 00017 # add these directories to sys.path here. If the directory is relative to the 00018 # documentation root, use os.path.abspath to make it absolute, like shown here. 00019 #sys.path.append(os.path.abspath('.')) 00020 00021 ## LS: Below walks parent directory and adds all non-excluded to sys.path 00022 #def add_to_sys_path(arg, dirname, fnames): 00023 # excludes = ('.git',) 00024 # for exclude in excludes: 00025 # if exclude not in dirname: 00026 # sys.path.append(os.path.abspath(dirname)) 00027 # 00028 #doc_dir,conf_file = os.path.split(__file__) 00029 #sfepy_dir = os.path.abspath(os.path.join(doc_dir, os.path.pardir)) 00030 #os.path.walk(sfepy_dir, add_to_sys_path, None) 00031 sys.path.append(os.path.abspath('sphinxext')) 00032 00033 # This is needed for gen_term_table. 00034 sys.path.append(os.path.abspath('../script')) 00035 00036 import sfepy 00037 00038 numpydoc_path = sfepy.Config().numpydoc_path() 00039 00040 if numpydoc_path is not None: 00041 sys.path.append(os.path.abspath(numpydoc_path)) 00042 00043 # -- General configuration ----------------------------------------------------- 00044 00045 # Add any Sphinx extension module names here, as strings. They can be extensions 00046 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. 00047 extensions = ['sphinx.ext.autosummary', 'sphinx.ext.autodoc', 00048 'sphinx.ext.doctest', 'sphinx.ext.pngmath', 00049 'sphinx.ext.viewcode', 'numpydoc', 00050 'ipython_console_highlighting', 'sfepy.script.gen_term_table'] 00051 #extensions = ['sphinx.ext.autodoc'] 00052 00053 # Add any paths that contain templates here, relative to this directory. 00054 templates_path = ['_templates'] 00055 00056 # The suffix of source filenames. 00057 source_suffix = '.rst' 00058 00059 # The encoding of source files. 00060 #source_encoding = 'utf-8' 00061 00062 # The master toctree document. 00063 master_doc = 'index' 00064 00065 # General information about the project. 00066 project = u'SfePy' 00067 copyright = u'2014, Robert Cimrman and Contributors' 00068 00069 # The version info for the project you're documenting, acts as replacement for 00070 # |version| and |release|, also used in various other places throughout the 00071 # built documents. 00072 # 00073 # The short X.Y version. 00074 version = sfepy.__version__ 00075 # The full version, including alpha/beta/rc tags. 00076 release = version 00077 00078 # The language for content autogenerated by Sphinx. Refer to documentation 00079 # for a list of supported languages. 00080 #language = None 00081 00082 # There are two options for replacing |today|: either, you set today to some 00083 # non-false value, then it is used: 00084 #today = '' 00085 # Else, today_fmt is used as the format for a strftime call. 00086 today_fmt = '%B %d, %Y' 00087 00088 # List of documents that shouldn't be included in the build. 00089 #unused_docs = [] 00090 00091 # List of directories, relative to source directory, that shouldn't be searched 00092 # for source files. 00093 exclude_trees = ['_build'] 00094 00095 # The reST default role (used for this markup: `text`) to use for all documents. 00096 #default_role = None 00097 00098 # If true, '()' will be appended to :func: etc. cross-reference text. 00099 #add_function_parentheses = True 00100 00101 # If true, the current module name will be prepended to all description 00102 # unit titles (such as .. function::). 00103 add_module_names = True 00104 00105 # If true, sectionauthor and moduleauthor directives will be shown in the 00106 # output. They are ignored by default. 00107 show_authors = True 00108 00109 # The name of the Pygments (syntax highlighting) style to use. 00110 pygments_style = 'sphinx' 00111 00112 # A list of ignored prefixes for module index sorting. 00113 #modindex_common_prefix = [] 00114 00115 00116 # -- Options for HTML output --------------------------------------------------- 00117 00118 # The theme to use for HTML and HTML Help pages. Major themes that come with 00119 # Sphinx are currently 'default' and 'sphinxdoc'. 00120 html_theme = 'sfepy_theme' 00121 # Theme options are theme-specific and customize the look and feel of a theme 00122 # further. For a list of options available for each theme, see the 00123 # documentation. 00124 #html_theme_options = {} 00125 00126 # Add any paths that contain custom themes here, relative to this directory. 00127 html_theme_path = ["."] 00128 00129 # The name for this set of Sphinx documents. If None, it defaults to 00130 # "<project> v<release> documentation". 00131 #html_title = None 00132 00133 # A shorter title for the navigation bar. Default is the same as html_title. 00134 #html_short_title = None 00135 00136 # The name of an image file (relative to this directory) to place at the top 00137 # of the sidebar. 00138 #html_logo = None 00139 00140 # The name of an image file (within the static path) to use as favicon of the 00141 # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 00142 # pixels large. 00143 #html_favicon = None 00144 00145 # Add any paths that contain custom static files (such as style sheets) here, 00146 # relative to this directory. They are copied after the builtin static files, 00147 # so a file named "default.css" will overwrite the builtin "default.css". 00148 html_static_path = ['_static'] 00149 00150 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, 00151 # using the given strftime format. 00152 html_last_updated_fmt = '%b %d, %Y' 00153 00154 # If true, SmartyPants will be used to convert quotes and dashes to 00155 # typographically correct entities. 00156 html_use_smartypants = True 00157 00158 # Custom sidebar templates, maps document names to template names. 00159 #html_sidebars = {} 00160 00161 # Additional templates that should be rendered to pages, maps page names to 00162 # template names. 00163 html_additional_pages = {} 00164 #html_additional_pages = {'index': 'index.html', 'gallery':'gallery.html'} 00165 00166 # If false, no module index is generated. 00167 html_use_modindex = True 00168 00169 html_domain_indices = ["py-modindex"] 00170 00171 # If false, no index is generated. 00172 html_use_index = True 00173 00174 # If true, the index is split into individual pages for each letter. 00175 html_split_index = True 00176 00177 # If true, links to the reST sources are added to the pages. 00178 #html_show_sourcelink = True 00179 00180 # If true, an OpenSearch description file will be output, and all pages will 00181 # contain a <link> tag referring to it. The value of this option must be the 00182 # base URL from which the finished HTML is served. 00183 html_use_opensearch = '../objects.inv' 00184 00185 # If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). 00186 #html_file_suffix = '' 00187 00188 # Output file base name for HTML help builder. 00189 htmlhelp_basename = 'SfePydoc' 00190 00191 00192 # -- Options for LaTeX output -------------------------------------------------- 00193 00194 # The paper size ('letter' or 'a4'). 00195 latex_paper_size = 'a4' 00196 00197 # The font size ('10pt', '11pt' or '12pt'). 00198 latex_font_size = '12pt' 00199 00200 # Grouping the document tree into LaTeX files. List of tuples 00201 # (source start file, target name, title, author, documentclass [howto/manual]). 00202 latex_documents = [ 00203 ('index', 'SfePy.tex', u'SfePy Documentation', 00204 u'Robert Cimrman and Contributors', 'manual'), 00205 ] 00206 00207 # The name of an image file (relative to this directory) to place at the top of 00208 # the title page. 00209 #latex_logo = None 00210 00211 # For "manual" documents, if this is true, then toplevel headings are parts, 00212 # not chapters. 00213 #latex_use_parts = False 00214 00215 # Additional stuff for the LaTeX preamble. 00216 #latex_preamble = '' 00217 latex_preamble = r""" 00218 \usepackage{bm} 00219 \usepackage{amsfonts} 00220 \def\dt{{\Delta t}} 00221 \def\pdiff#1#2{\frac{\partial {#1}}{\partial {#2}}} 00222 \def\tdiff#1#2{\frac{{\rm d} {#1}}{{\rm d} {#2}}} 00223 \def\difd#1{\ {\rm d}#1} 00224 \def\intl#1#2{\int \limits_{#1}^{#2}} 00225 \def\eff{^{\rm eff}} 00226 \def\sunm{^{(n-1)}} 00227 \def\suz{^{(0)}} 00228 \newcommand{\dvg}{\mathop{\rm div}} 00229 \newcommand{\tr}{\mathop{\rm tr}} 00230 \newcommand{\ul}[1]{\underline{#1}} 00231 \newcommand{\uld}[1]{\dot{\underline{#1}}} 00232 \newcommand{\ull}[1]{\underline{\underline{#1}}} 00233 \newcommand{\dev}{\mathop{\rm dev}} 00234 \newcommand{\skewop}{\mathop{\rm skew}} 00235 \def\from{\leftarrow} 00236 \def\Vcal{\mathcal{V}} 00237 \def\Tcal{\mathcal{T}} 00238 \def\Ical{\mathcal{I}} 00239 \def\Hcal{\mathcal{H}} 00240 \def\Fcal{\mathcal{F}} 00241 \def\Gcal{\mathcal{G}} 00242 \def\pd{\partial} 00243 \def\ub{\bm{u}} 00244 \def\vb{\bm{v}} 00245 \def\Mb{\bm{M}} 00246 \def\vphib{\bm{\varphi}} 00247 """ 00248 # LS: Are the following needed as well? 00249 #\def\Vcal{\mathcal{V}} 00250 #\def\Tcal{\mathcal{T}} 00251 #\def\figDir{../doc/tex/figures} 00252 #""" 00253 00254 # Documents to append as an appendix to all manuals. 00255 #latex_appendices = [] 00256 00257 # If false, no module index is generated. 00258 latex_use_modindex = True 00259 00260 # Preamble for pngmath images 00261 pngmath_latex_preamble = latex_preamble 00262 00263 # Turn off numpydoc autosummary tables 00264 numpydoc_show_class_members = False 00265 00266 def process_terms(app, what_, name, obj, options, lines): 00267 """ 00268 Prepend term call signature(s) into term docstrings. 00269 """ 00270 from types import TypeType 00271 from sfepy.terms.terms import Term 00272 00273 if isinstance(obj, TypeType): 00274 if issubclass(obj, Term) and len(obj.name): 00275 arg_types = obj.arg_types 00276 if ((len(arg_types) > 1) and not isinstance(arg_types[0], str)): 00277 arg_types = [u', '.join(['%s' % arg for arg in arg_type]) 00278 for arg_type in arg_types] 00279 at_lines = [u'``(%s)``' % arg_type for arg_type in arg_types] 00280 00281 else: 00282 arg_types = u', '.join(['%s' % arg for arg in arg_types]) 00283 at_lines = [u'``(%s)``' % arg_types] 00284 00285 for ii, line in enumerate(lines): 00286 if line.startswith(':Arguments'): 00287 i0 = ii - 1 00288 break 00289 00290 else: 00291 i0 = 0 00292 00293 len0 = len(obj.name) + 4 00294 lines.insert(i0+0, u'') 00295 lines.insert(i0+1, u':Call signature:') 00296 lines.insert(i0+2, u'') 00297 lines.insert(i0+3, (u'=' * len0) + u' ===') 00298 lines.insert(i0+4, u'**%s** %s' % (obj.name, at_lines[0])) 00299 for ii, line in enumerate(at_lines[1:]): 00300 lines.insert(i0+5+ii, u'..' + (' ' * (len0 - 1)) + line) 00301 lines.insert(i0+4+len(at_lines), (u'=' * len0) + u' ===') 00302 lines.insert(i0+5+len(at_lines), u'') 00303 00304 # make sure there is a blank line at the end 00305 if lines and lines[-1]: 00306 lines.append(u'') 00307 00308 00309 def setup(app): 00310 app.connect('autodoc-process-docstring', process_terms)
1.7.6.1