Lines Matching +full:os +full:- +full:initiated

1 # -*- coding: utf-8; mode: python -*-
14 handling from the author's POV. Directives like ``kernel-figure`` implement
15 methods *to* always get the best output-format even if some tools are not
19 * ``.. kernel-image``: for image handling / a ``.. image::`` replacement
21 * ``.. kernel-figure``: for figure handling / a ``.. figure::`` replacement
23 * ``.. kernel-render``: for render markup / a concept to embed *render*
26 - ``DOT``: render embedded Graphviz's **DOC**
27 - ``SVG``: render embedded Scalable Vector Graphics (**SVG**)
28 - ... *developable*
33 available, the DOT language is inserted as literal-block.
37 - ``convert(1)``: ImageMagick (https://www.imagemagick.org)
43 * generate SVG (html-builder) and PDF (latex-builder) from DOT files.
44 DOT: see https://www.graphviz.org/content/dot-language
48 import os
49 from os import path
83 # -------------
91 envpath = os.environ.get('PATH', None) or os.defpath
92 for folder in envpath.split(os.pathsep):
93 fname = folder + os.sep + cmd
99 os.makedirs(folder, mode)
114 and os.stat(path1).st_ctime > os.stat(path2).st_ctime)
120 # -------------------------------------------
131 app.connect('builder-inited', setupTools)
134 app.add_directive("kernel-image", KernelImage)
143 app.add_directive("kernel-figure", KernelFigure)
152 app.add_directive('kernel-render', KernelRender)
160 app.connect('doctree-read', add_kernel_figure_to_std_domain)
173 This function is called once, when the builder is initiated.
195 # --------------------------
223 # in kernel builds, use 'make SPHINXOPTS=-v' to see verbose messages
298 option ``-Txxx``). Normally you will use one of the following extensions:
300 - ``.ps`` for PostScript,
301 - ``.svg`` or ``svgz`` for Structured Vector Graphics,
302 - ``.fig`` for XFIG graphics and
303 - ``.png`` or ``gif`` for common bitmap graphics.
307 cmd = [dot_cmd, '-T%s' % out_format, dot_fname]
336 # ---------------------
341 Handles the ``image`` child-node with the ``convert_image(...)``.
347 """Node for ``kernel-image`` directive."""
360 if uri.endswith('.*') or uri.find('://') != -1:
373 # ---------------------
378 Handles the ``image`` child-node with the ``convert_image(...)``.
384 """Node for ``kernel-figure`` directive."""
396 if uri.endswith('.*') or uri.find('://') != -1:
411 # ---------------------
419 image child-node with the ``convert_image(...)``.
424 kernellog.verbose(app, 'visit kernel-render node lang: "%s"' % (srclang))
428 kernellog.warn(app, 'kernel-render: "%s" unknown / include raw.' % (srclang))
438 hashobj = code.encode('utf-8') # str(node.attributes)
439 fname = path.join('%s-%s' % (srclang, sha1(hashobj).hexdigest()))
459 """Node for ``kernel-render`` directive."""
529 """Add kernel-figure anchors to 'std' domain.
532 the caption (label) of ``kernel-figure`` directive (it only knows about
534 this will result in a 'undefined label' for kernel-figures.
536 This handle adds labels of kernel-figure to the 'std' domain labels.