Skip to content

Commit

Permalink
initial commit, first demo
Browse files Browse the repository at this point in the history
  • Loading branch information
houqp committed Dec 15, 2011
0 parents commit 77fd427
Show file tree
Hide file tree
Showing 8 changed files with 379 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.swp


3 changes: 3 additions & 0 deletions .gitmodules
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
13 changes: 13 additions & 0 deletions Makefile
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

35 changes: 35 additions & 0 deletions README.md
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.


4 changes: 4 additions & 0 deletions THANKS
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
5 changes: 5 additions & 0 deletions TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
* subslides(nested slides) support

* highlight codes

* video support
162 changes: 162 additions & 0 deletions deckjs.conf
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">&#8592;</a>
<a href="#" class="deck-next-link" title="Next">&#8594;</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>




154 changes: 154 additions & 0 deletions example.asciidoc
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"]

0 comments on commit 77fd427

Please sign in to comment.