Skip to content

Commit

Permalink
Enabled HTML help
Browse files Browse the repository at this point in the history
  • Loading branch information
sebasguts committed Jan 29, 2018
1 parent 5672cb2 commit 7049940
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
17 changes: 12 additions & 5 deletions jupyter_kernel_polymake/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ def _start_polymake(self):
JuPyMake.InitializePolymake()
try:
self._run_polymake_command( 'include "common::jupyter.rules";' )
self._run_polymake_command( 'require Polymake::Core::HelpAsHTML;' )
except PolymakeRunException:
return
return
Expand Down Expand Up @@ -239,8 +240,14 @@ def do_inspect( self, code, cursor_pos, detail_level=0 ):
try:
output = JuPyMake.GetContextHelp( input=code, position=cursor_pos, full=full )
except PolymakeRunException:
return {'status': 'ok', 'data': {}, 'metadata': {}, 'found': False}
if output == '':
return {'status': 'ok', 'data': {}, 'metadata': {}, 'found': False}
else:
return {'status': 'ok', 'data': { 'text/plain': "\n".join(output) }, 'metadata': {}, 'found': True}
output = []
try:
output_html = JuPyMake.GetContextHelp( input=code, position=cursor_pos, full=full, html=True )
except PolymakeRunException:
output_html = []
output_data = { }
if output != []:
output_data['text/plain'] = "\n".join(output)
if output_html != []:
output_data['text/html'] = "\n".join(output_html)
return {'status': 'ok', 'data': output_data, 'metadata': {}, 'found': True}
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def main(argv=None):


setup( name="jupyter_kernel_polymake"
, version="0.15"
, version="0.16"
, description="A Jupyter kernel for polymake"
, author="Sebastian Gutsche"
, author_email="[email protected]"
Expand Down

0 comments on commit 7049940

Please sign in to comment.