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

Refactor build_html_site.py #149

Open
ehmatthes opened this issue Jun 11, 2017 · 0 comments
Open

Refactor build_html_site.py #149

ehmatthes opened this issue Jun 11, 2017 · 0 comments

Comments

@ehmatthes
Copy link
Owner

The script can certainly be cleaned up. Some improvements would be in-script refactoring work, some would involve modifying notebooks and templates.

  • Instead of manually specifying which notebooks get show/hide all output buttons, either set a notebook metadata property and check for that in the template, or examine the notebook and look for any output blocks. If no output blocks, don't include the show/hide all output buttons. (See Only place show/hide all output buttons on notebooks with output blocks #148)
  • Approach to deleting and rebuilding html_site/ has five levels of nesting. That can be simplified or refactored into functions.
  • The script currently calls nbconvert from the command line from within a python script. I did this because I first learned to use nbconvert from the command line. Since we're using a python script, it would be better to use nbconvert as a library. See here. This might reduce the need for separate files like scripts/my_config.py, and would eliminate the use of environment variables.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant