Exemple #1
0
def build_notebooks_markdown():
    # Get a list of all treleases from github
    notebooks_releases = get_menpo_releases()
    notebooks_versions = [release['tag_name'] for release in notebooks_releases]

    # For every folder we found, walk through it and build a landing page
    # for all the notebooks in that version
    for version in notebooks_versions:
        print('Found a version of the notebooks at: {}'.format(version))

    # Build the landing page for ALL the versions (so you can choose a version
    # to view)
    # Get the most recent tag
    latest_version = notebooks_versions.pop(0)

    all_landing_tmplt = env.get_template(nb_all_tmplt_path)
    all_landing_output = all_landing_tmplt.render(
        previous_versions=notebooks_versions,
        latest_version=latest_version)
    with open(op.join(pages_path, 'notebooks.md'), 'w') as f:
        f.write(all_landing_output)
Exemple #2
0
def build_notebooks_markdown():
    # Get a list of all releases from github
    # menpodetect currently doesn't have any notebooks so we omit them here
    projects = ['menpo', 'menpofit']
    releases = {
            'menpo': get_menpo_releases(),
            'menpofit': get_menpofit_releases(),
            'menpodetect': get_menpodetect_releases(),
            'menpo3d': get_menpo3d_releases()
            }
    previous_versions = {}
    latest_versions = {}
    for p, rs in releases.items():
        all_versions = [r['tag_name'] for r in rs]
        latest_versions[p] = all_versions[0]
        previous_versions[p] = all_versions[1:]

    all_landing_tmplt = env.get_template(nb_all_tmplt_path)
    all_landing_output = all_landing_tmplt.render(
        projects=projects,
        previous_versions=previous_versions,
        latest_versions=latest_versions)
    with open(op.join(pages_path, 'notebooks.md'), 'w') as f:
        f.write(all_landing_output)
Exemple #3
0
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
import sys
import os

# Add path above so we can access latest release version
sys.path.insert(0, os.path.abspath('..'))

from releases import get_menpo_releases
LATEST_RELEASE = get_menpo_releases()[0]['tag_name']

# Avoid having hard coded paths to these files
THEME = '../themes/zurb-F5-basic'

AUTHOR = u'Patrick Snape'
SITENAME = u'menpo'
SITEURL = u'http://menpo.io'

TIMEZONE = 'Europe/London'

DEFAULT_LANG = u'en'

# Feed generation is usually not desired when developing
FEED_ALL_ATOM = None
CATEGORY_FEED_ATOM = None
TRANSLATION_FEED_ATOM = None

# Blogroll
LINKS = ()
Exemple #4
0
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
import sys
import os

# Add path above so we can access latest release version
script_path = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, script_path)
sys.path.insert(0, os.path.abspath(os.path.join(script_path, '..')))

from releases import (get_menpo_releases, get_menpo3d_releases,
                      get_menpodetect_releases, get_menpofit_releases)
LATEST_MENPO_RELEASE = get_menpo_releases()[0][u'tag_name']
LATEST_MENPO3D_RELEASE = get_menpo3d_releases()[0][u'tag_name']
LATEST_MENPODETECT_RELEASE = get_menpodetect_releases()[0][u'tag_name']
LATEST_MENPOFIT_RELEASE = get_menpofit_releases()[0][u'tag_name']

# Avoid having hard coded paths to these files
THEME = u'../themes/zurb-F5-basic'

AUTHOR = u'Patrick Snape'
SITENAME = u'The Menpo Project'
SITEURL = u'http://menpo.org'

TIMEZONE = u'Europe/London'

DEFAULT_LANG = u'en'

# Feed generation is usually not desired when developing
FEED_ALL_ATOM = None