summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--public/js/slide.js73
-rw-r--r--public/views/slide.ejs38
-rw-r--r--webpack.config.js8
3 files changed, 84 insertions, 35 deletions
diff --git a/public/js/slide.js b/public/js/slide.js
index 5b0f9bd0..b5aa868f 100644
--- a/public/js/slide.js
+++ b/public/js/slide.js
@@ -1,3 +1,76 @@
+require('bootstrap');
+require('bootstrap/js/tooltip');
+require('bootstrap/dist/css/bootstrap.css');
+
+require('prismjs/themes/prism.css');
+require('highlight.js/styles/github-gist.css');
+
+require('markdown-it');
+require('markdown-it-abbr');
+require('markdown-it-footnote');
+require('markdown-it-deflist');
+require('markdown-it-mark');
+require('markdown-it-ins');
+require('markdown-it-sub');
+require('markdown-it-sup');
+require('markdown-it-container');
+require('markdown-it-mathjax');
+require('markdown-it-regexp');
+require('markdown-it-imsize');
+
+/* other vendors plugin */
+require('gist-embed');
+var S = require('string');
+require('highlight.js');
+require('prismjs');
+require('prismjs/components/prism-wiki');
+require('js-cookie');
+require('to-markdown');
+
+require('raphael');
+require('js-sequence-diagrams');
+
+require('flowchart.js');
+require('viz.js');
+require('file-saver');
+require('store');
+require('js-url');
+require('visibilityjs');
+require('list.js');
+require('../vendor/md-toc');
+require('randomcolor');
+
+var commonModule = require('./common');
+var urlpath = commonModule.urlpath;
+var noteid = commonModule.noteid;
+var debug = commonModule.debug;
+var version = commonModule.version;
+var serverurl = commonModule.serverurl;
+var GOOGLE_API_KEY = commonModule.GOOGLE_API_KEY;
+var GOOGLE_CLIENT_ID = commonModule.GOOGLE_CLIENT_ID;
+var DROPBOX_APP_KEY = commonModule.DROPBOX_APP_KEY;
+var noteurl = commonModule.noteurl;
+
+var extraModule = require('./extra');
+var md = extraModule.md;
+var createtime = extraModule.createtime;
+var updateLastChange = extraModule.updateLastChange;
+var postProcess = extraModule.postProcess;
+var finishView = extraModule.finishView;
+var lastchangetime = extraModule.lastchangetime;
+var lastchangeui = extraModule.lastchangeui;
+var autoLinkify = extraModule.autoLinkify;
+var generateToc = extraModule.generateToc;
+var smoothHashScroll = extraModule.smoothHashScroll;
+var lastchangeuser = extraModule.lastchangeuser;
+var deduplicatedHeaderId = extraModule.deduplicatedHeaderId;
+var renderTOC = extraModule.renderTOC;
+var renderTitle = extraModule.renderTitle;
+var renderFilename = extraModule.renderFilename;
+var scrollToHash = extraModule.scrollToHash;
+
+var render = require('./render');
+
var body = $(".slides").html();
$(".slides").html(S(body).unescapeHTML().s);
diff --git a/public/views/slide.ejs b/public/views/slide.ejs
index 3c5498c6..1549989f 100644
--- a/public/views/slide.ejs
+++ b/public/views/slide.ejs
@@ -88,46 +88,18 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/mermaid/6.0.0/mermaid.min.js" defer></script>
<% } else { %>
<script src="<%- url %>/vendor/jquery/dist/jquery.min.js"></script>
+ <script src="<%- url %>/vendor/reveal.js/lib/js/head.min.js"></script>
+ <script src="<%- url %>/vendor/reveal.js/js/reveal.js"></script>
<script src="<%- url %>/vendor/velocity/velocity.min.js" defer></script>
<script src="<%- url %>/vendor/js-yaml/dist/js-yaml.min.js" defer></script>
<script type="text/javascript" src="<%- url %>/vendor/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML" defer></script>
<script src="<%- url %>/vendor/moment/min/moment-with-locales.js" defer></script>
<script src="<%- url %>/vendor/mermaid/dist/mermaid.min.js" defer></script>
<% } %>
- <script src="<%- url %>/vendor/bootstrap/tooltip.min.js"></script>
- <script src="<%- url %>/vendor/reveal.js/lib/js/head.min.js"></script>
- <script src="<%- url %>/vendor/reveal.js/js/reveal.js"></script>
<script src="<%- url %>/vendor/xss/dist/xss.min.js" defer></script>
- <script src="<%- url %>/vendor/markdown-it/dist/markdown-it.min.js" defer></script>
- <script src="<%- url %>/vendor/markdown-it-abbr/dist/markdown-it-abbr.min.js" defer></script>
- <script src="<%- url %>/vendor/markdown-it-footnote/dist/markdown-it-footnote.min.js" defer></script>
- <script src="<%- url %>/vendor/markdown-it-deflist/dist/markdown-it-deflist.min.js" defer></script>
- <script src="<%- url %>/vendor/markdown-it-mark/dist/markdown-it-mark.min.js" defer></script>
- <script src="<%- url %>/vendor/markdown-it-ins/dist/markdown-it-ins.min.js" defer></script>
- <script src="<%- url %>/vendor/markdown-it-sub/dist/markdown-it-sub.min.js" defer></script>
- <script src="<%- url %>/vendor/markdown-it-sup/dist/markdown-it-sup.min.js" defer></script>
- <script src="<%- url %>/vendor/markdown-it-container/dist/markdown-it-container.min.js" defer></script>
- <script src="<%- url %>/vendor/markdown-it-mathjax.js" defer></script>
- <script src="<%- url %>/vendor/markdown-it-regexp.js" defer></script>
- <script src="<%- url %>/vendor/markdown-it-imsize.js" defer></script>
- <script src="<%- url %>/vendor/gist-embed/gist-embed.min.js" defer></script>
- <script src="<%- url %>/vendor/string/dist/string.min.js" defer></script>
- <script src="<%- url %>/vendor/highlightjs/highlight.pack.min.js" defer></script>
- <script src="<%- url %>/vendor/js-cookie/src/js.cookie.js" defer></script>
- <script src="<%- url %>/vendor/emojify/js/emojify.min.js" defer></script>
- <script src="<%- url %>/vendor/raphael/raphael.min.js" defer></script>
- <script src="<%- url %>/vendor/lodash/dist/lodash.min.js" defer></script>
- <script src="<%- url %>/vendor/sequence-diagrams/sequence-diagram-min.js" defer></script>
- <script src="<%- url %>/vendor/flowchart/release/flowchart.min.js" defer></script>
- <script src="<%- url %>/vendor/viz.js/viz.js" defer></script>
- <script src="<%- url %>/vendor/pdfobject/pdfobject.min.js" defer></script>
- <script src="<%- url %>/vendor/md-toc.js" defer></script>
- <script src="<%- url %>/js/common.js" defer></script>
- <script src="<%- url %>/js/extra.js" defer></script>
- <script src="<%- url %>/js/render.js" defer></script>
- <script src="<%- url %>/js/slide.js" defer></script>
-
+ <script src="<%- url %>/build/slide.js" defer></script>
+
</body>
</html>
-<%- include ga %> \ No newline at end of file
+<%- include ga %>
diff --git a/webpack.config.js b/webpack.config.js
index ee2abc73..17e05226 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -26,7 +26,8 @@ module.exports = {
entry: {
index: path.join(__dirname, 'public/js/index.js'),
- public: path.join(__dirname, 'public/js/public.js')
+ public: path.join(__dirname, 'public/js/public.js'),
+ slide: path.join(__dirname, 'public/js/slide.js')
},
output: {
@@ -52,10 +53,13 @@ module.exports = {
}, {
test: /\.css$/,
loader: ExtractTextPlugin.extract('style-loader', 'css-loader')
- }, , {
+ }, {
test: /\.scss$/,
loader: ExtractTextPlugin.extract('style-loader', 'sass-loader')
}, {
+ test: /\.less$/,
+ loader: ExtractTextPlugin.extract('style-loader', 'less-loader')
+ }, {
test: require.resolve("js-sequence-diagrams"),
loader: "imports?Raphael=raphael"
}, {