forked from houqp/asciidoc-deckjs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 77fd427
Showing
8 changed files
with
379 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
*.swp | ||
|
||
|
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,3 @@ | ||
[submodule "deck.js"] | ||
path = deck.js | ||
url = https://github.com/imakewebthings/deck.js.git |
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,13 @@ | ||
all: test | ||
|
||
test: | ||
asciidoc --conf-file deckjs.conf example.asciidoc | ||
|
||
install: | ||
git submodule init | ||
|
||
clean: | ||
rm -rf example.html | ||
|
||
.PHONY: all clean | ||
|
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,35 @@ | ||
Asciidoc-deck.js | ||
================ | ||
|
||
An asciidoc backend for deck.js | ||
|
||
|
||
Dependencies | ||
------------ | ||
|
||
* Asciidoc | ||
* deck.js | ||
|
||
|
||
Installation | ||
------------ | ||
|
||
No need to install, just make sure asciidoc can properly find deck.js.conf. For asciidoc's configuration file loading strategy, please refer to [this guide](http://www.methods.co.nz/asciidoc/userguide.html#X7). | ||
|
||
The easiest way is to put `deck.js.conf` and the asciidoc file you wrote in the same directory. | ||
|
||
However, you can download `deck.js` by following command: | ||
```bash | ||
make isntall | ||
``` | ||
|
||
|
||
Usage | ||
----- | ||
|
||
```bash | ||
asciidoc -f deck.js.conf file.asciidoc | ||
``` | ||
Where file.asciidoc is the asciidoc file you wrote. | ||
|
||
|
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,4 @@ | ||
This backend is modified from svenax's asciidoc-s5 project. | ||
|
||
asciidoc-s5's project page: | ||
https://github.com/svenax/asciidoc-s5 |
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,5 @@ | ||
* subslides(nested slides) support | ||
|
||
* highlight codes | ||
|
||
* video support |
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,162 @@ | ||
include::/usr/share/asciidoc/xhtml11.conf[] | ||
|
||
[miscellaneous] | ||
outfilesuffix=.html | ||
|
||
[attributes] | ||
basebackend=html | ||
basebackend-html= | ||
|
||
[preamble] | ||
|
||
[sect1] | ||
<section class="slide"> | ||
<h2>{title}</h2> | ||
| | ||
</section> | ||
|
||
[paragraph] | ||
<p> | ||
| | ||
</p> | ||
|
||
#------------------------ | ||
# for code block | ||
|
||
[blockdef-listing] | ||
delimiter=^.{4,}$ | ||
template=code_block | ||
|
||
[code_block] | ||
<pre><code> | ||
| | ||
</code></pre> | ||
|
||
#------------------------ | ||
# for quote block | ||
|
||
[blockdef-quote] | ||
delimiter=^_{4,}$ | ||
quote-style=template="quote_block",options=("a",) | ||
|
||
[quote_block] | ||
<blockquote> | ||
<p>|</p> | ||
<p><cite>-- {attribution} {citetitle?, {citetitle}}</cite></p> | ||
</blockquote> | ||
|
||
#------------------------ | ||
# for image | ||
|
||
[image-blockmacro] | ||
<img src="{target}" alt="{title}" /> | ||
|
||
|
||
[blockdef-listing] | ||
source-style=template="source-highlight-block",presubs=(),postsubs=("callouts",),posattrs=("style","language","src_numbered","src_tab"),filter="source-highlight -f xhtml -s {language} {src_numbered?--line-number} {src_tab?--tab={src_tab}}" | ||
|
||
[blockdef-sidebar] | ||
template=sidebarblock | ||
style=notes | ||
notes-style=tags="notes" | ||
handout-style=tags="handout" | ||
|
||
[listtags-bulleted] | ||
list=<ul">|</ul> | ||
item=<li{incremental-option? class="slide"}>|</li> | ||
text= | ||
|
||
[listtags-numbered] | ||
list=<ol">|</ol> | ||
item=<li{incremental-option? class="slide"}>|</li> | ||
text=<p>|</p> | ||
|
||
[listtags-labeled] | ||
text= | ||
|
||
[header] | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | ||
|
||
<title>{doctitle=}</title> | ||
|
||
<meta name="description" content="{description}" /> | ||
<meta name="viewport" content="width=1024, user-scalable=no"> | ||
<meta name="author" content="{author}" /> | ||
<meta name="generator" content="AsciiDoc {asciidoc-version}" /> | ||
<meta name="presdate" content="{revdate}" /> | ||
{corpname?<meta name="company" content="{corpname}" />} | ||
|
||
<!-- Core and extension CSS files --> | ||
<link rel="stylesheet" href="deck.js/core/deck.core.css"> | ||
<link rel="stylesheet" href="deck.js/extensions/goto/deck.goto.css"> | ||
<link rel="stylesheet" href="deck.js/extensions/menu/deck.menu.css"> | ||
<link rel="stylesheet" href="deck.js/extensions/navigation/deck.navigation.css"> | ||
<link rel="stylesheet" href="deck.js/extensions/status/deck.status.css"> | ||
<link rel="stylesheet" href="deck.js/extensions/hash/deck.hash.css"> | ||
|
||
<!-- Theme CSS files --> | ||
<link rel="stylesheet" href="./deck.js/themes/style/{deckjs-theme}.css"> | ||
<link rel="stylesheet" id="transition-theme-link" href="./deck.js/themes/transition/{deckjs-transition}.css"> | ||
|
||
<!-- Replace path with correct path to Modernizr file. --> | ||
<script src="deck.js/modernizr.custom.js"></script> | ||
</head> | ||
|
||
<body class="deck-container"> | ||
|
||
<section class="slide" id="title-slide"> | ||
<h1>{doctitle}</h1> | ||
<h3>{author}{corpname? — {corpname}}</h3> | ||
<h4>{revdate}</h4> | ||
</section> | ||
|
||
|
||
|
||
[footer] | ||
|
||
<a href="#" class="deck-prev-link" title="Previous">←</a> | ||
<a href="#" class="deck-next-link" title="Next">→</a> | ||
|
||
<p class="deck-status"> | ||
<span class="deck-status-current"></span> | ||
/ | ||
<span class="deck-status-total"></span> | ||
</p> | ||
|
||
<form action="." method="get" class="goto-form"> | ||
<label for="goto-slide">Go to slide:</label> | ||
<input type="text" name="slidenum" id="goto-slide" list="goto-datalist"> | ||
<datalist id="goto-datalist"></datalist> | ||
<input type="submit" value="Go"> | ||
</form> | ||
|
||
<a href="." title="Permalink to this slide" class="deck-permalink">#</a> | ||
|
||
<!-- Other extension HTML snippets go here, at the bottom of the deck container. --> | ||
<script src="//ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.min.js"></script> | ||
<script>window.jQuery || document.write('<script src="deck.js/jquery-1.7.min.js"><\/script>')</script> | ||
|
||
<!-- Deck Core and extensions --> | ||
<script src="deck.js/core/deck.core.js"></script> | ||
<script src="deck.js/extensions/hash/deck.hash.js"></script> | ||
<script src="deck.js/extensions/menu/deck.menu.js"></script> | ||
<script src="deck.js/extensions/goto/deck.goto.js"></script> | ||
<script src="deck.js/extensions/status/deck.status.js"></script> | ||
<script src="deck.js/extensions/navigation/deck.navigation.js"></script> | ||
|
||
<!-- Initialize the deck. You can put this in an external file if desired. --> | ||
<script> | ||
$(function() { | ||
$.deck('.slide'); | ||
}); | ||
</script> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
deck.js Support for Asciidoc | ||
============================= | ||
:author: Qingping Hou | ||
:email: <[email protected]> | ||
:description: an example for writing deck.js presentation with asciidoc | ||
:revdate: 2011-12-16 | ||
:revnumber: 0.1 | ||
/////////////////////// | ||
themes that you can choose includes: | ||
web-2.0, swiss, neon | ||
/////////////////////// | ||
:deckjs-theme: neon | ||
/////////////////////// | ||
transitions that you can choose includes: | ||
fade, horizontal-slide, vertical-slide | ||
/////////////////////// | ||
:deckjs-transition: vertical-slide | ||
|
||
|
||
== What is deck.js? | ||
|
||
*deck.js* is a JavaScript library for building modern HTML | ||
presentations. *deck.js* is flexible enough to let advanced CSS | ||
and JavaScript authors craft highly customized decks, but also | ||
provides templates and themes for the HTML novice to build a | ||
standard slideshow. | ||
|
||
== How to generate deck.js with Asciidoc | ||
|
||
It's just as simple as issusing following command: | ||
|
||
........................................... | ||
asciidoc -f deck.js.conf file.asciidoc | ||
........................................... | ||
|
||
|
||
== Shortcuts | ||
Folloing are built-in deck.js shortcuts: | ||
|
||
* jump to any slide by given number, `g`. | ||
* preview all slides, `m`. | ||
|
||
|
||
== Syntax (basic) | ||
|
||
This part assumes that you are already familiar with some basic | ||
concepts in AsciiDoc. | ||
|
||
* slides are divided by *level 1* sections. | ||
* lists | ||
|
||
........................................... | ||
* entry1 | ||
* entry2 | ||
* entry3 | ||
........................................... | ||
|
||
* you can choose theme and transition effect by specifying the *deckjs-theme* and *deckjs-transition* attributes: | ||
|
||
........................................... | ||
:deckjs-theme: neon | ||
:deckjs-transition: vertical-slide | ||
........................................... | ||
|
||
|
||
////////////////////////////////////////////////////// | ||
* ordered list | ||
........................................... | ||
1. entry1 | ||
1. entry2 | ||
1. entry3 | ||
........................................... | ||
A complete guide for lists can be found at http://www.methods.co.nz/asciidoc/userguide.html#X64[this page] | ||
////////////////////////////////////////////////////// | ||
|
||
== Syntax (nested slide) | ||
|
||
Nested slide (or subslide) give you the ability to create substeps in slides. In this backend, elements marked by *incrementa* option will be paused before show up. | ||
|
||
syntax: | ||
|
||
........................................... | ||
[options="incremental"] | ||
* this entry should be the first to show up | ||
* this entry should show up following the first one | ||
* this entry should be the last one | ||
........................................... | ||
|
||
effect: | ||
|
||
[options="incremental"] | ||
* this entry should be the first to show up | ||
* this entry should show up following the first one | ||
* this entry should be the last one | ||
|
||
|
||
== Syntax (code block) | ||
syntax: | ||
|
||
........................................... | ||
........................................... | ||
int swallow_redpill () { | ||
unsigned char m[2+4], rpill[] = "\x0f\x01\x0d\x00\x00\x00\x00\xc3"; | ||
*((unsigned*)&rpill[3]) = (unsigned)m; | ||
((void(*)())&rpill)(); | ||
return (m[5]>0xd0) ? 1 : 0; | ||
} | ||
........................................... | ||
........................................... | ||
|
||
effect: | ||
|
||
........................................... | ||
int swallow_redpill () { | ||
unsigned char m[2+4], rpill[] = "\x0f\x01\x0d\x00\x00\x00\x00\xc3"; | ||
*((unsigned*)&rpill[3]) = (unsigned)m; | ||
((void(*)())&rpill)(); | ||
return (m[5]>0xd0) ? 1 : 0; | ||
} | ||
........................................... | ||
|
||
== Syntax (quote block) | ||
QuoteBlocks syntax from Asciidoc is fully supported, you can find complete guide on http://www.methods.co.nz/asciidoc/userguide.html#_quote_blocks[this page]. | ||
|
||
syntax: | ||
|
||
........................................... | ||
[quote, L. Kronecker] | ||
___________________________________________ | ||
God made the natural number and all the rest is the work of man | ||
___________________________________________ | ||
........................................... | ||
|
||
effect: | ||
|
||
[quote, L. Kronecker] | ||
___________________________________________ | ||
God made the natural number and all the rest is the work of man | ||
___________________________________________ | ||
|
||
|
||
== Syntax (insert image) | ||
|
||
syntax: | ||
........................................... | ||
image::http://www.gnu.org/graphics/gnu-head-sm.jpg[title="Texinfo"] | ||
........................................... | ||
|
||
effect: | ||
|
||
image::http://www.gnu.org/graphics/gnu-head-sm.jpg[title="Levitating GNU"] | ||
|