Пример #1
0
import nbformat
from nbformat import v4 as current
from traitlets.config import Config
from nbconvert import HTMLExporter, NotebookExporter
from nbconvert.filters.markdown import markdown2html_pandoc

import bs4

try:
    os.environ['PYTHONPATH'] = os.environ['PYTHONPATH'] + ':./code'
except KeyError:
    os.environ['PYTHONPATH'] = './code'

from holoviews.plotting import Renderer
hvjs = Renderer.html_assets(extras=False)[0]

path = os.path.dirname(os.path.realpath(__file__))
cfg = Config({
    'HTMLExporter': {
        'template_file': 'no_code',
        'template_path': ['.', path],
        'filters': {
            'markdown2html': markdown2html_pandoc
        }
    }
})
exportHtml = HTMLExporter(config=cfg)

cfg = Config({
    'NotebookExporter': {
Пример #2
0
import nbformat
from nbformat import v4 as current
from traitlets.config import Config
from nbconvert import HTMLExporter
from nbconvert.filters.markdown import markdown2html_pandoc

import bs4

try:
    os.environ['PYTHONPATH'] = os.environ['PYTHONPATH'] + ':./code'
except KeyError:
    os.environ['PYTHONPATH'] = './code'

from holoviews.plotting import Renderer
hvjs = Renderer.html_assets(extras=False)[0]

path = os.path.dirname(os.path.realpath(__file__))
cfg = Config({'HTMLExporter':{'template_file':'no_code',
                              'template_path':['.',path],
                              'filters':{'markdown2html':
                                         markdown2html_pandoc}}})
exportHtml = HTMLExporter(config=cfg)

with open('scripts/release_dates') as f:
    release_dates = eval(f.read())


def date_to_edx(date, add_days=0):
    tmp = strptime(date, '%d %b %Y')
Пример #3
0
 def test_renderer_encode_unicode_types(self):
     mime_types = ['image/svg+xml', 'text/html', 'text/json']
     for mime in mime_types:
         info = {'mime_type': mime}
         encoded = Renderer.encode(('Testing «ταБЬℓσ»: 1<2 & 4+1>3', info))
         self.assertTrue(isinstance(encoded, bytes))
Пример #4
0
 def test_renderer_encode_unicode_types(self):
     mime_types = ['image/svg+xml', 'text/html', 'text/json']
     for mime in mime_types:
         info = {'mime_type': mime}
         encoded = Renderer.encode(('Testing «ταБЬℓσ»: 1<2 & 4+1>3', info))
         self.assertTrue(isinstance(encoded, bytes))