Skip to content

Commit

Permalink
Adding bundled/minimized/offline package version
Browse files Browse the repository at this point in the history
  • Loading branch information
haf committed Nov 9, 2016
1 parent 37471e9 commit b1579ba
Show file tree
Hide file tree
Showing 14 changed files with 3,388 additions and 87 deletions.
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
root = true

[*]
end_of_line = lf
charset = utf-8

[*.{fs,fsi,fsx,js,html,css}]
charset = utf-8
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = false

[{package.json,.travis.yml}]
indent_style = space
indent_size = 2
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -189,3 +189,5 @@ src/reveal.js
docs/tools/FSharp.Formatting.svclog
FSharp.Formatting.svclog
_NCrunch*
node_modules/
dist/
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.7.10
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,12 @@ _Inspried by two great works:_
- [1st sample](http://kimsk.github.io/fsreveal-sample-fsx/FsReveal.html#/) generated from [FsReveal.fsx](https://github.com/kimsk/fsreveal-sample-fsx/blob/master/slides/FsReveal.fsx)
- [2nd sample](http://kimsk.github.io/fsreveal-sample-md/FsReveal.html#/) generated from [FsReveal.md](https://github.com/kimsk/fsreveal-sample-md/blob/master/slides/FsReveal.md) ([raw](https://raw.githubusercontent.com/kimsk/fsreveal-sample-md/master/slides/FsReveal.md))

### Dev

```
pyenv local 2.7.10
# npm install -g yarn
yarn install --ignore-engines
```

Source code is in `./src/FsReveal`. Built with `FAKE` and `yarn` (in turn uses `webpack`).
2 changes: 1 addition & 1 deletion lib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Any **libraries** on which your project depends and which are **NOT managed via
This typically includes custom builds of third-party software, private (i.e. to a company) codebases, and native libraries.

---
NOTE:
NOTE:

This file is a placeholder, used to preserve directory structure in Git.

Expand Down
41 changes: 41 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "fsreveal",
"version": "1.4.0",
"description": "FsReveal parses markdown or F# script files and generates reveal.js slides.",
"main": "index.js",
"repository": {
"url": "https://github.com/fsprojects/FsReveal/",
"type": "git"
},
"author": "Karlkim Suwamongkol <[email protected]>, Troy Kershaw, Steffen Forkmann <[email protected]>",
"license": "MIT",
"dependencies": {
"babel-core": "^6.18.2",
"babel-loader": "^6.2.7",
"babel-preset-es2015": "^6.18.0",
"babel-runtime": "^6.18.0",
"exports-loader": "^0.6.3",
"expose-loader": "^0.7.1",
"file-loader": "^0.9.0",
"highlight.js": "^9.8.0",
"html-loader": "^0.4.4",
"html-webpack-plugin": "^2.24.1",
"imports-loader": "^0.6.5",
"mathjax": "^2.7.0",
"offline-plugin": "^3.4.2",
"raw-loader": "^0.5.1",
"style-loader": "^0.13.1",
"url-loader": "^0.5.7",
"webpack": "^1.13.3"
},
"engines": {
"node": ">=6.9.1"
},
"scripts": {
"watch": "webpack -p --display-modules --progress --colors --watch",
"build": "webpack -p --display-modules --progress --colors"
},
"devDependencies": {
"babel-plugin-transform-runtime": "^6.15.0"
}
}
8 changes: 0 additions & 8 deletions src/FsReveal/FsReveal.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFSharpCoreVersion>4.3.0.0</TargetFSharpCoreVersion>
<Name>FsReveal</Name>
<TargetFrameworkProfile />
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
Expand Down Expand Up @@ -50,13 +49,6 @@
</Otherwise>
</Choose>
<Import Project="$(FSharpTargetsPath)" Condition="Exists('$(FSharpTargetsPath)')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<ItemGroup>
<Compile Include="Domain.fs" />
<Compile Include="Misc.fs" />
Expand Down
8 changes: 8 additions & 0 deletions src/FsReveal/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

{
"name": "FsReveal presentation",
"start_url": "index.html",
"display": "standalone",
"orientation": "portrait",
"background_color": "#FFFFFF"
}
5 changes: 5 additions & 0 deletions src/FsReveal/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": {
"css-loader": "^0.25.0"
}
}
88 changes: 10 additions & 78 deletions src/FsReveal/template.html
Original file line number Diff line number Diff line change
@@ -1,89 +1,21 @@
<!doctype html>
<!doctype html>
<html lang="en">
<head>
<head>
<meta charset="utf-8">
<title>{title}</title>
<meta name="description" content="{description}">
<meta name="author" content="{author}">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<script src="//code.jquery.com/jquery-1.8.0.js"></script>
<script src="//code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<script type="text/javascript" src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet">
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/theme/{theme}.css" id="theme">
<link type="text/css" rel="stylesheet" href="fsharp.formatting/styles/style.css" />
<link type="text/css" rel="stylesheet" href="fsharp.formatting/styles/deedle.css" />
<link type="text/css" rel="stylesheet" href="css/custom.css" />
<script src="fsharp.formatting/styles/tips.js" type="text/javascript"></script>
<!-- For syntax highlighting -->
<link rel="stylesheet" href="lib/css/zenburn.css">
<link rel="stylesheet" href="css/fsreveal.css">
<!-- If the query includes 'print-pdf', include the PDF print sheet -->
<script>
if( window.location.search.match( /print-pdf/gi ) ) {
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = 'css/print/pdf.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
}
</script>
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
<script language="javascript" type="text/javascript">
function init()
{
websocket = new WebSocket("ws://"+window.location.host+"/websocket");
websocket.onmessage = function(evt) { location.reload(); };
}
window.addEventListener("load", init, false);
</script>
</head>
<body>
</head>
<body>
<div class="reveal">
{tooltips}
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
{slides}
</div>
{tooltips}
<div class="slides">
{slides}
</div>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.js"></script>
<script>
// Add the nohighlight class and data-noescape attribute to code elements that have already been formatted by FSharp.Formatting
$('pre.highlighted code').addClass('nohighlight').attr('data-noescape', '');

