예제 #1
0
def setup(app):
    app.add_stylesheet('bootstrap_sandstone.css')
    app.add_stylesheet('astropy.css')  # may also be an URL

# -- Run and convert the notebook files to RST --------------------------------

_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
_scripts_path = os.path.join(_root, 'scripts')
if _scripts_path not in sys.path:
    sys.path.insert(1, _scripts_path)

from convert import process_notebooks
nb_tutorials_path = os.path.join(_root, 'tutorials', 'notebooks')
template_path = os.path.join(_root, 'tutorials', 'astropy.tpl')
rst_output_path = os.path.join(_root, 'tutorials', 'rst-tutorials')

processkwargs = dict(output_path=rst_output_path, template_file=template_path)
if os.environ.get('NBCONVERT_KERNEL'):  # this allows access from "make html"
    processkwargs['kernel_name'] = os.environ.get('NBCONVERT_KERNEL')

if os.environ.get('NBFILE'):  # this allows only building a single tutorial file
    nb_tutorials_path = os.path.abspath(os.environ.get('NBFILE'))

process_notebooks(nb_tutorials_path, **processkwargs)


suppress_warnings = ['image.nonlocal_uri']
html_static_path = ['notebooks', '_static']
html_static_path = [os.path.join(_root, 'tutorials', x)
                    for x in html_static_path] # make absolute paths
예제 #2
0
    app.add_stylesheet('astropy.css')  # may also be an URL


# -- Run and convert the notebook files to RST --------------------------------

_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
_scripts_path = os.path.join(_root, 'scripts')
if _scripts_path not in sys.path:
    sys.path.insert(1, _scripts_path)

from convert import process_notebooks
nb_tutorials_path = os.path.join(_root, 'tutorials', 'notebooks')
template_path = os.path.join(_root, 'tutorials', 'astropy.tpl')
rst_output_path = os.path.join(_root, 'tutorials', 'rst-tutorials')

processkwargs = dict(output_path=rst_output_path, template_file=template_path)
if os.environ.get('NBCONVERT_KERNEL'):  # this allows access from "make html"
    processkwargs['kernel_name'] = os.environ.get('NBCONVERT_KERNEL')

if os.environ.get(
        'NBFILE'):  # this allows only building a single tutorial file
    nb_tutorials_path = os.path.abspath(os.environ.get('NBFILE'))

process_notebooks(nb_tutorials_path, **processkwargs)

suppress_warnings = ['image.nonlocal_uri']
html_static_path = ['notebooks', '_static']
html_static_path = [
    os.path.join(_root, 'tutorials', x) for x in html_static_path
]  # make absolute paths
예제 #3
0
# -- Options for manual page output -------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [('index', project.lower(), project + u' Documentation',
              [author], 1)]


# -- Resolving issue number to links in changelog -----------------------------
github_issues_url = 'https://github.com/{0}/issues/'.format(setup_cfg['github_project'])


# -- Run and convert the notebook files to RST --------------------------------

_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
_scripts_path = os.path.join(_root, 'scripts')
if _scripts_path not in sys.path:
    sys.path.insert(1, _scripts_path)

from convert import process_notebooks
nb_tutorials_path = os.path.join(_root, 'tutorials', 'notebooks')
template_path = os.path.join(_root, 'tutorials', 'astropy.tpl')
rst_output_path = os.path.join(_root, 'tutorials', 'rst-tutorials')
process_notebooks(nb_tutorials_path, output_path=rst_output_path,
                  template_file=template_path)


suppress_warnings = ['image.nonlocal_uri']
html_static_path = ['notebooks', '_static']