Skip to content

Commit

Permalink
Update Jupyter Book
Browse files Browse the repository at this point in the history
  • Loading branch information
delapuente committed Mar 3, 2020
1 parent 8f21717 commit 4b314c3
Show file tree
Hide file tree
Showing 96 changed files with 848 additions and 645 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Created by https://www.gitignore.io/api/python
# Edit at https://www.gitignore.io/?templates=python

### Mac OS ###
.DS_Store

### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
33 changes: 17 additions & 16 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ GEM
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.6.0)
public_suffix (>= 2.0.2, < 4.0)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
bibtex-ruby (4.4.7)
latex-decode (~> 0.0)
citeproc (1.0.9)
Expand Down Expand Up @@ -37,19 +37,19 @@ GEM
ffi (>= 1.3.0)
eventmachine (1.2.7)
execjs (2.7.0)
faraday (0.15.4)
faraday (0.17.0)
multipart-post (>= 1.2, < 3)
ffi (1.11.1)
formatador (0.2.5)
forwardable-extended (2.6.0)
gemoji (3.0.1)
github-pages (198)
github-pages (202)
activesupport (= 4.2.11.1)
github-pages-health-check (= 1.16.1)
jekyll (= 3.8.5)
jekyll-avatar (= 0.6.0)
jekyll-coffeescript (= 1.1.1)
jekyll-commonmark-ghpages (= 0.1.5)
jekyll-commonmark-ghpages (= 0.1.6)
jekyll-default-layout (= 0.1.4)
jekyll-feed (= 0.11.0)
jekyll-gist (= 1.5.0)
Expand All @@ -60,7 +60,7 @@ GEM
jekyll-readme-index (= 0.2.0)
jekyll-redirect-from (= 0.14.0)
jekyll-relative-links (= 0.6.0)
jekyll-remote-theme (= 0.3.1)
jekyll-remote-theme (= 0.4.0)
jekyll-sass-converter (= 1.5.2)
jekyll-seo-tag (= 2.5.0)
jekyll-sitemap (= 1.2.0)
Expand All @@ -85,8 +85,8 @@ GEM
listen (= 3.1.5)
mercenary (~> 0.3)
minima (= 2.5.0)
nokogiri (>= 1.8.5, < 2.0)
rouge (= 2.2.1)
nokogiri (>= 1.10.4, < 2.0)
rouge (= 3.11.0)
terminal-table (~> 1.4)
github-pages-health-check (1.16.1)
addressable (~> 2.3)
Expand Down Expand Up @@ -140,10 +140,10 @@ GEM
jekyll-commonmark (1.3.1)
commonmarker (~> 0.14)
jekyll (>= 3.7, < 5.0)
jekyll-commonmark-ghpages (0.1.5)
jekyll-commonmark-ghpages (0.1.6)
commonmarker (~> 0.17.6)
jekyll-commonmark (~> 1)
rouge (~> 2)
jekyll-commonmark (~> 1.2)
rouge (>= 2.0, < 4.0)
jekyll-default-layout (0.1.4)
jekyll (~> 3.0)
jekyll-feed (0.11.0)
Expand All @@ -165,7 +165,8 @@ GEM
jekyll (~> 3.3)
jekyll-relative-links (0.6.0)
jekyll (~> 3.3)
jekyll-remote-theme (0.3.1)
jekyll-remote-theme (0.4.0)
addressable (~> 2.0)
jekyll (~> 3.5)
rubyzip (>= 1.2.1, < 3.0)
jekyll-sass-converter (1.5.2)
Expand Down Expand Up @@ -243,8 +244,8 @@ GEM
jekyll (~> 3.5)
jekyll-feed (~> 0.9)
jekyll-seo-tag (~> 2.1)
minitest (5.11.3)
multi_json (1.13.1)
minitest (5.13.0)
multi_json (1.14.1)
multipart-post (2.1.1)
namae (1.0.1)
nenv (0.3.0)
Expand All @@ -264,11 +265,11 @@ GEM
rb-fsevent (0.10.3)
rb-inotify (0.10.0)
ffi (~> 1.0)
rouge (2.2.1)
rouge (3.11.0)
ruby-enum (0.7.2)
i18n
ruby_dep (1.5.0)
rubyzip (1.2.3)
rubyzip (2.0.0)
safe_yaml (1.0.5)
sass (3.7.4)
sass-listen (~> 4.0.0)
Expand Down
15 changes: 8 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,12 @@ help:
@echo " clean to clean out site build files"
@echo " runall to run all notebooks in-place, capturing outputs with the notebook"
@echo " serve to serve the repository locally with Jekyll"
@echo " build to build the site HTML locally with Jekyll and store in _site/"
@echo " build to build the site HTML and store in _site/"
@echo " site to build the site HTML, store in _site/, and serve with Jekyll"


install:
# Check to see whether bundler is already installed. If not, install it.
if [ hash bundler 2>/dev/null ]; then \
gem install bundler;\
fi
bundle install
jupyter-book install ./

book:
jupyter-book build ./
Expand All @@ -30,4 +27,8 @@ serve:
bundle exec guard

build:
bash build.sh
jupyter-book build ./ --overwrite

site: build
bundle exec jekyll build
touch _site/.nojekyll
14 changes: 12 additions & 2 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ description: >- # this means to ignore newlines until "baseurl:"
baseurl: "/textbook" # the subpath of your site, e.g. /blog. If there is no subpath for your site, use an empty string ""
url: "https://community.qiskit.org" # the base hostname & protocol for your site, e.g. http://example.com
port: 80
port: 3000

#######################################################################################
# Jupyter Book settings
Expand All @@ -34,6 +34,7 @@ footer_text : This page was created by <a href="https://github.com
# Sidebar settings
show_sidebar : true # Show the sidebar. Only set to false if your only wish to host a single page.
collapse_inactive_chapters: true # Whether to collapse the inactive chapters in the sidebar
collapse_inactive_sections: true # Whether to collapse the sub-sections within a non-active section in the sidebar
textbook_logo : images/logo/logo.png # A logo to be displayed at the top of your textbook sidebar. Should be square
textbook_logo_link : https://qiskit.org/textbook # A link for the logo.
sidebar_footer_text : 'Powered by <a href="https://github.com/jupyter/jupyter-book">Jupyter Book</a>'
Expand All @@ -42,6 +43,14 @@ number_toc_chapters : true # Whether to add numbers to chapterse in your
# Search settings
search_max_words_in_content : 100 # In the search function, use at most this many words (too many words will make search slow)

# Controlling page information
page_titles : infer # Either `None`, `infer`, or `toc`
page_authors : None # Either `None` or `infer`
filename_title_split_character : '_' # If inferring titles based on filename, splt on this character.

# Math settings
number_equations : false # Whether to automatically number all block equations with MathJax

#######################################################################################
# Interact link settings

Expand Down Expand Up @@ -73,6 +82,7 @@ use_show_widgets_button : true # If 'true', display a button to al
# Download settings
use_download_button : true # If 'true', display a button to download a zip file for the notebook
download_button_text : "Download" # The text that download buttons will contain
download_page_header : "Made with Jupyter Book" # A header that will be displayed at the top of and PDF-printed page

#######################################################################################
# Jupyter book extensions and additional features
Expand Down Expand Up @@ -148,4 +158,4 @@ plugins:
- jekyll-scholar

# Jupyter Book version - DO NOT CHANGE THIS. It is generated when a new book is created
jupyter_book_version: "0.6.0"
jupyter_book_version: "0.6.4"
12 changes: 7 additions & 5 deletions _includes/buttons/download.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{% if site.use_download_button -%}
<div class="download-buttons-dropdown">
<button id="dropdown-button-trigger" class="interact-button"><i class="fa fa-download"></i></button>
<button id="dropdown-button-trigger" class="interact-button"><img src="{{ site.images_url | relative_url }}/download-solid.svg" alt="Download" /></button>
<div class="download-buttons">
{% if site.use_download_button and page.interact_link -%}
{% if page.interact_link -%}
<a href="{{ page.interact_link | relative_url }}" download>
<button id="interact-button-download" class="interact-button">ORIG</button>
<button id="interact-button-download" class="interact-button">{{ page.suffix | capitalize }}</button>
</a>
{% endif %}
<a id="interact-button-print"><button id="interact-button-download" class="interact-button">PDF</button></a>
<a id="interact-button-print"><button id="interact-button-download" class="interact-button">.pdf</button></a>
</div>
</div>
</div>
{%- endif %}
28 changes: 16 additions & 12 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
{% include metadata.json %}
</script>
<link rel="stylesheet" href="{{ site.css_url | relative_url }}/styles.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css ">

<!-- <link rel="manifest" href="/manifest.json"> -->
<!-- <link rel="mask-icon" href="/safari-pinned-tab.svg" color="#efae0a"> -->
Expand All @@ -27,9 +26,13 @@
<link rel="shortcut icon" type="image/x-icon" href="{{ site.favicon_path | relative_url }}">

<!-- MathJax Config -->
{% include js/mathjax.html %}
{% include mathjax.html %}

<!-- DOM updating function -->
{% include js/dom-update.html %}
<script src="{{ site.js_url | relative_url }}/page/dom-update.js"></script>

<!-- Selectors for elements on the page -->
<script src="{{ site.js_url | relative_url }}/page/documentSelectors.js"></script>

<!-- Define some javascript variables that will be useful in other javascript -->
<script>
Expand All @@ -38,27 +41,28 @@

<!-- Add AnchorJS to let headers be linked -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/4.2.0/anchor.min.js" async></script>
{% include js/anchors.html %}
<script src="{{ site.js_url | relative_url }}/page/anchors.js" async></script>

<!-- Include Turbolinks to make page loads fast -->
<!-- https://github.com/turbolinks/turbolinks -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/turbolinks/5.2.0/turbolinks.js" async></script>
<meta name="turbolinks-cache-control" content="no-cache">

<!-- Selectors for elements on the page -->
{% include js/documentSelectors.html %}

<!-- Load nbinteract for widgets -->
{% include js/nbinteract.html %}

<!-- Load Thebelab for interactive widgets -->
{% include js/thebelab.html %}

<!-- Load the auto-generating TOC -->
{% include js/tocbot.html %}
<!-- Load the auto-generating TOC (non-async otherwise the TOC won't load w/ turbolinks) -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/tocbot/4.8.1/tocbot.min.js" async></script>
<script src="{{ site.js_url | relative_url }}/page/tocbot.js"></script>

<!-- Google analytics -->
<script src="{{ site.js_url | relative_url }}/ga.js" async></script>
{% include google_analytics.html %}

<!-- Segment analytics -->
{% include segment.html %}

<!-- Clipboard copy button -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" async></script>
Expand All @@ -78,10 +82,10 @@
<script>{% include search/lunr/lunr-en.js %}</script>

<!-- Load JS that depends on site variables -->
{% include js/copy-button.html %}
<script src="{{ site.js_url | relative_url }}/page/copy-button.js" async></script>

<!-- Hide cell code -->
{% include js/hide-cell.html %}
<script src="{{ site.js_url | relative_url }}/page/hide-cell.js" async></script>

<!-- Printing the screen -->
{% include js/print.html %}
Expand Down
11 changes: 0 additions & 11 deletions _includes/js/anchors.html

This file was deleted.

80 changes: 0 additions & 80 deletions _includes/js/hide-cell.html

This file was deleted.

4 changes: 3 additions & 1 deletion _includes/js/print.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
printable: 'textbook_content',
type: 'html',
css: "{{ site.css_url | relative_url }}/styles.css",
style: "#textbook_content {padding-top: 40px};",
scanStyles: false,
targetStyles: ["*"],
ignoreElements: ignoreAssistList
ignoreElements: ignoreAssistList,
documentTitle: "{{ site.download_page_header }}"
})
};

Expand Down
2 changes: 1 addition & 1 deletion _includes/js/thebelab-cell-button.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

const thebelabCellButton = id =>
`<a id="thebelab-cell-button-${id}" class="btn thebebtn o-tooltip--left" data-tooltip="Interactive Mode">
<img src="{{ site.images_url | relative_url }}/edit-button.svg" alt="Start interactive mode">
<img src="{{ site.images_url | relative_url }}/edit-button.svg" alt="Start thebelab interactive mode">
</a>`


Expand Down
Loading

0 comments on commit 4b314c3

Please sign in to comment.