Skip to content

Commit

Permalink
Added metadata 'encoding' to define html document charset
Browse files Browse the repository at this point in the history
  • Loading branch information
soyrochus authored and jdan committed Sep 7, 2013
1 parent 8a0c2d8 commit 0cd846a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ the following fields.
* **output**: A location to save the rendered document (default: *FILENAME-cleaver.html*)
* **controls**: Option whether or not arrow buttons should be included (default: *true*)
* **agenda**: Option whether or not to insert an agenda slide (similar to a table of contents) after the title (default: *false*)
* **encoding**: A specified content encoding (default: *utf-8*)

If author is included, the following slide will be automatically inserted
at the end of your presentation:
Expand Down
17 changes: 16 additions & 1 deletion examples/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ output: basic.html

Content can be written in **Markdown!** New lines no longer need two angle brackets.

This will be in a separate paragraph
This will be in a separate paragraph.

<img src="http://whatismarkdown.com/workspace/img/logo.gif" alt="Drawing" style="width: 150px;"/>

![markdown-logo](logo.gif)
<img src="logo.gif" />

--

Expand All @@ -27,3 +32,13 @@ This will be in a separate paragraph
* Item gamma

No need for multiple templates!

--

### Unicode

* 林花謝了春紅 太匆匆
* 胭脂淚 留人醉 幾時重
* Matching Pairs «»‹› “”‘’「」〈〉《》〔〕
* Greek αβγδ εζηθ ικλμ νξοπ ρςτυ φχψω
* currency ¤ $ ¢ € ₠ £ ¥
3 changes: 3 additions & 0 deletions lib/cleaver.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,14 @@ Cleaver.prototype._renderSlideshow = function () {
var putControls = this.metadata.controls || (this.metadata.controls === undefined);
var outputLocation = this.metadata.output || path.basename(this.file, '.md') + '-cleaver.html';

// TODO: handle defaults gracefully
var title = this.metadata.title || 'Untitled';
var encoding = this.metadata.encoding || 'utf-8';

var slideData = {
slides: this.slides,
title: title,
encoding: encoding,
controls: putControls,
style: this.resources.loaded.style,
externalStyle: this.external.loaded.style,
Expand Down
1 change: 1 addition & 0 deletions templates/layout.mustache
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<html>
<head>
<meta charset="{{encoding}}">
<title>{{title}}</title>
<style type="text/css">
{{{style}}}
Expand Down

0 comments on commit 0cd846a

Please sign in to comment.