Skip to content

deck.js backend templates for Asciidoctor, implemented in Haml

Notifications You must be signed in to change notification settings

asciidocfx/asciidoctor-deck.js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 

Repository files navigation

deck.js Backend for Asciidoctor

The deck.js backend is a collection of Haml templates for Asciidoctor that transform an AsciiDoc document into HTML5 slides animated by deck.js.

Usage Instructions

  1. Ensure Asciidoctor, Haml and all their dependencies are installed:

    $ gem install asciidoctor tilt thread_safe haml
  2. Clone the asciidoctor-deck.js repository to get the templates necessary for converting AsciiDoc source to HTML slides:

    $ git clone https://github.com/asciidoctor/asciidoctor-deck.js
  3. Edit CONTENT_FILE ( *.adoc or *.ad or …​):

    • Slides & content per slide

    • (Optional) Set presentation options at top of CONTENT_FILE. The options available & their values will depend on presentation library (some examples below).

      :${Attribute}: ${Value}
  4. Generate HTML from the Asciidoctor templates

    1. Command Line:

      $ asciidoctor -T templates/haml CONTENT_FILE
    2. Build Script: use Ruby, JavaScript, Gradle or your favorite build tool/script with presentation options

  5. Copy or clone presentation library (to output destination/branch)

    $ git clone https://github.com/imakewebthings/deck.js
Tip
If you are using GitHub Pages, plan ahead by keeping your source files on master branch and all output files on the gh-pages branch.

Additional Notes

  • If you are planning to split your slides you also need to copy to extensions directory the deck.split.js file which can be downloaded from GitHub

  • If you want to use the fullscreen photo feature, you must create an images directory.

Source Examples

Let’s see some examples of deckjs backend features:

= Title Slide
Presenter Name

== Slide One

Foo

Bar

World

[canvas-image=./images/cosplay.jpg]
== Slide Two

[.canvas-caption, position=center-up]
Hello World - Good Bye Cruel World

In the previous snippet, we are creating a slide titled “Slide One” with bullets and another one titled “Slide Two” with centered text (the default behavior of deck.js) with speaker notes.

Some things to consider:

  • The canvas-image attribute receives as a parameter the location of image we want to use and always must go before the section.

  • If you are planning to add a message over the image, you can do it as usually, but probably won’t be read good, using position attribute which positions text into the slide (bottom-left, top-left, bottom-right, top-right, center-up, center-down) and canvas-caption role will improve so much how text is rendered.

== Another Slide

[%step]
That's all.

[%step]
My Folks

In previous example we are creating one slide which instead of showing both paragraphs at the same time, will be presented each time you try to go to next slide.

And the same can be applied to lists, images, quotes, code:

== Yet Another Slide

[%step]
* A
* B
* C

In this case, each bullet will appear to screen each time you try to go to next slide.

Warning
The original deckjs backend for AsciiDoc used the option name incremental instead of step. We’ve changed it here to save you some typing :)

deck.js Options

There are some attributes that can be set at the top of the document which they are specific of deckjs backend.

Attribute Value(s) Description

:deckjs_theme:

none, web-2.0, swiss, neon

where you set the deck.js theme.

:deckjs_transition:

none, horizontal-slide, vertical-slide, fade

where you set the kind of transition.

:customjs:

<javascript folder>

where you set a custom javascript file. It can be used as a deck.js custom configuration.

:customcss:

<css folder>

where you set a custom css file.

:navigation:

N/A

the presence of this attribute makes deck.js to render a back/next icons.

:status:

N/A

the presence of this attribute makes deck.js to render current slide and total number of slides.

:split:

N/A

with this attribute we are registering the deck.split.js file.

Note
You can also specify a custom stylesheet using the stylesheet attribute, which can be used to customize AsciiDoc elements like section, paragraph, images, etc…​

Stay Connected

If you need any other feature supported by deckjs to be ported to this backend, any way to make it better or you find any bug, do not hesitate to open an issue.

About

deck.js backend templates for Asciidoctor, implemented in Haml

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 99.3%
  • Ruby 0.7%