mdpress 0.0.15 → 0.0.16
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +13 -114
- data/bin/mdpress +12 -1
- data/lib/impress_css/default.css +0 -1
- metadata +4 -4
data/README.md
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
# mdpress
|
2
2
|
|
3
|
-
This is a tool that converts markdown files to presentations using impress.
|
3
|
+
This is a tool that converts markdown files to presentations using [impress.js](https://github.com/bartaz/impress.js/).
|
4
4
|
|
5
5
|
# Example
|
6
6
|
|
7
|
-
[This presentation](http://
|
7
|
+
[This presentation](http://static.adit.io/mdpress/default) was created from [this markdown file](https://raw.github.com/egonSchiele/mdpress/master/examples/demo.md).
|
8
8
|
|
9
|
-
[This presentation](http://
|
9
|
+
[This presentation](http://static.adit.io/mdpress/obtvse) was created from the same markdown file and a different stylesheet using `mdpress -s [stylesheet name]`.
|
10
10
|
|
11
11
|
|
12
12
|
## Advantages
|
@@ -26,112 +26,16 @@ This is a tool that converts markdown files to presentations using impress.
|
|
26
26
|
|
27
27
|
## Usage
|
28
28
|
|
29
|
-
|
30
|
-
mdpress [http://www.yourdomain.com/path/to/filename.md]
|
29
|
+
mdpress [url or filename.md]
|
31
30
|
|
32
31
|
This creates a directory named `filename`. Start the presentation by opening up `index.html`.
|
33
32
|
|
34
|
-
|
33
|
+
[See full usage](http://egonschiele.github.io/mdpress/) (it's easy!).
|
35
34
|
|
36
|
-
|
37
|
-
## By Chicken
|
35
|
+
## Mdpress in the wild
|
38
36
|
|
39
|
-
|
40
|
-
|
41
|
-
# Chicken
|
42
|
-
- Chicken
|
43
|
-
- Chicken Chicken
|
44
|
-
|
45
|
-
Save that as `test.md` and then use `mdpress test.md` to convert it to a presentation.
|
46
|
-
`mdpress` uses [Redcarpet](https://github.com/tanoku/redcarpet), so it can parse whatever markdown you throw at it.
|
47
|
-
We use the horizonal rule, `---`, to indicate the start of a new slide.
|
48
|
-
|
49
|
-
### Getting Fancy: adding transformations
|
50
|
-
|
51
|
-
So far the slide transitions haven't been that exciting. Let's spice them up.
|
52
|
-
Below the `---`, type:
|
53
|
-
|
54
|
-
= data-x="1000"
|
55
|
-
|
56
|
-
And re-compile with `mdpress test.md` (you might have to delete your old presentation directory first).
|
57
|
-
|
58
|
-
Aha! Not bad! We specify transformations with `= [list of transformations]` as the first line of whatever slide we want to apply the transformation to.
|
59
|
-
|
60
|
-
We could have written
|
61
|
-
|
62
|
-
= data-x="1000" data-scale="2"
|
63
|
-
|
64
|
-
To make it scale as well as swipe.
|
65
|
-
|
66
|
-
## Possible Attributes
|
67
|
-
|
68
|
-
- `data-x`, `data-y`, `data-z`: positioning
|
69
|
-
- `data-rotate-x`, `data-rotate-y`, 'data-rotate-z`, `data-rotate`: rotation (`data-rotate` and `data-rotate-z` are exactly the same)
|
70
|
-
- `data-scale`: scale
|
71
|
-
- `id`: used as the slide link. For example, if you use `id=intro`, you can link to that slide using `index.html#/intro`.
|
72
|
-
|
73
|
-
See [impress.js](https://github.com/bartaz/impress.js/blob/master/index.html) for a broader description of these.
|
74
|
-
|
75
|
-
Adding this syntax to Markdown feels like kind of a hack, but it's concise. I'm open to suggestions for something better.
|
76
|
-
|
77
|
-
## Auto-update
|
78
|
-
|
79
|
-
Earlier, our workflow involved having to delete the old presentation and recompile every time we made an edit. The better choice is to use the automatic mode:
|
80
|
-
|
81
|
-
mdpress -a [filename.md]
|
82
|
-
|
83
|
-
Now, `mdpress` will keep running and check for updates to your markdown file. It will automatically recompile the presentation for you, so you can seamlessly edit your markdown and view your changes instantly.
|
84
|
-
|
85
|
-
## Stylesheets
|
86
|
-
|
87
|
-
`mdpress` comes with a default stylesheet, plus a few more. See the full list of available stylesheets with
|
88
|
-
|
89
|
-
mdpress -l
|
90
|
-
|
91
|
-
Or specify a stylesheet to use with
|
92
|
-
|
93
|
-
mdpress -s [stylesheet]
|
94
|
-
|
95
|
-
If you make your own stylesheets, send me a pull request and I'll add them to the list! See below.
|
96
|
-
|
97
|
-
You can also create your own local theme:
|
98
|
-
|
99
|
-
1. Use the 'lib/impress_css/' files as a model to work from.
|
100
|
-
2. Create a folder called 'themes' in the directory where your markdown
|
101
|
-
file is. Inside it put the [yourtheme].css and [yourtheme].html files
|
102
|
-
3. Call mdpress -s [yourtheme] and mdpress will look for the two theme
|
103
|
-
files in themes/ matching that name.
|
104
|
-
|
105
|
-
## Running a presentation
|
106
|
-
|
107
|
-
Someone emailed you a `mdpress` presentation. Now you want to **just run it**? Sure:
|
108
|
-
|
109
|
-
mdpress -r [filename.md]
|
110
|
-
|
111
|
-
That will automatically compile the presentation and open it in a browser window.
|
112
|
-
|
113
|
-
## Latex Support
|
114
|
-
|
115
|
-
mdpress now has Latex support through [MathJax](http://www.mathjax.org/). To build your presentation with latex support, use the `--latex` flag.
|
116
|
-
|
117
|
-
Put your latex code between a pair of `$$`'s, like this:
|
118
|
-
|
119
|
-
# Latex!
|
120
|
-
$$e^{\imath\pi} = -1$$
|
121
|
-
|
122
|
-
**Note**: you might run into conflicts between markdown and latex. For example, `_` means emphasize in markdown. So if you want subscripts, escape `_`:
|
123
|
-
|
124
|
-
$a_x$ # wrong, x will be italic
|
125
|
-
$a\_x$ # right, x will be a subscript
|
126
|
-
|
127
|
-
## Metadata
|
128
|
-
|
129
|
-
Metadata can be set via YAML-Frontmatter. Have a look at the examples for further information. For example, if you want to set a title, put this at the top of the markdown file:
|
130
|
-
|
131
|
-
---
|
132
|
-
title: All about chicken
|
133
|
-
---
|
134
|
-
|
37
|
+
- There's a [debian package](http://ftp-master.debian.org/new/mdpress_0.0.14+debian-1.html) in progress.
|
38
|
+
- Here's a [Yeoman generator](https://github.com/btholt/generator-mdpress) for mdpress.
|
135
39
|
|
136
40
|
## Contributing
|
137
41
|
|
@@ -143,14 +47,9 @@ To contribute a new stylesheet, follow these steps:
|
|
143
47
|
|
144
48
|
## Contributors
|
145
49
|
|
146
|
-
- Mte90
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
Copyright (C) 2012 by Aditya Bhargava
|
151
|
-
|
152
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
153
|
-
|
154
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
50
|
+
- [Mte90](https://github.com/Mte90)
|
51
|
+
- [linopolus](https://github.com/linopolus)
|
52
|
+
- [kmlawson](https://github.com/kmlawson)
|
53
|
+
- [guidokessels](https://github.com/guidokessels)
|
155
54
|
|
156
|
-
|
55
|
+
Copyright (C) 2013 by Aditya Bhargava (MIT license)
|
data/bin/mdpress
CHANGED
@@ -84,7 +84,7 @@ def render opts
|
|
84
84
|
ImpressRenderer.head= File.read(STYLESHEET_HEAD)
|
85
85
|
end
|
86
86
|
|
87
|
-
m = Markdown.new(ImpressRenderer, :autolink => true, :fenced_code_blocks => true, :tables => true)
|
87
|
+
m = Markdown.new(ImpressRenderer, :autolink => true, :fenced_code_blocks => true, :tables => true, :strikethrough => true)
|
88
88
|
log "rendering presentation"
|
89
89
|
f = File.open(DIRNAME + "/index.html", "w+")
|
90
90
|
f.write(m.render(text))
|
@@ -102,6 +102,7 @@ EOS
|
|
102
102
|
opt :run, "Run presentation (automatically compiles to a tmp directory and opens in a browser window)"
|
103
103
|
opt :latex, "Provide Latex support"
|
104
104
|
opt :verbose, "Be verbose."
|
105
|
+
opt :images, "Directory of images for the presentation", :type => :string
|
105
106
|
end
|
106
107
|
|
107
108
|
if OPTS[:list]
|
@@ -146,6 +147,16 @@ else
|
|
146
147
|
Dir.mkdir(DIRNAME)
|
147
148
|
end
|
148
149
|
|
150
|
+
if OPTS[:images]
|
151
|
+
if Dir.exist?(OPTS[:images])
|
152
|
+
FileUtils.cp_r(OPTS[:images], File.join(DIRNAME, OPTS[:images]))
|
153
|
+
log "copy the images into the presentation"
|
154
|
+
else
|
155
|
+
puts "'#{OPTS[:images]}' is not a valid directory."
|
156
|
+
exit
|
157
|
+
end
|
158
|
+
end
|
159
|
+
|
149
160
|
render OPTS
|
150
161
|
|
151
162
|
log "copying files"
|
data/lib/impress_css/default.css
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mdpress
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 63
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 16
|
10
|
+
version: 0.0.16
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Aditya Bhargava
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2014-01-21 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: redcarpet
|