Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit 635ea7c

Browse files
committed
Merge branch 'tmp' of https://github.com/bjones1/RunestoneComponents into bjones1-tmp
2 parents a1219d1 + ca7486d commit 635ea7c

53 files changed

Lines changed: 199 additions & 13005 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

package.json

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,26 @@
1717
"author": "",
1818
"license": "ISC",
1919
"devDependencies": {
20-
"css-loader": "^3.6.0",
21-
"eslint": "^7.21.0",
22-
"html-loader": "^0.5.5",
23-
"style-loader": "^1.2.1",
24-
"url-loader": "^3.0.0",
25-
"webpack": "^5.24.0",
26-
"webpack-bundle-analyzer": "^4.4.0",
27-
"webpack-cli": "^4.5.0"
20+
"css-minimizer-webpack-plugin": "^3.0.0",
21+
"copy-webpack-plugin": "^8.0.0",
22+
"css-loader": "^5.0.0",
23+
"eslint": "^7.0.0",
24+
"html-loader": "^2.0.0",
25+
"html-webpack-plugin": "^5.0.0",
26+
"mini-css-extract-plugin": "^1.0.0",
27+
"style-loader": "^2.0.0",
28+
"webpack": "^5.0.0",
29+
"webpack-bundle-analyzer": "^4.0.0",
30+
"webpack-cli": "^4.0.0"
2831
},
2932
"dependencies": {
3033
"-": "0.0.1",
34+
"bootstrap": "3.4.1",
3135
"codemirror": "^5.59.4",
32-
"html-webpack-plugin": "^5.2.0",
36+
"handsontable": "7.2.2",
3337
"jexcel": "^3.9.1",
34-
"sql.js": "^1.4.0"
38+
"jquery-ui": "1.10.4",
39+
"sql.js": "1.5.0",
40+
"vega-embed": "3.14.0"
3541
}
3642
}

runestone/__init__.py

Lines changed: 9 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -40,38 +40,19 @@
4040
# normally this is just used by the `conf.py` file for building a runestone book
4141
def runestone_static_dirs():
4242
basedir = os.path.dirname(__file__)
43-
module_paths = [
44-
x for x in os.listdir(basedir) if os.path.isdir(os.path.join(basedir, x))
45-
]
4643
module_static_js = [os.path.join(basedir, "dist")]
47-
module_static_js.append(os.path.join(basedir, "common", "js"))
4844
module_static_js.append(os.path.join(basedir, "animation", "js"))
4945
module_static_js.append(os.path.join(basedir, "codelens", "js"))
5046
module_static_js.append(os.path.join(basedir, "webgldemo", "js"))
5147
module_static_js.append(os.path.join(basedir, "matrixeq", "js"))
52-
module_static_css = [os.path.join(basedir, "common", "css")]
53-
module_static_css.append(os.path.join(basedir, "codelens", "css"))
48+
module_static_css = [os.path.join(basedir, "common", "css", "sphinx")]
5449
module_static_css.append(os.path.join(basedir, "accessibility", "css"))
5550
module_static_css.append(os.path.join(basedir, "webgldemo", "css"))
5651
module_static_css.append(os.path.join(basedir, "matrixeq", "css"))
5752
module_static_css.append(os.path.join(basedir, "lp", "css"))
58-
module_static_image = [
59-
"%s/images" % os.path.join(basedir, x)
60-
for x in module_paths
61-
if os.path.exists("%s/images" % os.path.join(basedir, x))
62-
]
63-
module_static_bootstrap = [
64-
"%s/bootstrap" % os.path.join(basedir, x)
65-
for x in module_paths
66-
if os.path.exists("%s/bootstrap" % os.path.join(basedir, x))
67-
]
68-
6953
return (
7054
module_static_js
7155
+ module_static_css
72-
+ module_static_image
73-
+ module_static_bootstrap
74-
+ [os.path.join(basedir, "common/project_template/_static")]
7556
+ CodeChat.CodeToRest.html_static_path()
7657
)
7758

@@ -105,16 +86,18 @@ def setup(app):
10586
This could be expanded if there is additional initialization or customization
10687
we wanted to do for all projects.
10788
"""
108-
# Include JS produced by webpack. See `webpack static imports <webpack_static_imports>`_.
89+
# Include JS and CSS produced by webpack. See `webpack static imports <webpack_static_imports>`_.
10990
with open(pkg_resources.resource_filename("runestone", "dist/webpack_static_imports.json"), "r", encoding="utf-8") as f:
110-
_script_files = script_files + json.load(f)
91+
wb_imports = json.load(f)
92+
script_files = wb_imports["js"]
93+
_css_files = css_files + wb_imports["css"]
11194

112-
for jsfile in _script_files:
95+
for jsfile in script_files:
11396
try:
11497
app.add_autoversioned_javascript(jsfile)
11598
except ExtensionError:
11699
app.add_js_file(jsfile)
117-
for cssfile in css_files:
100+
for cssfile in _css_files:
118101
try:
119102
app.add_autoversioned_stylesheet(cssfile)
120103
except ExtensionError:
@@ -190,33 +173,10 @@ def build(options):
190173
# ----------------
191174
runestone_version = version = pkg_resources.get_distribution("runestone").version
192175

193-
script_files = [
194-
"https://cdnjs.cloudflare.com/ajax/libs/jquery.i18n/1.0.5/jquery.i18n.js",
195-
"https://cdnjs.cloudflare.com/ajax/libs/jquery.i18n/1.0.5/jquery.i18n.emitter.bidi.js",
196-
"https://cdnjs.cloudflare.com/ajax/libs/jquery.i18n/1.0.5/jquery.i18n.emitter.js",
197-
"https://cdnjs.cloudflare.com/ajax/libs/jquery.i18n/1.0.5/jquery.i18n.fallbacks.js",
198-
"https://cdnjs.cloudflare.com/ajax/libs/jquery.i18n/1.0.5/jquery.i18n.messagestore.js",
199-
"https://cdnjs.cloudflare.com/ajax/libs/jquery.i18n/1.0.5/jquery.i18n.parser.js",
200-
"https://cdnjs.cloudflare.com/ajax/libs/jquery.i18n/1.0.5/jquery.i18n.language.js",
201-
"https://cdn.jsdelivr.net/npm/vega@4.0.0-rc.2/build/vega.js",
202-
"https://cdn.jsdelivr.net/npm/vega-lite@2.5.0/build/vega-lite.js",
203-
"https://cdn.jsdelivr.net/npm/vega-embed@3.14.0/build/vega-embed.js",
204-
205-
"jquery-ui-1.10.3.custom.min.js",
206-
"bootstrap-3.4.1/js/bootstrap.min.js",
207-
"jquery-fix.js", # required by bootstrap theme
208-
"bootstrap-sphinx.js",
209-
"jquery.idle-timer.js",
210-
"presenter_mode.js",
211-
"theme.js",
212-
]
213-
214176
css_files = [
215-
"bootstrap-3.4.1/css/bootstrap.min.css",
216-
"presenter_mode.css",
217-
"jquery-ui-1.10.3.custom.min.css",
177+
# Generated from a template, so it can't be directly included in the webpack.
218178
"bootstrap-sphinx.css",
219-
"runestone-custom-sphinx-bootstrap.css?v=" + runestone_version,
179+
# Deliberately excluded, so it can be overridden by a user-supplied CSs file.
220180
"theme-overrides.css",
221181
]
222182

runestone/activecode/activecode.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,6 @@ def setup(app):
5353
app.add_config_value("activecode_hide_load_history", False, "html")
5454
app.add_config_value("wasm_uri", "/_static", "html")
5555

56-
app.add_autoversioned_javascript("jquery.highlight.js")
57-
app.add_autoversioned_javascript("sql-wasm.js") # todo: only load if we need it
58-
app.add_js_file(
59-
"https://cdn.jsdelivr.net/npm/handsontable@7.2.2/dist/handsontable.full.js"
60-
)
61-
app.add_css_file(
62-
"https://cdn.jsdelivr.net/npm/handsontable@7.2.2/dist/handsontable.full.min.css"
63-
)
64-
6556
app.add_node(ActivcodeNode, html=(visit_ac_node, depart_ac_node))
6657

6758
app.connect("doctree-resolved", process_activcode_nodes)
@@ -79,7 +70,7 @@ def setup(app):
7970
<textarea data-lang="%(language)s" id="%(divid)s_editor" %(autorun)s
8071
%(hidecode)s %(include)s %(timelimit)s %(coach)s %(codelens)s %(enabledownload)s %(chatcodes)s %(optional)s
8172
data-audio='%(ctext)s' %(sourcefile)s %(datafile)s %(stdin)s %(tie)s %(dburl)s %(nopair)s
82-
%(cargs)s %(largs)s %(rargs)s %(iargs)s %(gradebutton)s %(caption)s %(hidehistory)s %(wasmuri)s
73+
%(cargs)s %(largs)s %(rargs)s %(iargs)s %(gradebutton)s %(caption)s %(hidehistory)s %(wasmuri)s
8374
%(showlastsql)s style="visibility: hidden;">
8475
%(initialcode)s
8576
</textarea>

runestone/activecode/js/acfactory.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
TimedHTMLActiveCode,
1111
TimedSQLActiveCode,
1212
} from "./timed_activecode";
13+
import "../../common/js/jquery.highlight.js";
1314

1415
export default class ACFactory {
1516
constructor() {

runestone/activecode/js/activecode_js.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import { ActiveCode } from "./activecode.js";
2-
require("./skulpt.min.js");
3-
require("./skulpt-stdlib.js");
2+
import "./skulpt.min.js";
3+
import "./skulpt-stdlib.js";
4+
// Used by Skulpt.
5+
import embed from 'vega-embed';
6+
// Adapt for use outside webpack -- see https://github.com/vega/vega-embed.
7+
window.vegaEmbed = embed;
48

59
export default class JSActiveCode extends ActiveCode {
610
constructor(opts) {

runestone/activecode/js/activecode_sql.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { ActiveCode } from "./activecode.js";
2-
//require("sql.js");
2+
import Handsontable from "handsontable";
3+
import 'handsontable/dist/handsontable.full.css';
4+
import initSqlJs from "sql.js/dist/sql-wasm.js";
35

46
var allDburls = {};
57

runestone/common/css/jquery-ui-1.10.3.custom.min.css

Lines changed: 0 additions & 5 deletions
This file was deleted.

runestone/common/css/merge.css

Lines changed: 0 additions & 98 deletions
This file was deleted.
File renamed without changes.

runestone/common/js/jquery-fix.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)