-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: command-line interface for generating presentations from markdown
* add script to package.json * README-driven development * saner expectation * use node gitignore * update user guide * add templates for biggie integration * add biggie as big-presentation-compose * use original index.html * remove minimist * remove .gitignore
- Loading branch information
Showing
6 changed files
with
88 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env node | ||
|
||
// Pulled from https://github.com/tmcw/biggie/blob/gh-pages/cli.js | ||
var concat = require('concat-stream'); | ||
var fs = require('fs'); | ||
var marked = require('marked'); | ||
var mustache = require('mustache'); | ||
|
||
fs.createReadStream('index.md').pipe(concat(convert)); | ||
|
||
function convert(data) { | ||
var divs = data.toString().split('---').filter(function(v) { | ||
return v.replace(/\s/g, ''); | ||
}).map(function(v) { | ||
return '<div>' + marked(v) + '</div>'; | ||
}).join('\n'); | ||
|
||
fs.writeFileSync('index.html', mustache.render( | ||
fs.readFileSync('template.hbs', 'utf8'), { | ||
//TODO parameterize title? | ||
title: 'big', | ||
slides: divs | ||
}), null, 2) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
## Write a big presentation in Markdown | ||
|
||
--- | ||
|
||
It's _big_, but a little more eazy | ||
|
||
--- | ||
|
||
Put dashes between slides to separate them. | ||
|
||
--- | ||
|
||
Supports lists | ||
|
||
* Like | ||
* This | ||
* One | ||
|
||
--- | ||
|
||
Run | ||
|
||
```sh | ||
big-presentation-compose | ||
``` | ||
|
||
to publish your presentation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset='utf-8'> | ||
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' /> | ||
<title>{{{ title }}}</title> | ||
<link href='big.css' rel='stylesheet' type='text/css' /> | ||
<link href='highlight.css' rel='stylesheet' type='text/css' /> | ||
<style> | ||
.new-shiny { background: #aaaaaa; } | ||
</style> | ||
<script src='big.js'></script> | ||
<script src='highlight.js'></script> | ||
<script>hljs.initHighlightingOnLoad();</script> | ||
</head> | ||
<body class='light'> | ||
{{{ slides }}} | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters