示例#1
0
 def _compile_string(self, nb_json):
     """Export notebooks as HTML strings."""
     self._req_missing_ipynb()
     c = Config(self.site.config['IPYNB_CONFIG'])
     c.update(get_default_jupyter_config())
     exportHtml = HTMLExporter(config=c)
     body, _ = exportHtml.from_notebook_node(nb_json)
     return body
示例#2
0
 def __init__(self, data=[], config=None, **kwargs):
     """"""
     config = Config()  #config=config)
     config.update(**kwargs)
     super(TreeChart, self).__init__(config=config, **kwargs)
     self.opt = {}
     self.data = data
     self.init_classes()
示例#3
0
 def _compile_string(self, nb_json):
     """Export notebooks as HTML strings."""
     self._req_missing_ipynb()
     c = Config(self.site.config['IPYNB_CONFIG'])
     c.update(get_default_jupyter_config())
     exportHtml = HTMLExporter(config=c)
     body, _ = exportHtml.from_notebook_node(nb_json)
     return body
示例#4
0
    def __init__(self, data=data, config={}, **kwargs):
        """"""
        config = Config(config)
        config.update(**kwargs)
        super(TreeChart, self).__init__(config=config, **kwargs)

        self.data = data
        self.init_classes()
示例#5
0
文件: ipynb.py 项目: evgeni/nikola
 def _compile_string(self, nb_json):
     """Export notebooks as HTML strings."""
     if flag is None:
         req_missing(['ipython[notebook]>=2.0.0'], 'build this site (compile ipynb)')
     c = Config(self.site.config['IPYNB_CONFIG'])
     c.update(get_default_jupyter_config())
     exportHtml = HTMLExporter(config=c)
     body, _ = exportHtml.from_notebook_node(nb_json)
     return body
示例#6
0
文件: ipynb.py 项目: humitos/nikola
 def _compile_string(self, nb_json):
     """Export notebooks as HTML strings."""
     self._req_missing_ipynb()
     c = Config(self.site.config['IPYNB_CONFIG'])
     c.update(get_default_jupyter_config())
     if 'template_file' not in self.site.config['IPYNB_CONFIG'].get('Exporter', {}):
         c['Exporter']['template_file'] = 'basic.tpl'  # not a typo
     exportHtml = HTMLExporter(config=c)
     body, _ = exportHtml.from_notebook_node(nb_json)
     return body
示例#7
0
 def _compile_string(self, nb_json):
     """Export notebooks as HTML strings."""
     self._req_missing_ipynb()
     c = Config(self.site.config['IPYNB_CONFIG'])
     c.update(get_default_jupyter_config())
     if 'template_file' not in self.site.config['IPYNB_CONFIG'].get(
             'Exporter', {}):
         c['Exporter']['template_file'] = 'basic.tpl'  # not a typo
     exportHtml = HTMLExporter(config=c)
     body, _ = exportHtml.from_notebook_node(nb_json)
     return body