Skip to content

Commit

Permalink
Move template files to templates directory under source #89
Browse files Browse the repository at this point in the history
  • Loading branch information
Bo Peng committed Jun 20, 2018
1 parent 0ff92c1 commit 5b43833
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/sos_notebook/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,12 +390,10 @@ def notebook_to_html(notebook_file, output_file, sargs=None, unknown_args=None):
import os
if unknown_args is None:
unknown_args = []
if sargs.template and sargs.template.startswith('sos') and not os.path.isfile(sargs.template):
# use the default sos template
unknown_args = ['--template', os.path.join(os.path.split(__file__)[0], sargs.template + (
'' if sargs.template.endswith('.tpl') else '.tpl'))] + unknown_args
elif sargs.template:
unknown_args = ['--template', sargs.template] + unknown_args
if sargs.template:
sos_template = os.path.join(os.path.split(os.path.abspath(__file__))[0],
'templates', sargs.template + ('' if sargs.template.endswith('.tpl') else '.tpl'))
unknown_args = ['--template', sos_template if os.path.isfile(sos_template) else sargs.template] + unknown_args
export_notebook(HTMLExporter, 'html', notebook_file, output_file, unknown_args, view=sargs.view)


Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 5b43833

Please sign in to comment.