1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320
|
# -*- coding: utf-8 -*-
#---------------------------------------------------------------------------
# Name: sphinxtools/templates.py
# Author: Andrea Gavana
#
# Created: 30-Nov-2010
# Copyright: (c) 2010-2020 by Total Control Software
# License: wxWindows License
#---------------------------------------------------------------------------
# Main class description, with class name repeated twice
TEMPLATE_DESCRIPTION = '''
.. _%s:
==========================================================================================================================================
|phoenix_title| **%s**
==========================================================================================================================================
'''
# Inheritance diagram template, containing the class name, the PNG file representing
# the inheritance diagram, the "ALT" HTML flag (the class name again) and the full
# "MAP" HTML flag used for mouse navigation in the inheritance diagram boxes
TEMPLATE_INHERITANCE = '''
|
|class_hierarchy| Class Hierarchy
=================================
.. raw:: html
<div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
<img id="toggleBlock-trigger" src="_static/images/closed.png"/>
Inheritance diagram for %s <strong>%s</strong>:
</div>
<div id="toggleBlock-summary" style="display:block;"></div>
<div id="toggleBlock-content" style="display:none;">
<p class="graphviz">
<center><img src="_static/images/inheritance/%s" alt="Inheritance diagram of %s" usemap="#dummy" class="inheritance"/></center>
<script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
%s
</p>
</div>
|
'''
# Template for the widget screenshots, with one screenshots image file for
# each platform
TEMPLATE_APPEARANCE = '''
|appearance| Control Appearance
===============================
|
.. container:: control-appearance-figures
.. figure:: _static/images/widgets/fullsize/wxmsw/%s
:alt: wxMSW
:figclass: appearance-figure
**wxMSW**
.. figure:: _static/images/widgets/fullsize/wxmac/%s
:alt: wxMAC
:figclass: appearance-figure
**wxMAC**
.. figure:: _static/images/widgets/fullsize/wxgtk/%s
:alt: wxGTK
:figclass: appearance-figure
**wxGTK**
|
'''
# Template for the subclasses of a class, with a string containing a list
# of comma separated class names with their ReST role as :ref: prepended
TEMPLATE_SUBCLASSES = '''
|sub_classes| Known Subclasses
==============================
%s
|
'''
# Template for the superclasses of a class, with a string containing a list
# of comma separated class names with their ReST role as :ref: prepended
TEMPLATE_SUPERCLASSES = '''
|super_classes| Known Superclasses
==================================
%s
|
'''
# Template for the method summary of a class, containing a table made of
# ``method_name`` ``method description``
TEMPLATE_METHOD_SUMMARY = '''
|method_summary| Methods Summary
================================
%s
|
'''
# Template for the property summary of a class, containing a table made of
# ``property_name`` ``property description``
TEMPLATE_PROPERTY_SUMMARY = '''
|property_summary| Properties Summary
=====================================
%s
|
'''
# Template for the Class API title, no input
TEMPLATE_API = '''
|api| Class API
===============
'''
# Template for the standalone function summary for a module (wx, wx.dataview
# and so on).
TEMPLATE_FUNCTION_SUMMARY = '''
.. include:: headings.inc
=========================================================================
**%s** Functions
=========================================================================
The functions and macros defined in the **%s** module are described here: you can look up a function using the alphabetical listing of them.
Function Summary
================
'''
# Template for the main class index for a module (wx, wx.dataview and so on).
TEMPLATE_CLASS_INDEX = '''
.. include:: headings.inc
=========================================================================
**%s**
=========================================================================
%s
Class Summary
=============
'''
# Template for the functions header in the module index
TEMPLATE_MODULE_FUNCTION_SUMMARY = '''
Functions Summary
=================
'''
# Template for the class window styles, with the class name as input
TEMPLATE_WINDOW_STYLES = '''
.. _%s-styles:
|styles| Window Styles
================================
'''
# Template for the class window extra styles, with the class name as input
TEMPLATE_WINDOW_EXTRASTYLES = '''
.. _%s-extra-styles:
|extra_styles| Window Extra Styles
==================================
'''
# Template for the class events, with the class name as input
TEMPLATE_EVENTS = '''
.. _%s-events:
|events| Events Emitted by this Class
=====================================
'''
TEMPLATE_CONTRIB = '''
|user| Contributed Examples
===========================
'''
# Template used to generate the widgets gallery (this needs some work)
TEMPLATE_GALLERY = '''
{%% extends "layout.html" %%}
{%% set title = "Thumbnail gallery" %%}
{%% block body %%}
<h3>Click on any image to go to the relevant documentation</h3>
<br/>
The gallery is generated by randomly choosing a widget image between the 3 main
available ports of wxPython, namely <tt>wxMSW</tt>, <tt>wxGTK</tt> and <tt>wxMAC</tt> every
time the <b>Phoenix</b> documentation is built.
<br/>
<br/>
<br/>
<br/>
<br/>
<div class="gallery_class">
%s
</div>
<br clear="all">
{%% endblock %%}
'''
# Template to generate the "headings.inc" file containing the substitution reference
# for the small icons used in the Sphinx titles, sub-titles and so on.
TEMPLATE_HEADINGS = '''
.. |%s| image:: %s
:align: middle
:width: %dpx
'''
# Templates for the summary of modules/packages, containing a table made of
# ``module name`` ``short description``
TEMPLATE_MODULE_SUMMARY = '''
|module_summary| Modules Summary
================================
%s
|
'''
TEMPLATE_PACKAGE_SUMMARY = '''
|package_summary| Packages Summary
==================================
%s
|
'''
TEMPLATE_STD_FUNCTION_SUMMARY = '''
|function_summary| Functions Summary
====================================
%s
|
'''
TEMPLATE_STD_CLASS_SUMMARY = '''
|class_summary| Classes Summary
===============================
%s
|
'''
TEMPLATE_TOCTREE = '''
.. toctree::
:maxdepth: 1
:hidden:
%s
'''
|