Permalink
Browse files

add custom index.html, app.js fr, stencila example

- index.html is a copy of stencila/dist/example.html with updated urls
- app.js is a copy of stencila/dist/app.js with vfs removed
  • Loading branch information...
minrk committed May 10, 2018
1 parent e31336d commit 0bcbf63a6f47b5f67aace7f15d7bce89c9eff6d3
Showing with 37 additions and 3 deletions.
  1. +16 −0 app.js
  2. +20 −0 index.html
  3. +1 −3 stencila.js
16 app.js
@@ -0,0 +1,16 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('substance'), require('substance-texture'), require('stencila')) :
typeof define === 'function' && define.amd ? define(['substance', 'substance-texture', 'stencila'], factory) :
(factory(global.window.substance,global.window.texture,global.window.stencila));
}(this, (function (substance,substanceTexture,stencila) { 'use strict';

window.addEventListener('load', () => {
substance.substanceGlobals.DEBUG_RENDERING = substance.platform.devtools;
stencila.StencilaWebApp.mount({
archiveId: substance.getQueryStringParam('archive') || 'manuscript',
storageType: substance.getQueryStringParam('storage') || 'fs',
storageUrl: substance.getQueryStringParam('storageUrl') || '/archives'
}, window.document.body);
});

})));
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Stencila Project</title>
<link rel="stylesheet" type="text/css" href="./node_modules/stencila/dist/stencila.css">
<script type="text/javascript" src="./node_modules/stencila/dist/katex/katex.min.js"></script>
<script type="text/javascript" src="./node_modules/stencila/dist/lib/plotly.min.js"></script>
<script type="text/javascript" src="./node_modules/stencila/dist/lib/substance.js"></script>
<script type="text/javascript" src="./node_modules/stencila/dist/lib/texture.js"></script>
<script type="text/javascript" src="./node_modules/stencila/dist/lib/stencila-mini.js"></script>
<script type="text/javascript" src="./node_modules/stencila/dist/lib/stencila-envcore.min.js"></script>
<script type="text/javascript" src="./node_modules/stencila/dist/lib/stencila-libcore.min.js"></script>
<script type="text/javascript" src="./node_modules/stencila/dist/stencila.js"></script>
<script type="text/javascript" src="./node_modules/stencila/dist/vfs.js"></script>
<script type="text/javascript" src="./node_modules/stencila/dist/env.js"></script>
<script type="text/javascript" src="./node_modules/stencila/dist/app.js"></script>
</head>
<body></body>
</html>
@@ -14,9 +14,7 @@ darServer.serve(server, {
apiUrl: "/archives"
});

var staticDir = path.resolve(
path.join(__dirname, "node_modules", "stencila", "dist")
);
var staticDir = __dirname;

console.log("Stencila app root: %s", staticDir);
console.log("DAR archive path: %s", archiveDir);

0 comments on commit 0bcbf63

Please sign in to comment.