Commit 1ccb699e authored by Radovan Bast's avatar Radovan Bast

markdown examples for cicero app

parents
<link rel="stylesheet" href="{{ engine_root }}/remark.css">
<!-- for offline mathjax see http://stackoverflow.com/a/19209462 -->
<script src="http://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS_HTML&delayStartupUntil=configured"
type="text/javascript">
</script>
<script type="text/javascript">
MathJax.Hub.Config({
tex2jax: {
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre'],
inlineMath: [['$','$'], ['\\(','\\)']],
processEscapes: true
},
"TeX": {
Macros: {AA : "{\\unicode{x212B}}"},
extensions: ["autoload-all.js"]
},
"HTML-CSS": {
scale: 90
}
});
MathJax.Hub.Queue(function() {
$(MathJax.Hub.getAllJax()).map(function(index, elem) {
return(elem.SourceElement());
}).parent().addClass('has-jax');
});
MathJax.Hub.Register.StartupHook("TeX autoload-all Ready", function () {
var MACROS = MathJax.InputJax.TeX.Definitions.macros;
MACROS.color = "Color";
delete MACROS.colorbox;
delete MACROS.fcolorbox;
});
MathJax.Hub.Configured();
</script>
# Example slide with equations
We can use inline equations, `\(E = mc^2\)`, or full-line equations like:
`$$ \Gamma(t) = \pi \, \Im\left\{ \mathbf{x}_+^H(t) \, \frac{\mathrm{d}}{\mathrm{d} t}\mathbf{x}_+(t) \right\} $$`
You can just write in LaTeX, with minor modifications for specifying in-line or
full-line equations.
See [MathJax](https://www.mathjax.org) for more details and examples.
.footnote {
position: absolute;
bottom: 3em;
}
li p { line-height: 1.25em; }
.red { color: #fa0000; }
.large { font-size: 2em; }
a, a > code {
color: rgb(249, 38, 114);
text-decoration: none;
}
code {
background: #e7e8e2;
border-radius: 5px;
}
.pull-left {
float: left;
width: 47%;
}
.pull-right {
float: right;
width: 47%;
}
.pull-right ~ p {
clear: both;
}
#slideshow .slide .content code {
font-size: 0.8em;
}
#slideshow .slide .content pre code {
font-size: 0.9em;
padding: 15px;
}
.inverse {
background: #272822;
color: #777872;
text-shadow: 0 0 20px #333;
}
.inverse h1, .inverse h2 {
color: #f3f3f3;
line-height: 0.8em;
}
/* Slide-specific styling */
#slide-inverse .footnote {
bottom: 12px;
left: 20px;
}
#slide-how .slides {
font-size: 0.9em;
position: absolute;
top: 151px;
right: 140px;
}
#slide-how .slides h3 {
margin-top: 0.2em;
}
#slide-how .slides .first, #slide-how .slides .second {
padding: 1px 20px;
height: 90px;
width: 120px;
-moz-box-shadow: 0 0 10px #777;
-webkit-box-shadow: 0 0 10px #777;
box-shadow: 0 0 10px #777;
}
#slide-how .slides .first {
background: #fff;
position: absolute;
top: 20%;
left: 20%;
z-index: 1;
}
#slide-how .slides .second {
position: relative;
background: #fff;
z-index: 0;
}
/* Two-column layout */
.left-column {
color: #777;
width: 20%;
height: 92%;
float: left;
}
.left-column h2:last-of-type, .left-column h3:last-child {
color: #000;
}
.right-column {
width: 75%;
float: right;
padding-top: 1em;
}
.blue {
color: #0000ff;
}
/* two-column layout with different splits */
.column:first-of-type {
float: left;
}
.column:last-of-type {
float: right;
}
.split-30-70 .column:first-of-type {
width: 30%;
}
.split-30-70 .column:last-of-type {
width: 70%;
}
.split-40-60 .column:first-of-type {
width: 40%;
}
.split-40-60 .column:last-of-type {
width: 60%;
}
.split-50-50 .column:first-of-type {
width: 50%;
}
.split-50-50 .column:last-of-type {
width: 50%;
}
.split-60-40 .column:first-of-type {
width: 60%;
}
.split-60-40 .column:last-of-type {
width: 40%;
}
.split-70-30 .column:first-of-type {
width: 70%;
}
.split-70-30 .column:last-of-type {
width: 30%;
}
/* some special classes */
.title {
font-size: 3.3em;
color: #606060;
font-weight: bold;
letter-spacing: 0.05em;
}
.subtitle {
font-size: 1.4em;
}
.author {
font-size: 1.4em;
color: #606060;
font-weight: bold;
letter-spacing: 0.02em;
}
.coauthor {
font-size: 1.0em;
color: #606060;
font-weight: bold;
letter-spacing: 0.02em;
}
.institution {
font-size: 1.0em;
}
.date {
font-size: 1.0em;
font-style: italic;
}
.cite {
font-size: 0.8em;
color: #33AA99;
font-style: italic;
}
.strike {
color: salmon;
text-decoration: line-through;
}
.footnote-cite {
position: absolute;
bottom: 3em;
color: #7f7f7f;
font-size: 0.8em;
}
/* images overlay */
.imageWrapper {
position: relative;
}
.overlayImage {
position: absolute;
top: 0;
left: 0;
}
name: inverse
layout: true
class: center, middle, inverse
---
#remark
[ri-mahrk]
.footnote[Go directly to [project site](https://github.com/gnab/remark)]
---
## What is it and why should I be using it?
---
layout: false
.left-column[
## What is it?
]
.right-column[
A simple, in-browser, Markdown-driven slideshow tool targeted at people who know their way around HTML and CSS, featuring:
- Markdown formatting, with smart extensions
- Presenter mode, with cloned slideshow view
- Syntax highlighting, supporting a range of languages
- Slide scaling, thus similar appearance on all devices / resolutions .red[*]
- Touch support for smart phones and pads, i.e. swipe to navigate slides
.footnote[.red[*] At least browsers try their best]
]
---
.left-column[
## What is it?
## Why use it?
]
.right-column[
If your ideal slideshow creation workflow contains any of the following steps:
- Just write what's on your mind
- Do some basic styling
- Easily collaborate with others
- Share with and show to everyone
Then remark might be perfect for your next.red[*] slideshow!
.footnote[.red[*] You probably want to convert existing slideshows as well]
]
---
.left-column[
## What is it?
## Why use it?
]
.right-column[
As the slideshow is expressed using Markdown, you may:
- Focus on the content, expressing yourself in next to plain text not worrying what flashy graphics and disturbing effects to put where
As the slideshow is actually an HTML document, you may:
- Display it in any decent browser
- Style it using regular CSS, just like any other HTML content
- Use it offline!
As the slideshow is contained in a plain file, you may:
- Store it wherever you like; on your computer, hosted from your Dropbox, hosted on Github Pages alongside the stuff you're presenting...
- Easily collaborate with others, keeping track of changes using your favourite SCM tool, like Git or Mercurial
]
---
template: inverse
## How does it work, then?
---
name: how
.left-column[
## How does it work?
### - Markdown
]
.right-column[
A Markdown-formatted chunk of text is transformed into individual slides by JavaScript running in the browser:
```remark
# Slide 1
This is slide 1
---
# Slide 2
This is slide 2
```
.slides[
.first[
### Slide 1
This is slide 1
]
.second[
### Slide 2
This is slide 2
]
]
Regular Markdown rules apply with only a single exception:
- A line containing three dashes constitutes a new slide
(not a horizontal rule, `&lt;hr /&gt;`)
Have a look at the [Markdown website](http://daringfireball.net/projects/markdown/) if you're not familiar with Markdown formatting.
]
---
.left-column[
## How does it work?
### - Markdown
### - Inside HTML
]
.right-column[
A simple HTML document is needed for hosting the styles, Markdown and the generated slides themselves:
```xml
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
/* Slideshow styles */
</style>
</head>
<body>
* <textarea id="source">
<!-- Slideshow Markdown -->
&lt;/textarea&gt;
* <script src="remark.js">
</script>
<script>
* var slideshow = remark.create();
</script>
</body>
</html>
```
You may download remark to have your slideshow not depend on any online resources, or reference the [latest version](http://remarkjs.com/downloads/remark-latest.min.js) online directly.
]
---
template: inverse
## Of course, Markdown can only go so far.
---
.left-column[
## Markdown extensions
]
.right-column[
To help out with slide layout and formatting, a few Markdown extensions have been included:
- Slide properties, for naming, styling and templating slides
- Content classes, for styling specific content
- Syntax highlighting, supporting a range of languages
]
---
.left-column[
## Markdown extensions
### - Slide properties
]
.right-column[
Initial lines containing key-value pairs are extracted as slide properties:
```remark
name: agenda
class: middle, center
# Agenda
The name of this slide is {{ name }}.
```
Slide properties serve multiple purposes:
* Naming and styling slides using properties `name` and `class`
* Using slides as templates using properties `template` and `layout`
* Expansion of `{{ property }}` expressions to property values
See the [complete list](https://github.com/gnab/remark/wiki/Markdown#slide-properties) of slide properties.
]
---
.left-column[
## Markdown extensions
### - Slide properties
### - Content classes
]
.right-column[
Any occurences of one or more dotted CSS class names followed by square brackets are replaced with the contents of the brackets with the specified classes applied:
```remark
.footnote[.red.bold[*] Important footnote]
```
Resulting HTML extract:
```xml
<span class="footnote">
<span class="red bold">*</span> Important footnote
</span>
```
]
---
.left-column[
## Markdown extensions
### - Slide properties
### - Content classes
### - Syntax Highlighting
]
.right-column[
Code blocks can be syntax highlighted by specifying a language from the set of [supported languages](https://github.com/gnab/remark/wiki/Configuration#highlighting).
Using [GFM](http://github.github.com/github-flavored-markdown/) fenced code blocks you can easily specify highlighting language:
.pull-left[
<pre><code>```javascript
function add(a, b)
return a + b
end
```</code></pre>
]
.pull-right[
<pre><code>```ruby
def add(a, b)
a + b
end
```</code></pre>
]
A number of highlighting [styles](https://github.com/gnab/remark/wiki/Configuration#highlighting) are available, including several well-known themes from different editors and IDEs.
]
---
.left-column[
## Presenter mode
]
.right-column[
To help out with giving presentations, a presenter mode comprising the
following features is provided:
- Display of slide notes for the current slide, to help you remember
key points
- Display of upcoming slide, to let you know what's coming
- Cloning of slideshow for viewing on extended display
]
---
.left-column[
## Presenter mode
### - Inline notes
]
.right-column[
Just like three dashes separate slides,
three question marks separate slide content from slide notes:
```
Slide 1 content
*???
Slide 1 notes
---
Slide 2 content
*???
Slide 2 notes
```
Slide notes are also treated as Markdown, and will be converted in the
same manner slide content is.
Pressing __P__ will toggle presenter mode.
]
???
Congratulations, you just toggled presenter mode!
Now press __P__ to toggle it back off.
---
.left-column[
## Presenter mode
### - Inline notes
### - Cloned view
]
.right-column[
Presenter mode of course makes no sense to the audience.
Creating a cloned view of your slideshow lets you:
- Move the cloned view to the extended display visible to the audience
- Put the original slideshow in presenter mode
- Navigate as usual, and the cloned view will automatically keep up with the original
Pressing __C__ will open a cloned view of the current slideshow in a new
browser window.
]
---
template: inverse
## It's time to get started!
---
.left-column[
## Getting started
]
.right-column[
Getting up and running is done in only a few steps:
1. Visit the [project site](http://github.com/gnab/remark)
2. Follow the steps in the Getting Started section
For more information on using remark, please check out the [wiki](https://github.com/gnab/remark/wiki) pages.
]
---
name: last-page
template: inverse
## That's all folks (for now)!
Slideshow created using [remark](http://github.com/gnab/remark).
class: center, middle
# Simple example presentation
## Author
---
## Another slide
Try **F** and **P** keys.
- A bullet point
- Another convincing argument
---
## Code blocks are no problem
Here we have some Python code:
```python
from itertools import cycle
fizz = cycle(['', '', 'Fizz'])
buzz = cycle(['', '', '', '', 'Buzz'])
for i in range(1, 101):
print((next(fizz) + next(buzz)) or i)
```
[Source](https://github.com/olemb/nonsense/blob/master/fizzbuzz/itertools_cycle.py)
---
## Images (1/2)
An image fetched from the web:
![Sample image](https://upload.wikimedia.org/wikipedia/commons/thumb/4/4f/The_Young_Cicero_Reading.jpg/316px-The_Young_Cicero_Reading.jpg)
---
## Images (2/2)
An image stored alongside the slides:
![Sample image](img/cicero.jpg)
h1 {
color: #4a235a;
}
h2 {
color: #6c3483;
}
h3 {
color: #8e44ad;
}
a {
color: #3498db;
}
.inverse {
background: #272822;
color: #777872;
}
.inverse h1, .inverse h2 {
color: #a3e4d7;
line-height: 0.8em;
}
.background h1 {
color: #e8daef;
}
.left-column {
width: 50%;
float: left;
}
.right-column {
width: 50%;
float: right;
}
class: center, middle, inverse
# Simple example presentation
## Author [@404](https://twitter.com)
Some affiliation
---
background-image: url(https://upload.wikimedia.org/wikipedia/commons/c/c0/Apollo_CSM_lunar_orbit.jpg)
class: background
# Slide with a background image
---
# Main heading
## Subheading
### Even smaller heading