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

A plugin to hide the input cells #298

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions v8/hide_input_cells/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This plugin hides the input cells from the html file which was generated from a jupyter notebook.
12 changes: 12 additions & 0 deletions v8/hide_input_cells/hide_input_cells.plugin
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Core]
Name = hide_input_cells
Module = hide_input_cells

[Nikola]
PluginCategory = ConfigPlugin
MinVersion = 7.1.0+

[Documentation]
Author = Surya Sankar
Version = 0.0.1
Description = Hide all input cells
20 changes: 20 additions & 0 deletions v8/hide_input_cells/hide_input_cells.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from __future__ import unicode_literals
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We recommend adding a license snippet to all plugins.

from nikola.plugin_categories import ConfigPlugin


class HideInputCells(ConfigPlugin):
def set_site(self, site):
site.template_hooks['extra_head'].append(
"""
<!--Code inserted by HideInputCells -->
<style type="text/css">
div.input {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those selectors feel too wide, are you sure you can’t use something that would only work on Jupyter notebooks and not all potential div.inputs and div.prompts out there?

display: none;
}
div.prompt {
display: none;
}
</style>
"""
)
return super(HideInputCells, self).set_site(site)