def prepare_builder(app): # make sure needed css styling gets included when building html builder = app.builder if not isinstance(builder, StandaloneHTMLBuilder): return value = getattr(app.config, EMBED_KEY) if value is None: value = not is_cloud_theme(app.config.html_theme) if not value: return # add custom css stylesheet name = "table_styling.css" app.add_stylesheet(name) # monkeypatch builder to copy over css file orig = builder.copy_static_files def wrapper(): orig() source = os.path.join(_root_dir, "ext", name) target = os.path.join(builder.outdir, "_static", name) copyfile(source, target) builder.copy_static_files = wrapper
def install_static_assets(app): # skip unless html builder & redirect configured helper = RedirectHelper(app) if not helper.for_html or not helper.domain_url: return # make sure JS is added if not is_cloud_theme(app.config.html_theme): add_static_file(app.builder, cloud_base_js_path, javascript=True) # make sure needed css styling gets included when building html add_static_file(app.builder, helper.css_path, stylesheet=True)
def prepare_builder(app): # make sure needed css styling gets included when building html builder = app.builder if not isinstance(builder, StandaloneHTMLBuilder): return value = getattr(app.config, EMBED_KEY) if value is None: value = not is_cloud_theme(app.config.html_theme) if not value: return # add custom css stylesheet add_static_file(builder, css_path, stylesheet=True)
keep_warnings = True issue_tracker_url = "bb:ecollins/passlib" #============================================================================= # 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 = os.environ.get("SPHINX_THEME") or 'redcloud' # 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 = {} if csp.is_cloud_theme(html_theme): html_theme_options.update( roottarget=index_doc, issueicon=None, # lighter_decor=True, borderless_decor=True, sidebarbgcolor='transparent', small_sidebar_bg_color='#EBEBEB', bodytrimcolor='transparent', max_width="12.5in", sidebarwidth="3in", large_sidebar_width="3.5in", hyphenation_language="en", # headfont='"Bitstream Vera Sans", sans-serif', colored_object_prefixes="all", # bodyfont='arial, helvetica, sans-serif',
keep_warnings = True issue_tracker_url = "gc:passlib" #============================================================================= # 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 = os.environ.get("SPHINX_THEME") or 'redcloud' # 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 = {} if csp.is_cloud_theme(html_theme): html_theme_options.update(roottarget=index_doc, issueicon=None) if 'for-pypi' in options: html_theme_options.update( googleanalytics_id = 'UA-22302196-2', googleanalytics_path = '/passlib/', ) # Add any paths that contain custom themes here, relative to this directory. html_theme_path = [csp.get_theme_dir()] # The name for this set of Sphinx documents. If None, it defaults to # "<project> v<release> documentation". html_title = "%s v%s Documentation" % (project, release) # A shorter title for the navigation bar. Default is the same as html_title.