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
71 # -------------
79 envpath = os.environ.get('PATH', None) or os.defpath
80 for folder in envpath.split(os.pathsep):
81 fname = folder + os.sep + cmd
87 os.makedirs(folder, mode)
102 and os.stat(path1).st_ctime > os.stat(path2).st_ctime)
108 # -------------------------------------------
119 app.connect('builder-inited', setupTools)
122 app.add_directive("kernel-image", KernelImage)
131 app.add_directive("kernel-figure", KernelFigure)
140 app.add_directive('kernel-render', KernelRender)
148 app.connect('doctree-read', add_kernel_figure_to_std_domain)
161 This function is called once, when the builder is initiated.
183 # --------------------------
211 # in kernel builds, use 'make SPHINXOPTS=-v' to see verbose messages
286 option ``-Txxx``). Normally you will use one of the following extensions:
288 - ``.ps`` for PostScript,
289 - ``.svg`` or ``svgz`` for Structured Vector Graphics,
290 - ``.fig`` for XFIG graphics and
291 - ``.png`` or ``gif`` for common bitmap graphics.
295 cmd = [dot_cmd, '-T%s' % out_format, dot_fname]
324 # ---------------------
329 Handles the ``image`` child-node with the ``convert_image(...)``.
335 """Node for ``kernel-image`` directive."""
348 if uri.endswith('.*') or uri.find('://') != -1:
361 # ---------------------
366 Handles the ``image`` child-node with the ``convert_image(...)``.
372 """Node for ``kernel-figure`` directive."""
384 if uri.endswith('.*') or uri.find('://') != -1:
399 # ---------------------
407 image child-node with the ``convert_image(...)``.
412 kernellog.verbose(app, 'visit kernel-render node lang: "%s"' % (srclang))
416 kernellog.warn(app, 'kernel-render: "%s" unknown / include raw.' % (srclang))
426 hashobj = code.encode('utf-8') # str(node.attributes)
427 fname = path.join('%s-%s' % (srclang, sha1(hashobj).hexdigest()))
447 """Node for ``kernel-render`` directive."""
517 """Add kernel-figure anchors to 'std' domain.
520 the caption (label) of ``kernel-figure`` directive (it only knows about
522 this will result in a 'undefined label' for kernel-figures.
524 This handle adds labels of kernel-figure to the 'std' domain labels.