conf.py (3927B)
1 #!/usr/bin/env python3 2 # -*- coding: utf-8 -*- 3 # 4 # html5lib documentation build configuration file, created by 5 # sphinx-quickstart on Wed May 8 00:04:49 2013. 6 # 7 # This file is execfile()d with the current directory set to its containing dir. 8 # 9 # Note that not all possible configuration values are present in this 10 # autogenerated file. 11 # 12 # All configuration values have a default; values that are commented out 13 # serve to show the default. 14 15 import sys 16 import os 17 18 # -- General configuration ----------------------------------------------------- 19 20 # Add any Sphinx extension module names here, as strings. They can be extensions 21 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. 22 extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.viewcode'] 23 24 # Add any paths that contain templates here, relative to this directory. 25 templates_path = ['_templates'] 26 27 # The suffix of source filenames. 28 source_suffix = '.rst' 29 30 # The master toctree document. 31 master_doc = 'index' 32 33 # General information about the project. 34 project = 'html5lib' 35 copyright = '2006 - 2013, James Graham, Sam Sneddon, and contributors' 36 37 # The version info for the project you're documenting, acts as replacement for 38 # |version| and |release|, also used in various other places throughout the 39 # built documents. 40 # 41 # The short X.Y version. 42 version = '1.0' 43 # The full version, including alpha/beta/rc tags. 44 sys.path.append(os.path.abspath('..')) 45 from html5lib import __version__ # noqa 46 release = __version__ 47 48 # List of patterns, relative to source directory, that match files and 49 # directories to ignore when looking for source files. 50 exclude_patterns = ['_build', 'theme'] 51 52 # The name of the Pygments (syntax highlighting) style to use. 53 pygments_style = 'sphinx' 54 55 # -- Options for HTML output --------------------------------------------------- 56 57 # The theme to use for HTML and HTML Help pages. See the documentation for 58 # a list of builtin themes. 59 html_theme = 'default' 60 61 # Output file base name for HTML help builder. 62 htmlhelp_basename = 'html5libdoc' 63 64 65 # -- Options for LaTeX output -------------------------------------------------- 66 67 # Grouping the document tree into LaTeX files. List of tuples 68 # (source start file, target name, title, author, documentclass [howto/manual]). 69 latex_documents = [ 70 ('index', 'html5lib.tex', 'html5lib Documentation', 71 'James Graham, Sam Sneddon, and contributors', 'manual'), 72 ] 73 74 # -- Options for manual page output -------------------------------------------- 75 76 # One entry per manual page. List of tuples 77 # (source start file, name, description, authors, manual section). 78 man_pages = [ 79 ('index', 'html5lib', 'html5lib Documentation', 80 ['James Graham, Sam Sneddon, and contributors'], 1) 81 ] 82 83 # -- Options for Texinfo output ------------------------------------------------ 84 85 # Grouping the document tree into Texinfo files. List of tuples 86 # (source start file, target name, title, author, 87 # dir menu entry, description, category) 88 texinfo_documents = [ 89 ('index', 'html5lib', 'html5lib Documentation', 90 'James Graham, Sam Sneddon, and contributors', 'html5lib', 'One line description of project.', 91 'Miscellaneous'), 92 ] 93 94 95 class CExtMock(object): 96 """Required for autodoc on readthedocs.org where you cannot build C extensions.""" 97 def __init__(self, *args, **kwargs): 98 pass 99 100 def __call__(self, *args, **kwargs): 101 return CExtMock() 102 103 @classmethod 104 def __getattr__(cls, name): 105 if name in ('__file__', '__path__'): 106 return '/dev/null' 107 else: 108 return CExtMock() 109 110 111 try: 112 import lxml # noqa 113 except ImportError: 114 sys.modules['lxml'] = CExtMock() 115 sys.modules['lxml.etree'] = CExtMock() 116 print("warning: lxml modules mocked.") 117 118 try: 119 import genshi # noqa 120 except ImportError: 121 sys.modules['genshi'] = CExtMock() 122 sys.modules['genshi.core'] = CExtMock() 123 print("warning: genshi modules mocked.")