Skip to content
Snippets Groups Projects
Commit 7104aef2 authored by Henrik Tramberend's avatar Henrik Tramberend
Browse files

Remove dependency on unix package

parent 00c12e96
No related branches found
No related tags found
No related merge requests found
Showing
with 358 additions and 46 deletions
......@@ -98,6 +98,7 @@ main = do
priority 2 $ "//*-deck.pdf" %> \out -> do
let src = replaceSuffix "-deck.pdf" "-deck.html" out
need [src]
putNormal $ src ++ " -> " ++ out
runHttpServer publicDir False
code <- cmd "decktape.sh reveal" ("http://localhost:8888" </> (makeRelative publicDir src)) out
......
<!DOCTYPE html>
<html$if(lang)$ lang="$lang$"$endif$>
<head>
<meta charset="utf-8">
<meta name="generator" content="pandoc">
$for(author-meta)$
<meta name="author" content="$author-meta$" />
$endfor$
$if(date-meta)$
<meta name="dcterms.date" content="$date-meta$" />
$endif$
<title>$if(title-prefix)$$title-prefix$ - $endif$$pagetitle$</title>
<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">
<link rel="stylesheet" href="$revealjs-url$/css/reveal.css"/>
<style type="text/css">code{white-space: pre;}</style>
$if(highlighting-css)$
<style type="text/css">
$highlighting-css$
</style>
$endif$
$if(theme)$
<link rel="stylesheet" href="$revealjs-url$/css/theme/$theme$.css" id="theme">
$else$
<link rel="stylesheet" href="$revealjs-url$/css/theme/black.css" id="theme">
$endif$
$for(css)$
<link rel="stylesheet" href="$css$"/>
$endfor$
<link rel="stylesheet" href="$decker-support-dir$/font-awesome-4.6.3/css/font-awesome.min.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 = '$revealjs-url$/css/print/pdf.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
}
</script>
<!--[if lt IE 9]>
<script src="$revealjs-url$/lib/js/html5shiv.js"></script>
<![endif]-->
$if(math)$
$math$
$endif$
$for(header-includes)$
$header-includes$
$endfor$
</head>
<body>
$for(include-before)$
$include-before$
$endfor$
<div class="reveal">
<div class="slides">
$if(title)$
<section>
<h1 class="title">$title$</h1>
$if(subtitle)$
<h1 class="subtitle">$subtitle$</h1>
$endif$
$for(author)$
<h2 class="author">$author$</h2>
$endfor$
<h3 class="date">$date$</h3>
</section>
$endif$
$if(toc)$
<section id="$idprefix$TOC">
$toc$
</section>
$endif$
$body$
</div>
</div>
<script src="$revealjs-url$/lib/js/head.min.js"></script>
<script src="$revealjs-url$/js/reveal.js"></script>
<script>
var sn = false;
// Full list of configuration options available here:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
keyboard: {
84: function() {
sn = !sn;
Reveal.configure({ showNotes: sn });
}
},
showNotes: sn,
controls: false, // Display controls in the bottom right corner
progress: true, // Display a presentation progress bar
history: $if(history)$$history$$else$false$endif$, // Push each slide change to the browser history
center: $if(center)$$center$$else$true$endif$, // Vertical centering of slides
maxScale: $if(maxScale)$$maxScale$$else$1.5$endif$, // Bounds for smallest/largest possible content scale
slideNumber: $if(slideNumber)$true$else$false$endif$, // Display the page number of the current slide
theme: $if(theme)$'$theme$'$else$Reveal.getQueryHash().theme$endif$, // available themes are in /css/theme
transition: $if(transition)$'$transition$'$else$Reveal.getQueryHash().transition || 'default'$endif$, // default/cube/page/concave/zoom/linear/fade/none
// Optional libraries used to extend on reveal.js
dependencies: [
{ src: '$revealjs-url$/lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: '$revealjs-url$/plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },
{ src: '$revealjs-url$/plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } },
// { src: '$revealjs-url$/plugin/search/search.js', async: true, condition: function() { return !!document.body.classList; }, }
// { src: '$revealjs-url$/plugin/remotes/remotes.js', async: true, condition: function() { return !!document.body.classList; } }
]});
</script>
$for(include-after)$
$include-after$
$endfor$
</body>
</html>
<!DOCTYPE html>
<html$if(lang)$ lang="$lang$"$endif$>
<html$if(lang)$ lang="$lang$"$endif$$if(dir)$ dir="$dir$"$endif$>
<head>
<meta charset="utf-8">
<meta name="generator" content="pandoc">
$for(author-meta)$
<meta name="author" content="$author-meta$" />
<meta name="author" content="$author-meta$">
$endfor$
$if(date-meta)$
<meta name="dcterms.date" content="$date-meta$" />
<meta name="dcterms.date" content="$date-meta$">
$endif$
<title>$if(title-prefix)$$title-prefix$ - $endif$$pagetitle$</title>
<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">
<link rel="stylesheet" href="$revealjs-url$/css/reveal.css"/>
$if(keywords)$
<meta name="keywords" content="$for(keywords)$$keywords$$sep$, $endfor$">
$endif$
<title>$if(title-prefix)$$title-prefix$ – $endif$$pagetitle$</title>
<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, minimal-ui">
<link rel="stylesheet" href="$revealjs-url$/css/reveal.css">
<style type="text/css">code{white-space: pre;}</style>
$if(quotes)$
<style type="text/css">q { quotes: "“" "”" "‘" "’"; }</style>
$endif$
$if(highlighting-css)$
<style type="text/css">
$highlighting-css$
......@@ -28,16 +34,13 @@ $endif$
$for(css)$
<link rel="stylesheet" href="$css$"/>
$endfor$
<link rel="stylesheet" href="$decker-support-dir$/font-awesome-4.6.3/css/font-awesome.min.css">
<!-- If the query includes 'print-pdf', include the PDF print sheet -->
<!-- Printing and PDF exports -->
<script>
if( window.location.search.match( /print-pdf/gi ) ) {
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = '$revealjs-url$/css/print/pdf.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
}
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match( /print-pdf/gi ) ? '$revealjs-url$/css/print/pdf.css' : '$revealjs-url$/css/print/paper.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
</script>
<!--[if lt IE 9]>
<script src="$revealjs-url$/lib/js/html5shiv.js"></script>
......@@ -58,14 +61,16 @@ $endfor$
$if(title)$
<section>
<h1 class="title">$title$</h1>
<h1 class="title">$title$</h1>
$if(subtitle)$
<h1 class="subtitle">$subtitle$</h1>
<p class="subtitle">$subtitle$</p>
$endif$
$for(author)$
<h2 class="author">$author$</h2>
<p class="author">$author$</p>
$endfor$
<h3 class="date">$date$</h3>
$if(date)$
<p class="date">$date$</p>
$endif$
</section>
$endif$
$if(toc)$
......@@ -83,36 +88,154 @@ $body$
<script>
var sn = false;
// Full list of configuration options available here:
// Full list of configuration options available at:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
keyboard: {
84: function() {
sn = !sn;
Reveal.configure({ showNotes: sn });
}
},
showNotes: sn,
controls: false, // Display controls in the bottom right corner
progress: true, // Display a presentation progress bar
history: $if(history)$$history$$else$false$endif$, // Push each slide change to the browser history
center: $if(center)$$center$$else$true$endif$, // Vertical centering of slides
maxScale: $if(maxScale)$$maxScale$$else$1.5$endif$, // Bounds for smallest/largest possible content scale
slideNumber: $if(slideNumber)$true$else$false$endif$, // Display the page number of the current slide
theme: $if(theme)$'$theme$'$else$Reveal.getQueryHash().theme$endif$, // available themes are in /css/theme
transition: $if(transition)$'$transition$'$else$Reveal.getQueryHash().transition || 'default'$endif$, // default/cube/page/concave/zoom/linear/fade/none
$if(controls)$
// Display controls in the bottom right corner
controls: $controls$,
$endif$
$if(progress)$
// Display a presentation progress bar
progress: $progress$,
$endif$
$if(slideNumber)$
// Display the page number of the current slide
slideNumber: $slideNumber$,
$endif$
$if(history)$
// Push each slide change to the browser history
history: $history$,
$endif$
$if(keyboard)$
// Enable keyboard shortcuts for navigation
keyboard: $keyboard$,
$endif$
$if(overview)$
// Enable the slide overview mode
overview: $overview$,
$endif$
$if(center)$
// Vertical centering of slides
center: $center$,
$endif$
$if(touch)$
// Enables touch navigation on devices with touch input
touch: $touch$,
$endif$
$if(loop)$
// Loop the presentation
loop: $loop$,
$endif$
$if(rtl)$
// Change the presentation direction to be RTL
rtl: $rtl$,
$endif$
$if(fragments)$
// Turns fragments on and off globally
fragments: $fragments$,
$endif$
$if(embedded)$
// Flags if the presentation is running in an embedded mode,
// i.e. contained within a limited portion of the screen
embedded: $embedded$,
$endif$
$if(help)$
// Flags if we should show a help overlay when the questionmark
// key is pressed
help: $help$,
$endif$
$if(showNotes)$
// Flags if speaker notes should be visible to all viewers
showNotes: $showNotes$,
$endif$
$if(autoSlide)$
// Number of milliseconds between automatically proceeding to the
// next slide, disabled when set to 0, this value can be overwritten
// by using a data-autoslide attribute on your slides
autoSlide: $autoSlide$,
$endif$
$if(autoSlideStoppable)$
// Stop auto-sliding after user input
autoSlideStoppable: $autoSlideStoppable$,
$endif$
$if(mouseWheel)$
// Enable slide navigation via mouse wheel
mouseWheel: $mouseWheel$,
$endif$
$if(hideAddressBar)$
// Hides the address bar on mobile devices
hideAddressBar: $hideAddressBar$,
$endif$
$if(previewLinks)$
// Opens links in an iframe preview overlay
previewLinks: $previewLinks$,
$endif$
$if(transition)$
// Transition style
transition: '$transition$', // none/fade/slide/convex/concave/zoom
$endif$
$if(transitionSpeed)$
// Transition speed
transitionSpeed: '$transitionSpeed$', // default/fast/slow
$endif$
$if(backgroundTransition)$
// Transition style for full page slide backgrounds
backgroundTransition: '$backgroundTransition$', // none/fade/slide/convex/concave/zoom
$endif$
$if(viewDistance)$
// Number of slides away from the current that are visible
viewDistance: $viewDistance$,
$endif$
$if(parallaxBackgroundImage)$
// Parallax background image
parallaxBackgroundImage: '$parallaxBackgroundImage$', // e.g. "'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg'"
$endif$
$if(parallaxBackgroundSize)$
// Parallax background size
parallaxBackgroundSize: '$parallaxBackgroundSize$', // CSS syntax, e.g. "2100px 900px"
$endif$
$if(parallaxBackgroundHorizontal)$
// Amount to move parallax background (horizontal and vertical) on slide change
// Number, e.g. 100
parallaxBackgroundHorizontal: $parallaxBackgroundHorizontal$,
$endif$
$if(parallaxBackgroundVertical)$
parallaxBackgroundVertical: $parallaxBackgroundVertical$,
$endif$
$if(width)$
// The "normal" size of the presentation, aspect ratio will be preserved
// when the presentation is scaled to fit different resolutions. Can be
// specified using percentage units.
width: $width$,
$endif$
$if(height)$
height: $height$,
$endif$
$if(margin)$
// Factor of the display size that should remain empty around the content
margin: $margin$,
$endif$
$if(minScale)$
// Bounds for smallest/largest possible scale to apply to content
minScale: $minScale$,
$endif$
$if(maxScale)$
maxScale: $maxScale$,
$endif$
// Optional libraries used to extend on reveal.js
// Optional reveal.js plugins
dependencies: [
{ src: '$revealjs-url$/lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: '$revealjs-url$/plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },
{ src: '$revealjs-url$/plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } },
// { src: '$revealjs-url$/plugin/search/search.js', async: true, condition: function() { return !!document.body.classList; }, }
// { src: '$revealjs-url$/plugin/remotes/remotes.js', async: true, condition: function() { return !!document.body.classList; } }
]});
</script>
{ src: '$revealjs-url$/plugin/zoom-js/zoom.js', async: true },
$if(notes-server)$
{ src: '$revealjs-url$/socket.io/socker.io.js', async: true },
{ src: '$revealjs-url$/plugin/notes-server/client.js', async: true },
$endif$
{ src: '$revealjs-url$/plugin/notes/notes.js', async: true }
]
});
</script>
$for(include-after)$
$include-after$
$endfor$
......
# [<img src="https://khan.github.io/KaTeX/katex-logo.svg" width="130" alt="KaTeX">](https://khan.github.io/KaTeX/) [![Build Status](https://travis-ci.org/Khan/KaTeX.svg?branch=master)](https://travis-ci.org/Khan/KaTeX)
[![Join the chat at https://gitter.im/Khan/KaTeX](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Khan/KaTeX?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
KaTeX is a fast, easy-to-use JavaScript library for TeX math rendering on the web.
* **Fast:** KaTeX renders its math synchronously and doesn't need to reflow the page. See how it compares to a competitor in [this speed test](http://jsperf.com/katex-vs-mathjax/).
* **Print quality:** KaTeX’s layout is based on Donald Knuth’s TeX, the gold standard for math typesetting.
* **Self contained:** KaTeX has no dependencies and can easily be bundled with your website resources.
* **Server side rendering:** KaTeX produces the same output regardless of browser or environment, so you can pre-render expressions using Node.js and send them as plain HTML.
KaTeX supports all major browsers, including Chrome, Safari, Firefox, Opera, and IE 8 - IE 11. A list of supported commands can be on the [wiki](https://github.com/Khan/KaTeX/wiki/Function-Support-in-KaTeX).
## Usage
You can [download KaTeX](https://github.com/khan/katex/releases) and host it on your server or include the `katex.min.js` and `katex.min.css` files on your page directly from a CDN:
```html
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.5.1/katex.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.5.1/katex.min.js"></script>
```
#### In-browser rendering
Call `katex.render` with a TeX expression and a DOM element to render into:
```js
katex.render("c = \\pm\\sqrt{a^2 + b^2}", element);
```
If KaTeX can't parse the expression, it throws a `katex.ParseError` error.
#### Server side rendering or rendering to a string
To generate HTML on the server or to generate an HTML string of the rendered math, you can use `katex.renderToString`:
```js
var html = katex.renderToString("c = \\pm\\sqrt{a^2 + b^2}");
// '<span class="katex">...</span>'
```
Make sure to include the CSS and font files, but there is no need to include the JavaScript. Like `render`, `renderToString` throws if it can't parse the expression.
#### Rendering options
You can provide an object of options as the last argument to `katex.render` and `katex.renderToString`. Available options are:
- `displayMode`: `boolean`. If `true` the math will be rendered in display mode, which will put the math in display style (so `\int` and `\sum` are large, for example), and will center the math on the page on its own line. If `false` the math will be rendered in inline mode. (default: `false`)
- `throwOnError`: `boolean`. If `true`, KaTeX will throw a `ParseError` when it encounters an unsupported command. If `false`, KaTeX will render the unsupported command as text in the color given by `errorColor`. (default: `true`)
- `errorColor`: `string`. A color string given in the format `"#XXX"` or `"#XXXXXX"`. This option determines the color which unsupported commands are rendered in. (default: `#cc0000`)
For example:
```js
katex.render("c = \\pm\\sqrt{a^2 + b^2}", element, { displayMode: true });
```
#### Automatic rendering of math on a page
Math on the page can be automatically rendered using the auto-render extension. See [the Auto-render README](contrib/auto-render/README.md) for more information.
## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md)
## License
KaTeX is licensed under the [MIT License](http://opensource.org/licenses/MIT).
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment