element.
- # For black navbar, do "navbar navbar-inverse"
- "navbar_class": "navbar",
- # Fix navigation bar to top of page?
- # Values: "true" (default) or "false"
- "navbar_fixed_top": "true",
- # Location of link to source.
- # Options are "nav" (default), "footer" or anything else to exclude.
- "source_link_position": "nav",
- # Bootswatch (http://bootswatch.com/) theme.
- #
- # Options are nothing with "" (default) or the name of a valid theme
- # such as "amelia" or "cosmo".
- #
- # Note that this is served off CDN, so won't be available offline.
- #'bootswatch_theme': "slate",
-}
-
-# html_style = "style.css"
-
-# Add any paths that contain custom themes here, relative to this directory.
-html_theme_path = [
- pkg_resources.resource_filename(
- "runestone", "common/project_template/_templates/plugin_layouts"
- )
-]
-
-
-# The name for this set of Sphinx documents. If None, it defaults to
-# "
v documentation".
-html_title = "Runestone Interactive Overview"
-
-# A shorter title for the navigation bar. Default is the same as html_title.
-html_short_title = "Runestone Interactive Overview"
-
-# The name of an image file (relative to this directory) to place at the top
-# of the sidebar.
-
-# logo is included in layout file
-# html_logo = "../source/_static/logo_small.png"
-
-# The name of an image file (within the static path) to use as favicon of the
-# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
-# pixels large.
-# html_favicon = None
-
-# Add any paths that contain custom static files (such as style sheets) here,
-# relative to this directory. They are copied after the builtin static files,
-# so a file named "default.css" will overwrite the builtin "default.css".
-
-html_static_path = ["_sources/_static"] + runestone_static_dirs()
-
-# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
-# using the given strftime format.
-# html_last_updated_fmt = '%b %d, %Y'
-
-# If true, SmartyPants will be used to convert quotes and dashes to
-# typographically correct entities.
-# html_use_smartypants = True
-
-# Custom sidebar templates, maps document names to template names.
-# html_sidebars = {}
-
-# Additional templates that should be rendered to pages, maps page names to
-# template names.
-# html_additional_pages = {}
-
-# If false, no module index is generated.
-# html_domain_indices = True
-
-# If false, no index is generated.
-# html_use_index = True
-
-# If true, the index is split into individual pages for each letter.
-# html_split_index = False
-
-# If true, links to the reST sources are added to the pages.
-html_show_sourcelink = False
-
-# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
-# html_show_sphinx = True
-
-# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
-# html_show_copyright = True
-
-# If true, an OpenSearch description file will be output, and all pages will
-# contain a tag referring to it. The value of this option must be the
-# base URL from which the finished HTML is served.
-# html_use_opensearch = ''
-
-# This is the file name suffix for HTML files (e.g. ".xhtml").
-# html_file_suffix = None
-
-# Output file base name for HTML help builder.
-htmlhelp_basename = "PythonCoursewareProjectdoc"
diff --git a/runestone/cellbotics/test/pavement.py b/runestone/cellbotics/test/pavement.py
deleted file mode 100644
index 4718b255d..000000000
--- a/runestone/cellbotics/test/pavement.py
+++ /dev/null
@@ -1,54 +0,0 @@
-import paver
-from paver.easy import *
-import paver.setuputils
-
-paver.setuputils.install_distutils_tasks()
-import os, sys
-from runestone.server import get_dburl
-from sphinxcontrib import paverutils
-import pkg_resources
-
-sys.path.append(os.getcwd())
-
-home_dir = os.getcwd()
-master_url = "http://127.0.0.1:8000"
-master_app = "runestone"
-serving_dir = "./build/activecodetest"
-dest = "./static"
-
-options(
- sphinx=Bunch(docroot="."),
- build=Bunch(
- builddir="./build/activecodetest",
- sourcedir="_sources",
- outdir="./build/activecodetest",
- confdir=".",
- quiet=True,
- project_name="activecodetest",
- template_args={
- "course_id": "activecodetest",
- "login_required": "false",
- "appname": master_app,
- "loglevel": 0,
- "course_url": master_url,
- "use_services": "false",
- "python3": "true",
- "dburl": "",
- "downloads_enabled": "true",
- "enable_chatcodes": "false",
- "allow_pairs": "false",
- "basecourse": "activecodetest",
- "jobe_server": "http://jobe2.cosc.canterbury.ac.nz",
- "proxy_uri_runs": "/jobe/index.php/restapi/runs/",
- "proxy_uri_files": "/jobe/index.php/restapi/files/",
- },
- ),
-)
-
-version = pkg_resources.require("runestone")[0].version
-options.build.template_args["runestone_version"] = version
-
-# If DBURL is in the environment override dburl
-options.build.template_args["dburl"] = get_dburl(outer=locals())
-
-from runestone import build # build is called implicitly by the paver driver.
diff --git a/runestone/cellbotics/test/test_cellbotics.py b/runestone/cellbotics/test/test_cellbotics.py
deleted file mode 100644
index 68db3e50d..000000000
--- a/runestone/cellbotics/test/test_cellbotics.py
+++ /dev/null
@@ -1,23 +0,0 @@
-# ****************************************************
-# |docname| - Basic tests for the Cellbotics component
-# ****************************************************
-from selenium.webdriver.support import expected_conditions as EC
-from selenium.webdriver.common.by import By
-
-
-def test_1(selenium_utils_get):
- """
- #. Get the outer div id of the activecode component
- #. Find the run button using its class name
- #. Run the example
- #. Check the output from the ac_output element
- """
- div_id = "test_cellbotics_1"
- selenium_utils_get.wait_until_ready(div_id)
- t1 = selenium_utils_get.driver.find_element_by_id(div_id)
- rb = t1.find_element_by_class_name("run-button")
- rb.click()
- selenium_utils_get.wait.until(
- EC.text_to_be_present_in_element((By.ID, f"{div_id}_stdout"), "Pass."),
- message="Did not find expected text",
- )
diff --git a/runestone/cellbotics/test/toctree.rst b/runestone/cellbotics/test/toctree.rst
deleted file mode 100644
index f4d893c12..000000000
--- a/runestone/cellbotics/test/toctree.rst
+++ /dev/null
@@ -1,23 +0,0 @@
-.. Copyright (C) 2012-2020 Bryan A. Jones.
-
- This file is part of CellBotics.
-
- CellBotics is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
-
- CellBotics is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along with CellBotics. If not, see .
-
-************
-Unit testing
-************
-This directory contains basic units tests for the Cellbotics extension.
-
-.. toctree::
- :maxdepth: 2
-
- test_cellbotics.py
- _sources/index
- __init__.py
- conf.py
- pavement.py
diff --git a/runestone/cellbotics/toctree.rst b/runestone/cellbotics/toctree.rst
deleted file mode 100644
index f211161b1..000000000
--- a/runestone/cellbotics/toctree.rst
+++ /dev/null
@@ -1,25 +0,0 @@
-.. Copyright (C) 2012-2020 Bryan A. Jones.
-
- This file is part of CellBotics.
-
- CellBotics is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
-
- CellBotics is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along with CellBotics. If not, see .
-
-**********
-Cellbotics
-**********
-This directory contains files to explore interfacing with a CellBot via BLE and for interfacing with sensors available on many smart devices. A Python wrapper for these classes is available in the Skuplt standard library as ``cellbotics``.
-
-.. toctree::
- :maxdepth: 2
-
- __init__.py
- js/ble.js
- js/simple_sensor.js
- js/permissions_polyfill.js
- js/auto-bind.js
- js/sensor_polyfill/toctree
- test/toctree
diff --git a/runestone/codelens/js/codelens.js b/runestone/codelens/js/codelens.js
index 36f4be5e7..494571c02 100644
--- a/runestone/codelens/js/codelens.js
+++ b/runestone/codelens/js/codelens.js
@@ -49,7 +49,7 @@ if (typeof allVsualizers === "undefined") {
window.allVisualizers = [];
}
-$(function () {
+$(document).ready(function () {
if (typeof allTraceData !== "undefined") {
for (let divid in allTraceData) {
let cl = document.getElementById(divid);
@@ -69,7 +69,7 @@ $(function () {
console.log(err);
}
}
- window.addEventListener("codelens:answer", function (evt) {
+ document.addEventListener("codelens:answer", function (evt) {
let rb = new RunestoneBase();
rb.logBookEvent({
event: "codelens",
diff --git a/runestone/common/css/runestone-custom-sphinx-bootstrap.css b/runestone/common/css/runestone-custom-sphinx-bootstrap.css
index 9f6ee71d7..ec0637600 100644
--- a/runestone/common/css/runestone-custom-sphinx-bootstrap.css
+++ b/runestone/common/css/runestone-custom-sphinx-bootstrap.css
@@ -194,6 +194,7 @@ a {
/* Remove top padding when top navbar goes collapsed in narrow viewports */
body {
padding-top: 0;
+ margin: auto auto auto 5px;
}
.navbar-fixed-top {
@@ -203,15 +204,12 @@ a {
}
@media (min-width: 768px) {
+
/* when navbar is collapsed we don't want any vertical dividers taking up space */
.navbar .divider-vertical {
margin: 0 3px;
border-left: 1px solid #f2f2f2;
}
-
- .navbar-fixed-top .container {
- padding: 0;
- }
}
div.container {
@@ -224,8 +222,8 @@ div.section {
}
.container {
- padding-left: 10px;
- padding-right: 10px;
+ padding-left: 0;
+ padding-right: 0;
}
.container .section>*:not(.section):not(.ac_section) {
@@ -256,11 +254,6 @@ div.section {
max-width: none;
}
-.container-fluid>.navbar-collapse, .container-fluid>.navbar-header, .container>.navbar-collapse, .container>.navbar-header {
- margin-left: 0;
- margin-right: 0;
-}
-
.navbar>.container .navbar-brand {
margin-left: 0;
}
@@ -269,10 +262,6 @@ div.section {
background-color: var(--navbar);
}
-.navbar-toggle {
- margin-right: 0px;
-}
-
.footer>.container {
background-color: var(--outerBackground);
}
@@ -284,11 +273,10 @@ div.section {
.brand-logo {
float: left;
display: block;
- margin-top: 4px;
-}
-
-.brand-logo img {
+ background-size: 40px 40px !important;
+ width: 40px;
height: 40px;
+ margin-top: 4px;
}
.social-menu {
@@ -671,7 +659,6 @@ div.flash {
display: inline;
bottom: 65px;
position: fixed;
- opacity: 0.4;
}
.navLink:hover {
@@ -705,9 +692,9 @@ div.flash {
@media (max-width: 600px) {
.navLink {
- display: inline-block;
- bottom: auto;
- position: absolute;
+ z-index: 2;
+ display: inline;
+ position: static;
}
#relations-next,
@@ -718,6 +705,10 @@ div.flash {
}
}
+.navLink a {
+ color: #999;
+}
+
#completionButton {
margin-top: 25px;
margin-bottom: 15px;
@@ -937,14 +928,9 @@ textarea#lp-result {
#scprogresscontainer {
- width: 100%;
- max-width: 500px;
- margin: 10px auto;
-}
-
-#subchapterprogress.ui-progressbar .ui-progressbar-value {
- margin: 0;
- border-radius: 0px;
+ width: 50%;
+ margin-left: auto;
+ margin-right: auto;
}
#subchapterprogress>div {
@@ -990,11 +976,11 @@ body {
.theme-switch-wrapper {
display: flex;
align-items: center;
-}
-.theme-switch-wrapper em {
- margin-left: 10px;
- font-size: 1rem;
+ em {
+ margin-left: 10px;
+ font-size: 1rem;
+ }
}
.theme-switch {
diff --git a/runestone/common/css/sphinx/theme-overrides.css b/runestone/common/css/sphinx/theme-overrides.css
new file mode 100644
index 000000000..f25ea1935
--- /dev/null
+++ b/runestone/common/css/sphinx/theme-overrides.css
@@ -0,0 +1,5 @@
+/*
+This file is intentionally blank - it is included as the last css file in the runestone theme
+so that books can provide a theme-overrides.css file in their _static directory to override
+any default style
+*/
\ No newline at end of file
diff --git a/runestone/common/js/bookfuncs.js b/runestone/common/js/bookfuncs.js
index 32d758cbe..977c4f775 100644
--- a/runestone/common/js/bookfuncs.js
+++ b/runestone/common/js/bookfuncs.js
@@ -29,6 +29,47 @@
*/
+//
+// Chevron functions - Must correspond with width in runestone-custom-sphinx-bootstrap.css
+//
+$(function () {
+ var resizeWindow = false;
+ var resizeWidth = 600;
+ $(window)
+ .on("resize", function (event) {
+ if ($(window).width() <= resizeWidth && resizeWindow == false) {
+ resizeWindow = true;
+ var topPrev = $("#relations-prev")
+ .clone()
+ .attr("id", "top-relations-prev");
+ var topNext = $("#relations-next")
+ .clone()
+ .attr("id", "top-relations-next");
+ $("#relations-prev, #relations-next").hide();
+ var bottomPrev = topPrev
+ .clone()
+ .attr("id", "bottom-relations-prev");
+ var bottomNext = topNext
+ .clone()
+ .attr("id", "bottom-relations-next");
+ $("div#main-content > div").prepend(topPrev, topNext);
+ $("#top-relations-prev, #top-relations-next").wrapAll(
+ ''
+ );
+ $("div#main-content > div").append(bottomPrev, bottomNext);
+ $("#bottom-relations-prev, #bottom-relations-next").wrapAll(
+ ''
+ );
+ }
+ if ($(window).width() >= resizeWidth + 1 && resizeWindow == true) {
+ resizeWindow = false;
+ $("#top-relations-console, #bottom-relations-console").remove();
+ $("#relations-prev, #relations-next").show();
+ }
+ })
+ .resize();
+});
+
//
// Page decoration functions
//
@@ -222,7 +263,7 @@ function notifyRunestoneComponents() {
}
// initialize stuff
-$(function () {
+$(document).ready(function () {
if (eBookConfig) {
handlePageSetup();
} else {
@@ -236,7 +277,7 @@ $(function () {
// misc stuff
// todo: This could be further distributed but making a video.js file just for one function seems dumb.
-window.addEventListener("load", function () {
+$(document).ready(function () {
// add the video play button overlay image
$(".video-play-overlay").each(function () {
$(this).css(
diff --git a/runestone/common/js/presenter_mode.js b/runestone/common/js/presenter_mode.js
index 24eb20c70..761dd6131 100644
--- a/runestone/common/js/presenter_mode.js
+++ b/runestone/common/js/presenter_mode.js
@@ -211,6 +211,7 @@ function configureCodelens() {
}
}
+//$(document).ready(configure);
$(document).bind("runestone:login-complete", function () {
// if user is instructor, enable presenter mode
if (eBookConfig.isInstructor) {
diff --git a/runestone/common/project_template/_sources/index.rst b/runestone/common/project_template/_sources/index.rst
index 140294d92..e9f9c40b6 100644
--- a/runestone/common/project_template/_sources/index.rst
+++ b/runestone/common/project_template/_sources/index.rst
@@ -84,14 +84,16 @@ Now feel free to modify this file to start creating your own interactive page.
Section 4: Theme
:::::::::::::::::::
-You can add your own CSS or JS files to every page of a book by modifying ``setup.custom_css_files`` or ``setup.custom_js_files`` in conf.py.
+You can override the style rules in the default theme by adding css rules to a file named **theme-overrides.css** (the filename is important - this will replace an existing file). Make sure the file's directory is part of the ``html_static_path``. You can do so by placing it in a folder **_static**, then modifying ``html_static_path`` in conf.py to include that folder:
+
+.. code::
+
+ html_static_path = runestone_static_dirs() + ['_static']
-If you want to do more significant changes to the theme, you should copy the files you wish to modify from
-the runestone/common/project/template/sphinx_bootstrap to a directory like ``_templates/``. Then make sure
-the ``templates_path`` points to them in your conf.py.
-conf.py:
+If you want to do more significant changes to the theme, you should copy the files in the runestone/common/project/template/sphinx_bootstrap to a directory like ``_templates/my_theme``. Then make sure these values are set in conf.py:
.. code::
- templates_path = ["_templates"]
\ No newline at end of file
+ html_theme_path = ["_templates"]
+ html_theme = 'my_theme'
\ No newline at end of file
diff --git a/runestone/common/project_template/_templates/plugin_layouts/sphinx_bootstrap/layout.html b/runestone/common/project_template/_templates/plugin_layouts/sphinx_bootstrap/layout.html
index 844e89673..82e4dd689 100644
--- a/runestone/common/project_template/_templates/plugin_layouts/sphinx_bootstrap/layout.html
+++ b/runestone/common/project_template/_templates/plugin_layouts/sphinx_bootstrap/layout.html
@@ -32,18 +32,17 @@