// Full list of configuration options available here:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: true,
center: true,

transition: '{transition}', // default/cube/page/concave/zoom/linear/fade/none

// Parallax scrolling
// parallaxBackgroundImage: 'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg',
// parallaxBackgroundSize: '2100px 900px',

// Optional libraries used to extend on reveal.js
dependencies: [
{ src: 'lib/js/classList.js', condition: function () { return !document.body.classList; } },
{ src: 'plugin/markdown/marked.js', condition: function () { return !!document.querySelector('[data-markdown]'); } },
{ src: 'plugin/markdown/markdown.js', condition: function () { return !!document.querySelector('[data-markdown]'); } },
{ src: 'plugin/highlight/highlight.js', async: true, callback: function () { hljs.initHighlightingOnLoad(); } },
{ src: 'plugin/zoom-js/zoom.js', async: true, condition: function () { return !!document.body.classList; } },
{ src: 'plugin/notes/notes.js', async: true, condition: function () { return !!document.body.classList; } }
]
});

</script>
</body>
</html>

</body>
</html>
55 changes: 55 additions & 0 deletions src/FsReveal/template.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import 'mathjax';
import '../../paket-files/fsprojects/reveal.js/css/reveal.css';
import '../../paket-files/fsprojects/reveal.js/lib/css/zenburn.css';
import './style.css';
import './deedle.css';
import './tips.js';
//import 'file?name=[name].[ext]!./favicon.ico';
import '!file?name=[name].[ext]!./manifest.json';

// Reveal stuff
import 'expose?Reveal!imports?define=>null!../../paket-files/fsprojects/reveal.js/js/reveal.js';
import '!file?name=plugin/markdown/[name].[ext]!../../paket-files/fsprojects/reveal.js/plugin/markdown/marked.js';
import '!file?name=plugin/markdown/[name].[ext]!../../paket-files/fsprojects/reveal.js/plugin/markdown/markdown.js';
import '!file?name=plugin/zoom-js/[name].[ext]!../../paket-files/fsprojects/reveal.js/plugin/zoom-js/zoom.js';
import '!file?name=plugin/notes/[name].[ext]!../../paket-files/fsprojects/reveal.js/plugin/notes/notes.js';
import hljs from 'highlight.js';

// If the query includes 'print-pdf', include the PDF print sheet
if (window.location.search.match( /print-pdf/gi)) {
require('../../paket-files/fsprojects/reveal.js/css/reveal.css');
}

function init() {
const websocket = new WebSocket(`ws://${window.location.host}/websocket`);
websocket.onmessage = function(evt) { location.reload(); };
}
window.addEventListener("load", init, false);

// Add the nohighlight class and data-noescape attribute to code elements that have already been formatted by FSharp.Formatting
document.querySelectorAll('pre.highlighted code').forEach(el => {
el.classList.add('nohighlight');
el.setAttribute('data-noescape', '');
});

function reveal() {
hljs.initHighlightingOnLoad(); // from expose?hljs

// Full list of configuration options available here:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: true,
center: true,
transition: 'default', // default/cube/page/concave/zoom/linear/fade/none
// Parallax scrolling
// parallaxBackgroundImage: 'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg',
// parallaxBackgroundSize: '2100px 900px',
});
}
window.addEventListener("load", reveal, false);

if (process.env.NODE_ENV === 'production') {
require('offline-plugin/runtime').install(); // eslint-disable-line global-require
}
Loading

0 comments on commit b1579ba

Please sign in to comment.