ipypublish.port_api.plugin_to_json module

a module to convert between the old (Python script) plugin format, and the new (JSON) one

ipypublish.port_api.plugin_to_json.ast_to_json(item, imported, assignments)[source]

recursively convert ast items to json friendly values

ipypublish.port_api.plugin_to_json.convert_config(config, exporter_class, allow_other)[source]

convert config into required exporter format

ipypublish.port_api.plugin_to_json.convert_dict(dct, imported, assignments)[source]

recurse through and replace keys

ipypublish.port_api.plugin_to_json.convert_to_json(path, outpath=None, ignore_other=False)[source]

Set docstring here.

  • path (str) – input module path

  • outpath=None (str or None) – if set, output json to this path

  • ignore_other (bool) – whether to ignore arguments in config, which do not relate to preprocessors

ipypublish.port_api.plugin_to_json.create_json(docstring, imported, assignments, allow_other=True)[source]

Set docstring here.

  • docstring (str) – the doc string of the module

  • imported (dict) – imported classes

  • assignments (dict) – assigned values (i.e. ‘a = b’)

  • allow_other (bool) – whether to allow arguments in config, which do not relate to preprocessors


replace original template path with new dict