Skip to content

Commit 1229ff5

Browse files
committed
Merge pull request #62 from jdan/themes
The Big Theme Pull Request
2 parents 8417f8e + 84c820b commit 1229ff5

File tree

9 files changed

+497
-143
lines changed

9 files changed

+497
-143
lines changed

README.md

Lines changed: 83 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -53,66 +53,109 @@ And run it like so:
5353

5454
```bash
5555
cleaver path/to/something.md
56+
```
57+
58+
You can also watch for changes on a file and automatically recompile with:
59+
60+
```bash
61+
cleaver watch path/to/something-changing.md
5662

57-
# to recompile on changes:
58-
# cleaver watch path/to/something.md
63+
# Watching for changes on presentation.md. Ctrl-C to abort.
64+
# Rebuilding: Thu Nov 07 2013 00:15:03 GMT-0500 (EST)
65+
# Rebuilding: Thu Nov 07 2013 00:15:21 GMT-0500 (EST)
66+
# Rebuilding: Thu Nov 07 2013 00:16:01 GMT-0500 (EST)
67+
# Rebuilding: Thu Nov 07 2013 00:16:09 GMT-0500 (EST)
5968
```
6069

6170
## More Info
6271

6372
**Cleaver** is a one-stop shop for generating HTML presentations in
6473
record time. Using some spiced up markdown, you can produce
65-
good-looking, interactive presentations without writing any code
66-
or placing a measly textbox.
74+
good-looking, interactive presentations with a just a few lines of text.
6775

6876
All you need to do is write some blocks of markdown, separated by `--`
69-
on its own line and include metadata at the top.
77+
on its own line and include options at the top.
7078

