pax_global_header00006660000000000000000000000064141531375350014521gustar00rootroot0000000000000052 comment=cc10e3bf0c3b347a95213d4621ceb923b3be00b0 sphinxcontrib-blockdiag-3.0.0/000077500000000000000000000000001415313753500163305ustar00rootroot00000000000000sphinxcontrib-blockdiag-3.0.0/.codeclimate.yml000066400000000000000000000000701415313753500213770ustar00rootroot00000000000000languages: Python: true exclude_paths: - "tests/*.py" sphinxcontrib-blockdiag-3.0.0/.github/000077500000000000000000000000001415313753500176705ustar00rootroot00000000000000sphinxcontrib-blockdiag-3.0.0/.github/workflows/000077500000000000000000000000001415313753500217255ustar00rootroot00000000000000sphinxcontrib-blockdiag-3.0.0/.github/workflows/release.yml000066400000000000000000000012131415313753500240650ustar00rootroot00000000000000name: Release a new package on: push: tags: - '*' jobs: release: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v2 with: python-version: '3.x' - name: Install dependencies run: pip install docutils setuptools wheel - name: Build package run: python setup.py sdist bdist_wheel - name: Upload package to PyPI uses: pypa/gh-action-pypi-publish@master if: startsWith(github.ref, 'refs/tags/') with: user: __token__ password: ${{ secrets.PYPI_API_TOKEN }} sphinxcontrib-blockdiag-3.0.0/.github/workflows/test.yml000066400000000000000000000015231415313753500234300ustar00rootroot00000000000000name: CI on: [push, pull_request] jobs: ubuntu: runs-on: ubuntu-latest strategy: fail-fast: false matrix: name: [py37, py38, py39, blockdiag_dev] include: - name: py37 python: 3.7 toxenv: py37 - name: py38 python: 3.8 toxenv: py38 - name: py39 python: 3.9 toxenv: py39 - name: blockdiag_dev python: 3.9 toxenv: blockdiag_dev steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python }} - name: Check Python version run: python --version - name: Install dependencies run: pip install -U tox - name: Run Tox run: tox -e ${{ matrix.toxenv }} -- -vv sphinxcontrib-blockdiag-3.0.0/.gitignore000066400000000000000000000001021415313753500203110ustar00rootroot00000000000000*.egg-info *.pyc .coverage .tox/ .mypy_cache/ bin/ include/ lib/ sphinxcontrib-blockdiag-3.0.0/AUTHORS000066400000000000000000000000451415313753500173770ustar00rootroot00000000000000Takeshi KOMIYA sphinxcontrib-blockdiag-3.0.0/LICENSE000066400000000000000000000026121415313753500173360ustar00rootroot00000000000000If not otherwise noted, the extensions in this package are licensed under the following license. Copyright (c) 2009 by the contributors (see AUTHORS file). All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. sphinxcontrib-blockdiag-3.0.0/MANIFEST.in000066400000000000000000000001051415313753500200620ustar00rootroot00000000000000include AUTHORS include LICENSE include README.rst include CHANGES.* sphinxcontrib-blockdiag-3.0.0/README.rst000066400000000000000000000020231415313753500200140ustar00rootroot00000000000000======================= sphinxcontrib-blockdiag ======================= .. image:: https://travis-ci.org/blockdiag/sphinxcontrib-blockdiag.svg?branch=master :target: https://travis-ci.org/blockdiag/sphinxcontrib-blockdiag .. image:: https://coveralls.io/repos/blockdiag/sphinxcontrib-blockdiag/badge.png?branch=master :target: https://coveralls.io/r/blockdiag/sphinxcontrib-blockdiag?branch=master .. image:: https://codeclimate.com/github/blockdiag/sphinxcontrib-blockdiag/badges/gpa.svg :target: https://codeclimate.com/github/blockdiag/sphinxcontrib-blockdiag A sphinx extension for embedding block diagram using blockdiag_. This extension enables you to insert block diagrams into your document. Following code is an example:: .. blockdiag:: diagram { A -> B -> C; B -> D; } .. _blockdiag: http://bitbucket.org/blockdiag/blockdiag/ For more details, see `online documentation`_ at http://blockdiag.com/. .. _online documentation: http://blockdiag.com/en/blockdiag/sphinxcontrib.html sphinxcontrib-blockdiag-3.0.0/setup.cfg000066400000000000000000000004231415313753500201500ustar00rootroot00000000000000[egg_info] ;tag_build = dev [build] build-base = _build [sdist] formats = gztar [wheel] universal = 1 [aliases] release = check -r -s register sdist bdist_wheel upload [check] strict = 1 restructuredtext = 1 [flake8] max-line-length=120 ignore=W504 exclude=tests/docs/ sphinxcontrib-blockdiag-3.0.0/setup.py000066400000000000000000000025571415313753500200530ustar00rootroot00000000000000# -*- coding: utf-8 -*- from setuptools import setup, find_packages requires = ['blockdiag>=1.5.0', 'Sphinx>=2.0'] setup( name='sphinxcontrib-blockdiag', version='3.0.0', url='https://github.com/blockdiag/sphinxcontrib-blockdiag', license='BSD', author='Takeshi KOMIYA', author_email='i.tkomiya@gmail.com', description='Sphinx "blockdiag" extension', long_description=open("README.rst").read(), zip_safe=False, classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Console', 'Environment :: Web Environment', 'Framework :: Sphinx :: Extension', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3 :: Only', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Topic :: Documentation', 'Topic :: Documentation :: Sphinx', 'Topic :: Utilities', ], platforms='any', packages=find_packages(exclude=['tests']), include_package_data=True, python_requires=">=3.7", install_requires=requires, namespace_packages=['sphinxcontrib'], ) sphinxcontrib-blockdiag-3.0.0/sphinxcontrib/000077500000000000000000000000001415313753500212225ustar00rootroot00000000000000sphinxcontrib-blockdiag-3.0.0/sphinxcontrib/__init__.py000066400000000000000000000005551415313753500233400ustar00rootroot00000000000000# -*- coding: utf-8 -*- """ sphinxcontrib ~~~~~~~~~~~~~ This package is a namespace package that contains all extensions distributed in the ``sphinx-contrib`` distribution. :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ __import__('pkg_resources').declare_namespace(__name__) sphinxcontrib-blockdiag-3.0.0/sphinxcontrib/blockdiag.py000066400000000000000000000247721415313753500235270ustar00rootroot00000000000000# -*- coding: utf-8 -*- """ blockdiag.sphinx_ext ~~~~~~~~~~~~~~~~~~~~ Allow blockdiag-formatted diagrams to be included in Sphinx-generated documents inline. :copyright: Copyright 2010 by Takeshi Komiya. :license: BSDL. """ import os import re import posixpath import traceback import pkg_resources from collections import namedtuple from docutils import nodes from sphinx import addnodes from sphinx.util import logging from sphinx.util.osutil import ensuredir import blockdiag.utils.rst.nodes import blockdiag.utils.rst.directives from blockdiag.utils.bootstrap import detectfont, Application from blockdiag.utils.fontmap import FontMap from blockdiag.utils.rst.directives import with_blockdiag # fontconfig; it will be initialized on `builder-inited` event. fontmap = None logger = logging.getLogger(__name__) class blockdiag_node(blockdiag.utils.rst.nodes.blockdiag): def to_drawer(self, image_format, builder, **kwargs): if 'filename' in kwargs: filename = kwargs.pop('filename') else: filename = self.get_abspath(image_format, builder) antialias = builder.config.blockdiag_antialias transparency = builder.config.blockdiag_transparency image = super(blockdiag_node, self).to_drawer(image_format, filename, fontmap, antialias=antialias, transparency=transparency, **kwargs) for node in image.diagram.traverse_nodes(): node.href = resolve_reference(builder, node.href) return image def get_relpath(self, image_format, builder): options = dict(antialias=builder.config.blockdiag_antialias, fontpath=builder.config.blockdiag_fontpath, fontmap=builder.config.blockdiag_fontmap, format=image_format, transparency=builder.config.blockdiag_transparency) return posixpath.join(builder.imgpath, self.get_path(**options)) def get_abspath(self, image_format, builder): options = dict(antialias=builder.config.blockdiag_antialias, fontpath=builder.config.blockdiag_fontpath, fontmap=builder.config.blockdiag_fontmap, format=image_format, transparency=builder.config.blockdiag_transparency) path = os.path.join(builder.outdir, builder.imagedir, self.get_path(**options)) ensuredir(os.path.dirname(path)) return path class Blockdiag(blockdiag.utils.rst.directives.BlockdiagDirective): node_class = blockdiag_node def node2image(self, node, diagram): return node def resolve_reference(builder, href): if href is None: return None pattern = re.compile("^:ref:`(.+?)`", re.UNICODE) matched = pattern.search(href) if matched is None: return href elif not hasattr(builder, 'current_docname'): # ex. latex builder return matched.group(1) else: refid = matched.group(1) domain = builder.env.domains['std'] node = addnodes.pending_xref(refexplicit=False) xref = domain.resolve_xref(builder.env, builder.current_docname, builder, 'ref', refid, node, node) if xref: if 'refid' in xref: return "#" + xref['refid'] else: return xref['refuri'] else: logger.warning('undefined label: %s', refid) return None def html_render_svg(self, node): image = node.to_drawer('SVG', self.builder, filename=None, nodoctype=True) image.draw() # align align = node['options'].get('align', 'default') self.body.append('
' % align) self.context.append('
\n') # reftarget for node_id in node['ids']: self.body.append('' % node_id) # resize image size = image.pagesize().resize(**node['options']) self.body.append(image.save(size)) self.context.append('') def html_render_clickablemap(self, image, width_ratio, height_ratio): href_nodes = [node for node in image.nodes if node.href] if not href_nodes: return self.body.append('' % id(image)) for node in href_nodes: x1, y1, x2, y2 = image.metrics.cell(node) x1 *= width_ratio x2 *= width_ratio y1 *= height_ratio y2 *= height_ratio areatag = '' % (x1, y1, x2, y2, node.href) self.body.append(areatag) self.body.append('') def html_render_png(self, node): image = node.to_drawer('PNG', self.builder) if not os.path.isfile(image.filename): image.draw() image.save() # align align = node['options'].get('align', 'default') self.body.append('
' % align) self.context.append('
\n') # link to original image relpath = node.get_relpath('PNG', self.builder) relpath = relpath.replace(os.path.sep, '/') if 'width' in node['options'] or 'height' in node['options'] or 'scale' in node['options']: self.body.append('' % relpath) self.context.append('') else: self.context.append('') # tag original_size = image.pagesize() resized = original_size.resize(**node['options']) img_attr = dict(src=relpath, width=resized.width, height=resized.height) if any(node.href for node in image.nodes): img_attr['usemap'] = "#map_%d" % id(image) width_ratio = float(resized.width) / original_size.width height_ratio = float(resized.height) / original_size.height html_render_clickablemap(self, image, width_ratio, height_ratio) if 'alt' in node['options']: img_attr['alt'] = node['options']['alt'] self.body.append(self.starttag(node, 'img', '', empty=True, **img_attr)) @with_blockdiag def html_visit_blockdiag(self, node): try: image_format = get_image_format_for(self.builder) if image_format.upper() == 'SVG': html_render_svg(self, node) else: html_render_png(self, node) except UnicodeEncodeError: if self.builder.config.blockdiag_debug: traceback.print_exc() msg = ("blockdiag error: UnicodeEncodeError caught " "(check your font settings)") logger.warning(msg) raise nodes.SkipNode except Exception as exc: if self.builder.config.blockdiag_debug: traceback.print_exc() logger.warning('dot code %r: %s', node['code'], exc) raise nodes.SkipNode def html_depart_blockdiag(self, node): self.body.append(self.context.pop()) self.body.append(self.context.pop()) def get_image_format_for(builder): if builder.format in ('html', 'slides'): image_format = builder.config.blockdiag_html_image_format.upper() elif builder.format == 'latex': if builder.config.blockdiag_tex_image_format: image_format = builder.config.blockdiag_tex_image_format.upper() else: image_format = builder.config.blockdiag_latex_image_format.upper() else: image_format = 'PNG' if image_format.upper() not in ('PNG', 'PDF', 'SVG'): raise ValueError('unknown format: %s' % image_format) if image_format.upper() == 'PDF': try: import reportlab # NOQA: importing test except ImportError: raise ImportError('Could not output PDF format. Install reportlab.') return image_format def on_builder_inited(self): # show deprecated message if self.builder.config.blockdiag_tex_image_format: logger.warning('blockdiag_tex_image_format is deprecated. Use blockdiag_latex_image_format.') # initialize fontmap global fontmap try: fontmappath = self.builder.config.blockdiag_fontmap fontmap = FontMap(fontmappath) except Exception: fontmap = FontMap(None) try: fontpath = self.builder.config.blockdiag_fontpath if isinstance(fontpath, str): fontpath = [fontpath] if fontpath: config = namedtuple('Config', 'font')(fontpath) fontpath = detectfont(config) fontmap.set_default_font(fontpath) except Exception: pass def on_doctree_resolved(self, doctree, docname): if self.builder.format in ('html', 'slides'): return try: image_format = get_image_format_for(self.builder) except Exception as exc: if self.builder.config.blockdiag_debug: traceback.print_exc() logger.warning('blockdiag error: %s', exc) for node in doctree.traverse(blockdiag_node): node.parent.remove(node) return for node in doctree.traverse(blockdiag_node): try: with Application(): relfn = node.get_relpath(image_format, self.builder) image = node.to_drawer(image_format, self.builder) if not os.path.isfile(image.filename): image.draw() image.save() image = nodes.image(uri=relfn, candidates={'*': relfn}, **node['options']) node.parent.replace(node, image) except Exception as exc: if self.builder.config.blockdiag_debug: traceback.print_exc() logger.warning('dot code %r: %s', node['code'], exc) node.parent.remove(node) def setup(app): app.add_node(blockdiag_node, html=(html_visit_blockdiag, html_depart_blockdiag)) app.add_directive('blockdiag', Blockdiag) app.add_config_value('blockdiag_fontpath', None, 'html') app.add_config_value('blockdiag_fontmap', None, 'html') app.add_config_value('blockdiag_antialias', False, 'html') app.add_config_value('blockdiag_transparency', True, 'html') app.add_config_value('blockdiag_debug', False, 'html') app.add_config_value('blockdiag_html_image_format', 'PNG', 'html') app.add_config_value('blockdiag_tex_image_format', None, 'html') # backward compatibility for 1.3.1 app.add_config_value('blockdiag_latex_image_format', 'PNG', 'html') app.connect("builder-inited", on_builder_inited) app.connect("doctree-resolved", on_doctree_resolved) return { 'version': pkg_resources.require('blockdiag')[0].version, 'parallel_read_safe': True, 'parallel_write_safe': True, } sphinxcontrib-blockdiag-3.0.0/tests/000077500000000000000000000000001415313753500174725ustar00rootroot00000000000000sphinxcontrib-blockdiag-3.0.0/tests/__init__.py000066400000000000000000000000001415313753500215710ustar00rootroot00000000000000sphinxcontrib-blockdiag-3.0.0/tests/docs/000077500000000000000000000000001415313753500204225ustar00rootroot00000000000000sphinxcontrib-blockdiag-3.0.0/tests/docs/basic/000077500000000000000000000000001415313753500215035ustar00rootroot00000000000000sphinxcontrib-blockdiag-3.0.0/tests/docs/basic/conf.py000066400000000000000000000176461415313753500230200ustar00rootroot00000000000000# -*- coding: utf-8 -*- # # test documentation build configuration file, created by # sphinx-quickstart on Sun Dec 8 15:14:18 2013. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import sys import os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = ['sphinxcontrib.blockdiag'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. project = u'test' copyright = u'2013, test' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = '1.0' # The full version, including alpha/beta/rc tags. release = '1.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = ['_build'] # The reST default role (used for this markup: `text`) to use for all # documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). #add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] # If true, keep warnings as "system message" paragraphs in the built documents. #keep_warnings = False # -- Options for HTML output ---------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme = 'default' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. #html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. #html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied # directly to the root of the documentation. #html_extra_path = [] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. #html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, links to the reST sources are added to the pages. #html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. #html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. #html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = None # Output file base name for HTML help builder. htmlhelp_basename = 'testdoc' # -- Options for LaTeX output --------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). #'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). #'pointsize': '10pt', # Additional stuff for the LaTeX preamble. #'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ ('index', 'test.tex', u'test Documentation', u'test', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False # If true, show page references after internal links. #latex_show_pagerefs = False # If true, show URL addresses after external links. #latex_show_urls = False # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_domain_indices = True # -- Options for manual page output --------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ ('index', 'test', u'test Documentation', [u'test'], 1) ] # If true, show URL addresses after external links. #man_show_urls = False # -- Options for Texinfo output ------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ ('index', 'test', u'test Documentation', u'test', 'test', 'One line description of project.', 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. #texinfo_appendices = [] # If false, no module index is generated. #texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. #texinfo_show_urls = 'footnote' # If true, do not generate a @detailmenu in the "Top" node's menu. #texinfo_no_detailmenu = False sphinxcontrib-blockdiag-3.0.0/tests/docs/basic/index.rst000066400000000000000000000001531415313753500233430ustar00rootroot00000000000000Welcome to test's documentation! ================================ .. blockdiag:: { A -> B; } sphinxcontrib-blockdiag-3.0.0/tests/docs/subdir/000077500000000000000000000000001415313753500217125ustar00rootroot00000000000000sphinxcontrib-blockdiag-3.0.0/tests/docs/subdir/conf.py000066400000000000000000000176461415313753500232270ustar00rootroot00000000000000# -*- coding: utf-8 -*- # # test documentation build configuration file, created by # sphinx-quickstart on Sun Dec 8 15:14:18 2013. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import sys import os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = ['sphinxcontrib.blockdiag'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. project = u'test' copyright = u'2013, test' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = '1.0' # The full version, including alpha/beta/rc tags. release = '1.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = ['_build'] # The reST default role (used for this markup: `text`) to use for all # documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). #add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] # If true, keep warnings as "system message" paragraphs in the built documents. #keep_warnings = False # -- Options for HTML output ---------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme = 'default' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. #html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. #html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied # directly to the root of the documentation. #html_extra_path = [] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. #html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, links to the reST sources are added to the pages. #html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. #html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. #html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = None # Output file base name for HTML help builder. htmlhelp_basename = 'testdoc' # -- Options for LaTeX output --------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). #'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). #'pointsize': '10pt', # Additional stuff for the LaTeX preamble. #'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ ('index', 'test.tex', u'test Documentation', u'test', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False # If true, show page references after internal links. #latex_show_pagerefs = False # If true, show URL addresses after external links. #latex_show_urls = False # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_domain_indices = True # -- Options for manual page output --------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ ('index', 'test', u'test Documentation', [u'test'], 1) ] # If true, show URL addresses after external links. #man_show_urls = False # -- Options for Texinfo output ------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ ('index', 'test', u'test Documentation', u'test', 'test', 'One line description of project.', 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. #texinfo_appendices = [] # If false, no module index is generated. #texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. #texinfo_show_urls = 'footnote' # If true, do not generate a @detailmenu in the "Top" node's menu. #texinfo_no_detailmenu = False sphinxcontrib-blockdiag-3.0.0/tests/docs/subdir/index.rst000066400000000000000000000001531415313753500235520ustar00rootroot00000000000000Welcome to test's documentation! ================================ .. blockdiag:: { A -> B; } sphinxcontrib-blockdiag-3.0.0/tests/docs/subdir/subdir/000077500000000000000000000000001415313753500232025ustar00rootroot00000000000000sphinxcontrib-blockdiag-3.0.0/tests/docs/subdir/subdir/index.rst000066400000000000000000000001531415313753500250420ustar00rootroot00000000000000Welcome to test's documentation! ================================ .. blockdiag:: { A -> B; } sphinxcontrib-blockdiag-3.0.0/tests/test_basic.py000066400000000000000000000013321415313753500221630ustar00rootroot00000000000000# -*- coding: utf-8 -*- from sphinx_testing import with_app @with_app(buildername='html', srcdir='tests/docs/basic/') def test_build_html(app, status, warning): app.builder.build_all() @with_app(buildername='singlehtml', srcdir='tests/docs/basic/') def test_build_singlehtml(app, status, warning): app.builder.build_all() @with_app(buildername='latex', srcdir='tests/docs/basic/') def test_build_latex(app, status, warning): app.builder.build_all() @with_app(buildername='epub', srcdir='tests/docs/basic/') def test_build_epub(app, status, warning): app.builder.build_all() @with_app(buildername='json', srcdir='tests/docs/basic/') def test_build_json(app, status, warning): app.builder.build_all() sphinxcontrib-blockdiag-3.0.0/tests/test_errors.py000066400000000000000000000037311415313753500224230ustar00rootroot00000000000000# -*- coding: utf-8 -*- from mock import patch from sphinx_testing import with_app import sys import unittest class TestSphinxcontribBlockdiagErrors(unittest.TestCase): @with_app(srcdir='tests/docs/basic', write_docstring=True) def test_parse_error(self, app, status, warning): """ .. blockdiag:: { A -> B; """ app.builder.build_all() self.assertIn('got unexpected token:', warning.getvalue()) @with_app(srcdir='tests/docs/basic', confoverrides=dict(blockdiag_html_image_format='JPG')) def test_unknown_format_error(self, app, status, warning): app.builder.build_all() self.assertIn('unknown format: JPG', warning.getvalue()) @with_app(srcdir='tests/docs/basic', confoverrides=dict(blockdiag_html_image_format='PDF')) def test_reportlab_not_found_error(self, app, status, warning): try: # unload reportlab and make loading it impossible sys.modules.pop('reportlab', None) path = sys.path sys.path = [] app.builder.build_all() self.assertIn('Could not output PDF format. Install reportlab.', warning.getvalue()) finally: sys.path = path @with_app(srcdir='tests/docs/basic') @patch("blockdiag.utils.rst.nodes.blockdiag.processor.drawer.DiagramDraw") def test_rendering_error(self, app, status, warning, DiagramDraw): DiagramDraw.side_effect = RuntimeError("UNKNOWN ERROR!") app.builder.build_all() self.assertIn('UNKNOWN ERROR!', warning.getvalue()) @with_app(srcdir='tests/docs/basic') @patch("sphinxcontrib.blockdiag.blockdiag.drawer.DiagramDraw.draw") def test_font_settings_error(self, app, status, warning, draw): draw.side_effect = UnicodeEncodeError("", "", 0, 0, "") app.builder.build_all() self.assertIn('UnicodeEncodeError caught (check your font settings)', warning.getvalue()) sphinxcontrib-blockdiag-3.0.0/tests/test_html.py000066400000000000000000000342441415313753500220560ustar00rootroot00000000000000# -*- coding: utf-8 -*- from sphinx_testing import with_app import unittest with_png_app = with_app(srcdir='tests/docs/basic', buildername='html', write_docstring=True) with_svg_app = with_app(srcdir='tests/docs/basic', buildername='html', write_docstring=True, confoverrides={ 'blockdiag_html_image_format': 'SVG' }) class TestSphinxcontribBlockdiagHTML(unittest.TestCase): @with_png_app def test_build_png_image(self, app, status, warning): """ .. blockdiag:: A -> B; """ app.builder.build_all() source = (app.outdir / 'index.html').read_text(encoding='utf-8') self.assertRegexpMatches(source, '
') @with_app(srcdir='tests/docs/subdir', buildername='html', write_docstring=True) def test_build_png_image_in_subdir(self, app, status, warning): """ .. blockdiag:: A -> B; """ app.builder.build_all() source = (app.outdir / 'subdir' / 'index.html').read_text(encoding='utf-8') self.assertRegexpMatches(source, r'
') @with_png_app def test_width_option_on_png(self, app, status, warning): """ .. blockdiag:: :width: 224 A -> B; """ app.builder.build_all() source = (app.outdir / 'index.html').read_text(encoding='utf-8') self.assertRegexpMatches(source, ('
' '' '
')) @with_png_app def test_height_option_on_png(self, app, status, warning): """ .. blockdiag:: :height: 240 A -> B; """ app.builder.build_all() source = (app.outdir / 'index.html').read_text(encoding='utf-8') self.assertRegexpMatches(source, ('
' '' '
')) @with_png_app def test_width_option_and_height_option_on_png(self, app, status, warning): """ .. blockdiag:: :width: 100 :height: 200 A -> B; """ app.builder.build_all() source = (app.outdir / 'index.html').read_text() self.assertRegexpMatches(source, ('
' '' '
')) @with_png_app def test_scale_option_on_png(self, app, status, warning): """ .. blockdiag:: :scale: 25% A -> B; """ app.builder.build_all() source = (app.outdir / 'index.html').read_text(encoding='utf-8') self.assertRegexpMatches(source, ('
' '' '
')) @with_png_app def test_width_option_and_scale_option_on_png(self, app, status, warning): """ .. blockdiag:: :width: 28 :scale: 25% A -> B; """ app.builder.build_all() source = (app.outdir / 'index.html').read_text(encoding='utf-8') self.assertRegexpMatches(source, ('
' '' '
')) @with_png_app def test_align_option_on_png(self, app, status, warning): """ .. blockdiag:: :align: center A -> B; """ app.builder.build_all() source = (app.outdir / 'index.html').read_text(encoding='utf-8') self.assertRegexpMatches(source, '
') @with_png_app def test_align_option_and_width_option_on_png(self, app, status, warning): """ .. blockdiag:: :align: center :width: 224 A -> B; """ app.builder.build_all() source = (app.outdir / 'index.html').read_text(encoding='utf-8') self.assertRegexpMatches(source, ('
' '' '
')) @with_png_app def test_name_option_on_png(self, app, status, warning): """ .. blockdiag:: :name: target A -> B; """ app.builder.build_all() source = (app.outdir / 'index.html').read_text(encoding='utf-8') self.assertRegexpMatches(source, '
') @with_png_app def test_name_option_and_width_option_on_png(self, app, status, warning): """ .. blockdiag:: :name: target :width: 224 A -> B; """ app.builder.build_all() source = (app.outdir / 'index.html').read_text(encoding='utf-8') self.assertRegexpMatches(source, ('
' '' '
')) @with_png_app def test_href_and_scale_option_on_png(self, app, status, warning): """ .. blockdiag:: :scale: 50% A -> B; A [href = 'http://blockdiag.com/']; """ app.builder.build_all() source = (app.outdir / 'index.html').read_text(encoding='utf-8') self.assertRegexpMatches(source, ('')) @with_png_app def test_reftarget_in_href_on_png1(self, app, status, warning): """ .. _target: heading2 --------- .. blockdiag:: A -> B; A [href = ':ref:`target`']; """ app.builder.build_all() source = (app.outdir / 'index.html').read_text(encoding='utf-8') self.assertRegexpMatches(source, ('
' '' '
')) @with_png_app def test_reftarget_in_href_on_png2(self, app, status, warning): """ .. _hello world: heading2 --------- .. blockdiag:: A -> B; A [href = ':ref:`hello world`']; """ app.builder.build_all() source = (app.outdir / 'index.html').read_text(encoding='utf-8') self.assertRegexpMatches(source, ('
' '' '
')) @with_png_app def test_missing_reftarget_in_href_on_png(self, app, status, warning): """ .. blockdiag:: A -> B; A [href = ':ref:`unknown_target`']; """ app.builder.build_all() source = (app.outdir / 'index.html').read_text(encoding='utf-8') self.assertRegexpMatches(source, ('
')) self.assertIn('undefined label: unknown_target', warning.getvalue()) @with_app(srcdir='tests/docs/basic', copy_srcdir_to_tmpdir=True, write_docstring=True, confoverrides={'blockdiag_html_image_format': 'SVG'}) def test_build_svg_image(self, app, status, warning): """ .. blockdiag:: A -> B; """ app.builder.build_all() source = (app.outdir / 'index.html').read_text(encoding='utf-8') self.assertRegexpMatches(source, '
') @with_svg_app def test_width_option_on_svg(self, app, status, warning): """ .. blockdiag:: :width: 224 A -> B; """ app.builder.build_all() source = (app.outdir / 'index.html').read_text(encoding='utf-8') self.assertRegexpMatches(source, ('
' '')) @with_svg_app def test_height_option_on_svg(self, app, status, warning): """ .. blockdiag:: :height: 240 A -> B; """ app.builder.build_all() source = (app.outdir / 'index.html').read_text(encoding='utf-8') self.assertRegexpMatches(source, ('
' '')) @with_svg_app def test_width_option_and_height_option_on_svg(self, app, status, warning): """ .. blockdiag:: :width: 100 :height: 200 A -> B; """ app.builder.build_all() source = (app.outdir / 'index.html').read_text(encoding='utf-8') self.assertRegexpMatches(source, ('
' '')) @with_svg_app def test_scale_option_on_svg(self, app, status, warning): """ .. blockdiag:: :scale: 25% A -> B; """ app.builder.build_all() source = (app.outdir / 'index.html').read_text(encoding='utf-8') self.assertRegexpMatches(source, ('
' '')) @with_svg_app def test_width_option_and_scale_option_on_svg(self, app, status, warning): """ .. blockdiag:: :width: 28 :scale: 25% A -> B; """ app.builder.build_all() source = (app.outdir / 'index.html').read_text(encoding='utf-8') self.assertRegexpMatches(source, ('
' '')) @with_svg_app def test_align_option_on_svg(self, app, status, warning): """ .. blockdiag:: :align: center A -> B; """ app.builder.build_all() source = (app.outdir / 'index.html').read_text(encoding='utf-8') self.assertRegexpMatches(source, '
') @with_svg_app def test_name_option_on_svg(self, app, status, warning): """ .. blockdiag:: :name: target A -> B; """ app.builder.build_all() source = (app.outdir / 'index.html').read_text(encoding='utf-8') self.assertRegexpMatches(source, '
') @with_svg_app def test_reftarget_in_href_on_svg1(self, app, status, warning): """ .. _target: heading2 --------- .. blockdiag:: A -> B; A [href = ':ref:`target`']; """ app.builder.build_all() source = (app.outdir / 'index.html').read_text(encoding='utf-8') self.assertRegexpMatches(source, '\\n\\s*\\n\\s*') @with_svg_app def test_reftarget_in_href_on_svg2(self, app, status, warning): """ .. _hello world: heading2 --------- .. blockdiag:: A -> B; A [href = ':ref:`hello world`']; """ app.builder.build_all() source = (app.outdir / 'index.html').read_text(encoding='utf-8') self.assertRegexpMatches(source, '\\n\\s*\\n\\s*') @with_svg_app def test_missing_reftarget_in_href_on_svg(self, app, status, warning): """ .. blockdiag:: A -> B; A [href = ':ref:`unknown_target`']; """ app.builder.build_all() source = (app.outdir / 'index.html').read_text(encoding='utf-8') self.assertNotRegex(source, '\\n\\s*\\n\\s*') self.assertIn('undefined label: unknown_target', warning.getvalue()) @with_svg_app def test_autoclass_should_not_effect_to_other_diagram(self, app, status, warning): """ This testcase checks that autoclass plugin is unloaded correctly (and it does not effect to other diagram). .. blockdiag:: plugin autoclass; class foo [color = red]; A_foo; .. blockdiag:: class foo [color = red]; A_foo; """ app.builder.build_all() source = (app.outdir / 'index.html').read_text(encoding='utf-8') self.assertRegexpMatches(source, ']+>A_foo') # 2nd diagram has a node labeled 'A_foo'. ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������sphinxcontrib-blockdiag-3.0.0/tests/test_latex.py���������������������������������������������������0000664�0000000�0000000�00000015534�14153137535�0022230�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- coding: utf-8 -*- import os import re from sphinx_testing import with_app import unittest CR = "\r?\n" blockdiag_fontpath = '/usr/share/fonts/truetype/ipafont/ipagp.ttf' with_png_app = with_app(srcdir='tests/docs/basic', buildername='latex', write_docstring=True, confoverrides={ 'latex_documents': [('index', 'test.tex', '', 'test', 'manual')], }) with_pdf_app = with_app(srcdir='tests/docs/basic', buildername='latex', write_docstring=True, confoverrides={ 'latex_documents': [('index', 'test.tex', '', 'test', 'manual')], 'blockdiag_latex_image_format': 'PDF', 'blockdiag_fontpath': blockdiag_fontpath, }) with_oldpdf_app = with_app(srcdir='tests/docs/basic', buildername='latex', write_docstring=True, confoverrides={ 'latex_documents': [('index', 'test.tex', '', 'test', 'manual')], 'blockdiag_tex_image_format': 'PDF', 'blockdiag_fontpath': blockdiag_fontpath, }) class TestSphinxcontribBlockdiagLatex(unittest.TestCase): @with_png_app def test_build_png_image(self, app, status, warning): """ .. blockdiag:: A -> B; """ app.builder.build_all() source = (app.outdir / 'test.tex').read_text(encoding='utf-8') self.assertRegexpMatches(source, r'\\sphinxincludegraphics{{blockdiag-.*?}.png}') @unittest.skipUnless(os.path.exists(blockdiag_fontpath), "TrueType font not found") @with_pdf_app def test_build_pdf_image1(self, app, status, warning): """ .. blockdiag:: A -> B; """ app.builder.build_all() source = (app.outdir / 'test.tex').read_text(encoding='utf-8') self.assertRegexpMatches(source, r'\\sphinxincludegraphics{{blockdiag-.*?}.pdf}') @unittest.skipUnless(os.path.exists(blockdiag_fontpath), "TrueType font not found") @with_oldpdf_app def test_build_pdf_image2(self, app, status, warning): """ .. blockdiag:: A -> B; """ app.builder.build_all() source = (app.outdir / 'test.tex').read_text(encoding='utf-8') self.assertRegexpMatches(source, r'\\sphinxincludegraphics{{blockdiag-.*?}.pdf}') @with_png_app def test_width_option(self, app, status, warning): """ .. blockdiag:: :width: 3cm A -> B; """ app.builder.build_all() source = (app.outdir / 'test.tex').read_text(encoding='utf-8') self.assertRegexpMatches(source, r'\\sphinxincludegraphics\[width=3cm\]{{blockdiag-.*?}.png}') @with_png_app def test_height_option(self, app, status, warning): """ .. blockdiag:: :height: 4cm A -> B; """ app.builder.build_all() source = (app.outdir / 'test.tex').read_text(encoding='utf-8') self.assertRegexpMatches(source, r'\\sphinxincludegraphics\[height=4cm\]{{blockdiag-.*?}.png}') @with_png_app def test_scale_option(self, app, status, warning): """ .. blockdiag:: :scale: 50% A -> B; """ app.builder.build_all() source = (app.outdir / 'test.tex').read_text(encoding='utf-8') self.assertRegexpMatches(source, r'\\sphinxincludegraphics\[scale=0.5\]{{blockdiag-.*?}.png}') @with_png_app def test_align_option_left(self, app, status, warning): """ .. blockdiag:: :align: left A -> B; """ app.builder.build_all() source = (app.outdir / 'test.tex').read_text(encoding='utf-8') self.assertRegexpMatches(source, (r'{\\sphinxincludegraphics{{blockdiag-.*?}.png}' r'\\hspace\*{\\fill}}')) @with_png_app def test_align_option_center(self, app, status, warning): """ .. blockdiag:: :align: center A -> B; """ app.builder.build_all() source = (app.outdir / 'test.tex').read_text(encoding='utf-8') self.assertRegexpMatches(source, (r'{\\hspace\*{\\fill}' r'\\sphinxincludegraphics{{blockdiag-.*?}.png}' r'\\hspace\*{\\fill}}')) @with_png_app def test_align_option_right(self, app, status, warning): """ .. blockdiag:: :align: right A -> B; """ app.builder.build_all() source = (app.outdir / 'test.tex').read_text(encoding='utf-8') self.assertRegexpMatches(source, (r'{\\hspace\*{\\fill}' r'\\sphinxincludegraphics{{blockdiag-.*?}.png}}')) @with_png_app def test_caption_option(self, app, status, warning): """ .. blockdiag:: :caption: hello world A -> B; """ app.builder.build_all() source = (app.outdir / 'test.tex').read_text(encoding='utf-8') figure = re.compile((r'\\begin{figure}\[htbp\]' + CR + r'\\centering' + CR + r'\\capstart' + CR + CR + r'\\noindent\\sphinxincludegraphics{{blockdiag-.*?}.png}' + CR + r'\\caption{hello world}\\label{\\detokenize{index:id1}}\\end{figure}'), re.DOTALL) self.assertRegexpMatches(source, figure) @with_png_app def test_caption_option_and_align_option(self, app, status, warning): """ .. blockdiag:: :align: left :caption: hello world A -> B; """ app.builder.build_all() source = (app.outdir / 'test.tex').read_text(encoding='utf-8') figure = re.compile((r'\\begin{wrapfigure}{l}{0pt}' + CR + r'\\centering' + CR + r'\\noindent\\sphinxincludegraphics{{blockdiag-.*?}.png}' + CR + r'\\caption{hello world}\\label{\\detokenize{index:id1}}\\end{wrapfigure}'), re.DOTALL) self.assertRegexpMatches(source, figure) @with_png_app def test_href(self, app, status, warning): """ .. blockdiag:: A -> B; A [href = ':ref:`target`']; """ app.builder.build_all() source = (app.outdir / 'test.tex').read_text(encoding='utf-8') self.assertRegexpMatches(source, r'\\sphinxincludegraphics{{blockdiag-.*?}.png}') ��������������������������������������������������������������������������������������������������������������������������������������������������������������������sphinxcontrib-blockdiag-3.0.0/tox.ini���������������������������������������������������������������0000664�0000000�0000000�00000001446�14153137535�0017650�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## configuration for tox ## tox automates running certain tasks within virtualenvs. The following ## tox configuration outlines a basic setup for running unit tests and ## building sphinx docs in separate virtual environments. Give it a try! [tox] envlist = py{37,38,39},blockdiag_dev [testenv] usedevelop = True deps= nose mock flake8 reportlab sphinx-testing >= 0.5.2 # for funcparserlib-1.0.0a0 pip_pre=true passenv= TRAVIS* commands= nosetests flake8 setup.py sphinxcontrib/ tests/ [testenv:blockdiag_dev] deps= {[testenv]deps} git+https://github.com/blockdiag/blockdiag [testenv:coverage] deps= {[testenv]deps} coverage coveralls commands= nosetests --with-coverage --cover-package=sphinxcontrib coveralls ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������