Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add first version of the github page #43

Open
wants to merge 2 commits into
base: gh-pages
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Python CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-python/ for more details
#
version: 2
jobs:
build:
branches:
ignore:
- /gh-pages.*/
71 changes: 71 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">

<title>Shublang - Examples</title>
</head>
<body>
<h1>Shublang</h1>
<h2>Try it out!</h2>
<script type="text/javascript">
// set the pyodide files URL (packages.json, pyodide.asm.data etc)
window.languagePluginUrl = 'pyodide/pyodide.js';
</script>
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
<script src="pyodide/pyodide.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>

<div class="container">
<div class="row">
<div class="col">
<input class="form-control" id="expression">
</div>
</div>
<div class="row">
<div class="col">
<textarea class="form-control" id="data" type="text"></textarea>
</div>
<div class="col">
<textarea class="form-control" id="output" type="text" readonly></textarea>
</div>
</div>
<div class="row">
<div class="col">
<button id="run" type="button" class="btn btn-primary">Run!</button>
</div>
</div>
</div>
<script type="text/javascript">
jQuery(document).ready(function(){
// Init fields
$("#expression").val('sanitize | where (lambda x: x!="") | concat (">")')
$("#data").val('["this", "\tis", " \t", "a", "test"]')

languagePluginLoader.then(function () {
pyodide.loadPackage("shublang").then(() => {
function run() {
expression = $("#expression").val()
data = $("#data").val()
code = [
"from shublang import *",
"data = ".concat(data),
"data | ".concat(expression)
]
output = pyodide.runPython(code.join('\n'))
$("#output").val(output)
}
run()
$("#run").click(run)
});
});
});
</script>
</body>
</html>
Binary file added pyodide/Jinja2.data
Binary file not shown.
1 change: 1 addition & 0 deletions pyodide/Jinja2.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added pyodide/MarkupSafe.data
Binary file not shown.
Loading