71-
Cleaver also looks great on mobile.
79+
Slides are written in [Markdown](http://daringfireball.net/projects/markdown/),
80+
and are separated by two dashes (`--`).
7281

73-
Let's walk through the above example piece by piece.
74-
75-
### Metadata
82+
## Options
7683

7784
title: Basic Example
7885
author:
7986
name: Jordan Scales
8087
twitter: jdan
8188
url: http://jordanscales.com
89+
style: basic-style.css
8290
output: basic.html
83-
controls: true
8491

85-
The first section of any cleaver document is the metadata. Currently cleaver supports
86-
the following fields. **All metadata is optional**.
92+
Cleaver supports several basic options that allow you to further customize the
93+
look and feel of your presentation, including author info, stylesheets, and
94+
custom templates.
95+
96+
See the documentation on
97+
[options](https://github.com/jdan/cleaver/blob/master/docs/options.md) for more
98+
information.
99+
100+
## Themes
101+
102+
title: Theme Example
103+
output: theme.html
104+
theme: jdan/cleaver-retro
105+
106+
Cleaver has substantial theme support to give you more fine-grained control
107+
over your presentation, similar to [options](#options). Instead of manually
108+
specifying a stylesheet, template, layout, and others, you can specify a single
109+
theme containing each of these assets. More specifically, a theme may contain:
110+
111+
* style.css - styles for your presentation
112+
* template.mustache - a template used to render the slides in your presentation
113+
* layout.mustache - a template used to render the entire document of your
114+
presentation
115+
* script.js - javascript to be included in your slideshow
116+
117+
A theme does not need to contain all of these files, only the ones present
118+
will be loaded into your slideshow.
119+
120+
### Examples
121+
122+
* [jdan/cleaver-retro](http://github.com/jdan/cleaver-retro)
87123

88-
**Ordinary Users**
124+
![cleaver-retro](https://i.cloudup.com/HLtcPJWJJl-1200x1200.png)
89125

90-
* **title**: The title of the slideshow
91-
* **author**
92-
* **name**: Your full name
93-
* **url**: A url to your website
94-
* **twitter**: Your twitter handle (*please note that the character '@'
95-
must be wrapped in quotes - e.g. "@jdan" - as per the YAML specification*)
96-
* **email**: Your email address
97-
* **style**: An optional stylesheet to load
98-
* **output**: A location to save the rendered document (default: *FILENAME-cleaver.html*)
99-
* **controls**: Option whether or not arrow buttons should be included (default: *true*)
100-
* **agenda**: Option whether or not to insert an agenda slide (similar to a table of contents) after the title (default: *false*)
101-
* **encoding**: A specified content encoding (default: *utf-8*)
102-
* **progress**: Option whether or not to display a small progress bar at the top of the page
103-
(default: *true*)
126+
* [matmuchrapna/cleaver-ribbon](http://github.com/matmuchrapna/cleaver-ribbon)
104127

105-
**Power Users**
128+
![cleaver-ribbon](https://i.cloudup.com/GECEx5BmxI-1200x1200.png)
106129

107-
* **template**: Location of the template used to render the slides (default:
108-
*default.mustache*)
109-
* **layout**: Location of the layout template used to render everything (default:
110-
*layout.mustache*)
130+
### Specifying Themes
111131

112-
If author is included, the following slide will be automatically inserted
113-
at the end of your presentation:
132+
Themes may be specified by one of the following options:
114133

115-
![author slide](https://i.cloudup.com/f0zVsUwqF0-3000x3000.png)
134+
* An absolute or relative path to a directory
135+
* A URL to a directory
136+
* A github repostitory in the form of *username/reponame*
137+
138+
### Overriding Themes
139+
140+
By default, *style.css* and *script.js* will be **appended** to the default
141+
stylesheets and javascripts included in cleaver presentations. If you wish to
142+
completely override these defaults, you must include another file in your
143+
theme - options.json - corresponding to the following:
144+
145+
```json
146+
{
147+
"override": true
148+
}
149+
```
150+
151+
Template files will automatically override the default templates.
152+
153+
### More Info
154+
155+
For more information on themes, check out
156+
[the documentation]([options](https://github.com/jdan/cleaver/blob/master/docs/themes.md)
157+
158+
## Slide Types
116159

117160
### Title slide
118161

@@ -138,57 +181,18 @@ you can include things like lists, images, and arbitrary HTML.
138181
**h3** tags (prefaced `###`) are automatically given a bottom border to
139182
represent a slide title.
140183

141-
### Navigation
184+
## Navigation
185+
186+
Cleaver supports keyboard navigation for switching between slides.
142187

143188
To navigate the slideshow:
144189

145190
* **reverse**: H, J, LEFT, DOWN, and Backspace
146191
* **forward**: K, L, ENTER, UP, RIGHT, and Space
147192

148-
Or click the buttons
149-
150-
### Templates
151-
152-
By default, cleaver slides are rendered in the following template:
153-
154-
```html
155-
{{#progress}}
156-
<div class="progress">
157-
<div class="progress-bar"></div>
158-
</div>
159-
{{/progress}}
160-
161-
<div id="wrapper">
162-
{{#slides}}
163-
<section class="slide">{{{.}}}</section>
164-
{{/slides}}
165-
</div>
166-
{{#controls}}
167-
<div class="controls">
168-
<div class="arrow prev"></div>
169-
<div class="arrow next"></div>
170-
</div>
171-
{{/controls}}
172-
173-
<script type="text/javascript">
174-
{{{navigation}}}
175-
</script>
176-
```
177-
178-
Power users may wish to render into custom templates. To do so, simply copy the above file
179-
somewhere, make some changes, and specify the template like so:
180-
181-
```yaml
182-
title: Basic Example
183-
output: basic.html
184-
template: example.mustache
185-
```
186-
187-
You can also replace the entire layout (`<head>` tags and all) with the `layout` option. Use
188-
[layout.mustache](https://github.com/jdan/cleaver/blob/master/templates/layout.mustache) as
189-
an example to note what fields you should include in your custom layout.
193+
Alternatively, click the control buttons located below the presentation.
190194

191-
### Contributing
195+
## Contributing
192196

193197
* Fork it
194198
* Clone it

docs/options.md

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
## Options
2+
3+
Cleaver supports several basic options for adding a bit of customization to
4+
your presentations. These options are placed at the top of your document, in
5+
YAML format. A typical option setup resembles the following.
6+
7+
title: Basic Example
8+
author:
9+
name: Jordan Scales
10+
twitter: jdan
11+
url: http://jordanscales.com
12+
style: basic-styles.css
13+
output: basic.html
14+
15+
### title
16+
17+
The title of the slidshow.
18+
19+
**Default**: Untitled
20+
21+
### author
22+
23+
Several fields which, if included, populate a basic author "credits" slide at
24+
the end of your presentation.
25+
26+
![author slide](https://i.cloudup.com/f0zVsUwqF0-3000x3000.png)
27+
28+
These fields include:
29+
30+
* **name**: Your full name
31+
* **url**: A url to your website
32+
* **twitter**: Your twitter handle
33+
* **email**: Your email address
34+
35+
Please note that some characters must be escaped. For example, "@username"
36+
would need to be wrapped in quotes. You can leave out the "@" when specifying
37+
a twitter handle.
38+
39+
### theme
40+
41+
An optional theme to load. A theme is a directory, URL, or a github repo in
42+
the form of *username/repo* that may contain stylesheets, javascript, or
43+
rewritten templates. Themes group together many of the other options listed
44+
in this article.
45+
46+
For example, check out the [retro theme](http://github.com/jdan/cleaver-retro).
47+
48+
For more information on themes, check out
49+
[the documentation]([options](https://github.com/jdan/cleaver/blob/master/docs/themes.md).
50+
51+
### style
52+
53+
An optional stylesheet to load. This can be either a URL, or an
54+
absolute/relative path to a file. *Relative to the markdown document you are
55+
sending to cleaver*.
56+
57+
These styles will be **appended** to Cleaver's default style. For more
58+
fine-grained control, check out the docs on Theming.
59+
60+
### output
61+
62+
The filename (or absolute/relative path to a file) you wish to save your
63+
output to.
64+
65+
**Default**: FILENAME-cleaver.html
66+
67+
### controls
68+
69+
An option determining whether or not you want to render simple navigation
70+
buttons on your presentation.
71+
72+
**Default**: true
73+
74+
### progress
75+
76+
Displays a small progress bar at the top of your document.
77+
78+
**Default**: true
79+
80+
### agenda
81+
82+
Inserts an agenda (table of contents) slide at the beginning of your
83+
presentation, based on the titles of your individual slides.
84+
85+
**Default**: false
86+
87+
### encoding
88+
89+
Content encoding to use on the rendered document.
90+
91+
**Default**: utf-8
92+
93+
### template
94+
95+
URL or absolute/relative path to a mustache template used to render the slides.
96+
See [default.mustache](https://github.com/jdan/cleaver/blob/master/templates/default.mustache)
97+
for inspiration.
98+
99+
### layout
100+
101+
URL or absolute/relative path to a mustache template used to render the entire
102+
slideshow. See
103+
[layout.mustache](https://github.com/jdan/cleaver/blob/master/templates/layout.mustache)
104+
for inspiration.

docs/themes.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
## Themes
2+
3+
title: Theme Example
4+
output: theme.html
5+
theme: jdan/cleaver-retro
6+
7+
Cleaver has substantial theme support to give you more fine-grained control
8+
over your presentation, similar to [options](#options). Instead of manually
9+
specifying a stylesheet, template, layout, and others, you can specify a single
10+
theme containing each of these assets. More specifically, a theme may contain:
11+
12+
* style.css - styles for your presentation
13+
* template.mustache - a template used to render the slides in your presentation
14+
* layout.mustache - a template used to render the entire document of your
15+
presentation
16+
* script.js - javascript to be included in your slideshow
17+
18+
A theme does not need to contain all of these files, only the ones present
19+
will be loaded into your slideshow.
20+
21+
### Examples
22+
23+
* [jdan/cleaver-retro](http://github.com/jdan/cleaver-retro)
24+
25+
![cleaver-retro](https://i.cloudup.com/HLtcPJWJJl-1200x1200.png)
26+
27+
* [matmuchrapna/cleaver-ribbon](http://github.com/matmuchrapna/cleaver-ribbon)
28+
29+
![cleaver-ribbon](https://i.cloudup.com/GECEx5BmxI-1200x1200.png)
30+
31+
### Specifying Themes
32+
33+
Themes may be specified by one of the following options:
34+
35+
* An absolute or relative path to a directory
36+
* A URL to a directory
37+
* A github repostitory in the form of *username/reponame*
38+
39+
### Overriding Themes
40+
41+
By default, *style.css* and *script.js* will be **appended** to the default
42+
stylesheets and javascripts included in cleaver presentations. If you wish to
43+
completely override these defaults, you must include another file in your
44+
theme - options.json - corresponding to the following:
45+
46+
```json
47+
{
48+
"override": true
49+
}
50+
```
51+
52+
Template files will automatically override the default templates.
53+
54+
### Theme Behavior
55+
56+
Themes group together many options such as style, template, and layout. Please
57+
not that the individual options will be loaded *after* the theme, allowing you
58+
to override a theme's properties. This is not recommended, however, as the
59+
theme author may construct his or her styles in such a way that they are not
60+
meant to be overridden.

0 commit comments

Comments
 (0)