How to use the nbsite.__version__ function in nbsite

To help you get started, we’ve selected a few nbsite examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pyviz-dev / nbsite / nbsite / cmd.py View on Github external
else:
            if _is_root(dirname(rst),paths['doc']):
                title = project_name
            else:
                title = _filepath2pretitle(rst,paths['doc'])
            title = _to_title(title, apply_title_case=True)

        if os.path.exists(rst):
            if not overwrite:
                print("...skipping %s"%rst)
                continue

        print("...writing %s"%rst)
        with open(rst, 'w') as rst_file:
            import nbsite
            rst_file.write('..\n   Originally generated by nbsite (%s):\n     %s\n   Will not subsequently be overwritten by nbsite, so can be edited.\n\n'%(nbsite.__version__,' '.join(sys.argv)))
            rst_file.write('*'*len(title)+'\n')
            rst_file.write(title+'\n')
            rst_file.write('*'*len(title)+'\n\n')

            if nblink in ['top', 'both']:
                add_nblink(rst_file, host, org, repo, branch, examples, relpath)
                rst_file.write('\n\n-------\n\n')

            rst_file.write(".. notebook:: %s %s" % (project_name,os.path.relpath(paths['examples'],start=dirname(rst))+'/'+relpath+"\n"))
            rst_file.write("    :offset: %s\n" % offset)

            if pretitle=='index':
                rst_file.write("%s\n"%_toctree(dirname(filename), paths['examples'], keep_numbers))
            if nblink in ['bottom', 'both']:
                rst_file.write('\n\n-------\n\n')
                add_nblink(rst_file, host, org, repo, branch, examples, relpath)
github pyviz-dev / nbsite / doc / conf.py View on Github external
# -*- coding: utf-8 -*-

from nbsite.shared_conf import *

NAME = 'nbsite'
DESCRIPTION = 'Build a tested, sphinx-based website from notebooks.'

project = NAME
authors = u'PyViz Developers'
copyright = u'2018-2019 ' + authors
description = DESCRIPTION

import nbsite
version = release = nbsite.__version__

html_static_path += ['_static']
html_theme = 'sphinx_holoviz_theme'
html_theme_options = {
    'custom_css': 'site.css',
    'logo': 'nbsite-logo.png',
    'favicon': 'favicon.ico',
    'primary_color': '#F16A25',
    'primary_color_dark': '#B5501C',
    'secondary_color': '#F5C33C',
    'second_nav': False,
}

_NAV = (
    ('Usage', 'Usage'),
    ('Gallery', 'gallery'),