-
Notifications
You must be signed in to change notification settings - Fork 663
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HTML build step
- Loading branch information
Showing
16 changed files
with
139 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
jupyter_book/book_template/_includes/js/documentSelectors.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<script> | ||
/** | ||
* Select various elements on the page for later use | ||
*/ | ||
|
||
// IDs we'll attach to cells | ||
const codeCellId = index => `codecell${index}` | ||
const inputCellId = index => `inputcell${index}` | ||
|
||
pageElements = {} | ||
|
||
// All code cells | ||
findCodeCells = function() { | ||
var codeCells = document.querySelectorAll('div.c-textbook__content > div.highlighter-rouge > div.highlight > pre, div.input_area pre, div.text_cell_render div.highlight pre') | ||
pageElements['codeCells'] = codeCells; | ||
|
||
codeCells.forEach((codeCell, index) => { | ||
const id = codeCellId(index) | ||
codeCell.setAttribute('id', id) | ||
}) | ||
}; | ||
|
||
initFunction(findCodeCells); | ||
|
||
|
||
findInputCells = function() { | ||
var inputCells = document.querySelectorAll('div.jb_input') | ||
pageElements['inputCells'] = inputCells; | ||
|
||
inputCells.forEach((inputCell, index) => { | ||
const id = inputCellId(index) | ||
inputCell.setAttribute('id', id) | ||
}) | ||
}; | ||
|
||
initFunction(findInputCells); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -148,3 +148,4 @@ highlightRightSidebar = function() { | |
}; | ||
|
||
initFunction(highlightRightSidebar); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -291,5 +291,5 @@ | |
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
"nbformat_minor": 4 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{% extends 'basic.tpl' %} | ||
|
||
{% block codecell %} | ||
{% if 'remove_cell' not in cell.metadata.tags and 'removecell' not in cell.metadata.tags %} | ||
{{ super() }} | ||
{% endif %} | ||
{%- endblock codecell %} | ||
|
||
{% block markdowncell %} | ||
{% if 'remove_cell' not in cell.metadata.tags and 'removecell' not in cell.metadata.tags %} | ||
{{ super() }} | ||
{% endif %} | ||
{%- endblock markdowncell %} | ||
|
||
<!-- Remove input cells if they're empty. Same as nbconvert basic w/ the extra class --> | ||
{% block input_group %} | ||
{%- if 'remove_input' not in cell.metadata.tags %} | ||
{%- if cell.source != '' %} | ||
<div class="jb_input{% if 'hide_input' in cell.metadata.tags or 'hidecode' in cell.metadata.tags %} hidecode{% endif %}" > | ||
{{ super() }} | ||
</div> | ||
{% endif %} | ||
{% endif %} | ||
{% endblock input_group %} | ||
|
||
|
||
{% block output %} | ||
<div class="jb_output_wrapper{% if 'interactive' in cell.metadata.tags %} output_widget_view{% endif %}"> | ||
{{- super() -}} | ||
</div> | ||
{%- endblock output %} |
Oops, something went wrong.