Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble in viewing ipynb files. #88

Closed
BoPeng opened this issue Jun 20, 2018 · 9 comments
Closed

Trouble in viewing ipynb files. #88

BoPeng opened this issue Jun 20, 2018 · 9 comments

Comments

@BoPeng
Copy link
Contributor

BoPeng commented Jun 20, 2018

I have lot of analysis done in SoS saved in ipynb formats. Whenever I need to view them, I will have to start a Jupyter notebook server and open the files there, which is a lot of work.

Given that we now how a conversion mechanism (using codemirror) that can render the notebooks in their original format, it would be helpful for us to provide some way to show the ipynb report easier. Something like a shortcut to

sos convert my.ipynb /tmp/temp.html --template a_doc_template_with_toc
open /tmp/temp.html

It could be something like

sos convert my.ipynb --to-html --view

or even simpler

sos view my.ipynb
@BoPeng
Copy link
Contributor Author

BoPeng commented Jun 20, 2018

Note that currently we have

sos convert my.sos --to html --view

which converts sos to a temporary html file and view it.

@BoPeng
Copy link
Contributor Author

BoPeng commented Jun 20, 2018

OK, now that

sos convert my.ipynb --to-html --view

works, the question is whether or not we should provide a shortcut for it.

There are several possibilities:

  1. User use
alias  sosview='sos convert $1 --to html --view'
  1. We provide a dedicated command sos-viewer so that users can register it with file browser and user can double click and use sos-viewer to open ipynb file (and possibly also sos file). Under windows, we could even register the command during installation.

  2. We provide a subcommand sos view

@HenryLeongStat
Copy link
Member

That seems quite convenient! Is it all done in commandline?

Is the html file saved in tmp? Or we can choose the name and save it to anywhere?

@BoPeng
Copy link
Contributor Author

BoPeng commented Jun 20, 2018

You can choose a name and use command such as

sos convert my.ipynb my.html --view

while --view is optional.

It uses a default template without all the fancy codemirror syntax highlighting so I might add a template later.

@BoPeng
Copy link
Contributor Author

BoPeng commented Jun 20, 2018

The --to html option was used to view a temporary file and avoid saving to a perminant HTML file.

@HenryLeongStat
Copy link
Member

That's nice! With that, I can show all my work to the non-jupyter users!

Are there any other things that sos convert can do? Or it is designed for this particular function? If the later, I will vote for sos view, since it's easy to remember :D. But maybe sos convert is more clear in case users want to save the html not in tmp?

@BoPeng
Copy link
Contributor Author

BoPeng commented Jun 20, 2018

sos convert -h will show you a list of options.

@HenryLeongStat
Copy link
Member

I see. So we need to use sos convert my.ipynb --to-html to call the converter, ipynb-html.

I think it is quite clear.

@BoPeng
Copy link
Contributor Author

BoPeng commented Aug 9, 2018

Need to note that jupyter notebook file.ipynb can start a jupyter server and open file.ipynb.

@BoPeng BoPeng closed this as completed Jan 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants