Skip to content

Commit

Permalink
refactoring files
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas-schwenk committed Feb 17, 2024
1 parent c5da0c4 commit d011584
Show file tree
Hide file tree
Showing 19 changed files with 33 additions and 73 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.DS_Store
node_modules/
package-lock.json
dist/
web/node_modules/
web/package-lock.json
web/dist/
examples/*.json
examples/*.html
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"name": "test index.html",
"request": "launch",
"type": "chrome",
"url": "http://localhost:5501",
"url": "http://localhost:5501/web/",
"webRoot": "${workspaceFolder}"
},
{
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# pySELL

Re-implementation of the essentials of the Simple E-Learning Language (SELL) for Longevity.
The Python based Simple E-Learning Language (SELL).

Push interactive STEM tasks to the web.

<!--Re-implementation of the essentials of the Simple E-Learning Language (SELL) for Longevity.-->

## Dependencies

Expand All @@ -20,7 +24,7 @@ _A short developer guide can be found at the end of this document._

The following example code generates some questions, as seen in the figure and available for testing [here](https://andreas-schwenk.github.io/pysell/ex1.html).

![](docs/example.png)
![](docs/example.jpg)

Command:

Expand Down
17 changes: 17 additions & 0 deletions build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"""
This script is only intended for pySELL development.
Users just use file 'sell.py'
"""

import subprocess

try:
res = subprocess.run(["npm", "install"], cwd="web")
res = subprocess.run(["node", "build.js"], cwd="web")
except Exception as e:
print(e)
print("pySELL dependencies: npm+nodejs")
print(" https://www.npmjs.com, https://nodejs.org/")
print(" https://nodejs.org/en/download/package-manager")
print("[Debian] sudo apt install nodejs npm")
print("[macOS] brew install node")
Binary file added docs/example.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/example.png
Binary file not shown.
65 changes: 0 additions & 65 deletions examples/ex2.txt

This file was deleted.

4 changes: 3 additions & 1 deletion sell.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env python3

"""SELL - Simple E-Learning Language
"""
pySELL - Python based Simple E-Learning Language
Push interactive STEM tasks to the web
AUTHOR: Andreas Schwenk <mailto:[email protected]>
LICENSE: GPLv3
"""
Expand Down
2 changes: 2 additions & 0 deletions build.js → web/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ esbuild.buildSync({
outfile: "dist/sell.min.js",
});

process.exit(0);

// build html template and update sell.py
let lines = fs.readFileSync("index.html", "utf-8").split("\n");
let js = fs.readFileSync("dist/sell.min.js", "utf-8").trim();
Expand Down
2 changes: 1 addition & 1 deletion index.html → web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ <h1 id="debug" class="debugCode" style="display: none">DEBUG VERSION</h1>
import { init } from "./src/index.js";
// create json file via
// python3 sell.py -J examples/ex1.txt
fetch("examples/ex1.json?v=" + Date.now())
fetch("../examples/ex1.json?v=" + Date.now())
.then((data) => data.json())
.then((quizSrc) => {
let debug = true;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit d011584

Please sign in to comment.