Giter VIP home page Giter VIP logo

jekyll-revealjs's Introduction

jekyll-reveal.js

A Jekyll-based framework for creating presentations based on Reveal.js and Markdown.

Introduction

If you like Reveal.js for creating your online presentations, like the site management Jekyll gives you and like Markdown because of its easy and clean look, here's an easy way to create a presentation using Jekyll, Markdown and Reveal.js.

See the example presentation created using the contents in this repository and jekyll build or docker-compose up.

Howto

First, install Jekyll. After that, clone this repository and create a branch for your new presentation:

git clone --recursive https://github.com/dploeger/jekyll-revealjs.git
git checkout -b presentation1

Clean the Example presentation:

git rm _posts/*
mkdir _posts

After that, add your slides into the _posts subdirectory in clean Markdown syntax and you're ready to build your presentation with Jekyll:

jekyll build

If you don’t have Jekyll installed (but you do have Docker) then you can just run the following to build and serve your changes using a container. Hit ctrl-c to stop the process.

 docker-compose up

You can even manage multiple presentations using the power of Git. Simply branch from the master branch to create a new presentation:

git checkout master
git branch presentation2
git checkout presentation2

Slide filenames

Because we're using Jekyll posts to easily gather the slides for the presentation, we use their filename conventions with the following syntax:

<year>-<month>-<day>-<title>.md

We recommend naming the files like

0000-01-01-welcome.md
0000-01-02-topics.md

and so forth.

Jekyll will assume that each post has been made on the first of January, 2001 (which is of no interest for a presentation). The additional number is for sorting purposes. After that comes a title to identify the specific slide (which is actually only for the presentation author, Jekyll doesn't care about it).

Configuring the presentation

You can configure almost any reveal.js setting using the _config.yml settings file in the root directory.

  • title: The title of your presentation (displayed in the browser's title bar, optional and defaults to your repository’s name thanks to the jekyll-github-metadata plugin)

  • description: A description for your presentation (displayed in the HTML head, optional and defaults to your repository’s description thanks to the jekyll-github-metadata plugin)

  • author: Your name (displayed in the HTML head)

  • reveal_theme: The reveal.js-theme to use [default.css]

  • reveal_transition: The reveal.js-transition to use [default]

  • reveal_theme_path: The path to the reveal.js-theme (can be changed for custom themes) [reveal.js/css/theme/]

  • reveal_notes_server: Whether to support the speaker notes server [false (only local speaker notes)]

  • reveal_options: Additional reveal.js options

  • reveal_dependencies: Additional reveal.js dependencies

  • reveal_path: Path to the reveal.js-installation reveal.js

You can also further customize the presentation:

Specifying reveal options and dependencies

reveal_options can be either a list of strings specifying the JavaScript options, e.g.:

reveal_options:
  - 'width: "960px"'
  - 'height: "720px"'

or, as a convenience, it can be a mapping of options to their values:

reveal_options:
  width: 960px
  height: 720px

Note that if a mapping is passed, the values will be inserted into the final JavaScript as quoted strings. If this is unacceptable (for example, if you want to pass a Boolean parameter that takes true or false), specify a list of strings.

reveal_dependencies takes a list of strings representing the JavaScript to specify a dependency as you would in reveal.js, for example:

reveal_dependencies:
  # Speaker notes
  - "{ src: 'path/to/plugin.js', async: true },"

Custom reveal.js themes

If you want to use your custom reveal.js theme, we recommend adding a directory theme, putting the file(s) there and referencing that directory in the configuration reveal_theme_path.

Don't mess with the reveal.js subdirectory as it is a submodule and doesn't adhere to your repository's branches.

Markdown extensions and simplification

Reveal.js already includes a Markdown interpreter, which we use for jekyll-reveal.js. We have already configured it and included some simplification just for you!

Multiple slides

To use multiple slides in one slide file, use a newline, three dashes and another newline like this:

# Slide 1

This is the content of Slide 1

---

# Slide 2

This is the content of Slide 2

Vertical slides

To use vertical slides, do the same, but use two dashes:

# Slide 1

This is the content of Slide 1

--

And this is a vertical slide below Slide 1

Fragments

Fragments allow slide elements to come one by one. This is often used in lists to subsequently show fragments of a list during a presentation.

jekyll-reveal.js simplifies the reveal.js syntax. To specify the current element as a fragment, use <fragment/> like this:

# Slide

- This <fragment/>
- will <fragment/>
- come one by one <fragment/>

Or, if you find it cleaner, like this:

# Slide

+ This
+ will
+ come one by one

Slide backgrounds

To modify the background of the current slide, jekyll-reveal.js simplifies the syntax to <background>color</background>:

# Slide

<background>white</background>

This slide has a white background

Image backgrounds

You can also set image backgrounds:

# Slide

<backgroundimage>{{ site.github.url }}/images/image.jpg</backgroundimage>
<backgroundimageopacity>0.25</backgroundimageopacity>

This slide has an image background

Note: {{ site.github.url }} expands to the URL of your hosted site, but you could also use remote URLs.

Speaker notes

To include speaker notes, add Note: on a separate line and write your notes below:

# Slide

Some slide content

Note:

This is only displayed in the speaker notes.

SVG Diagrams

You can use mermaid-js to create SVG diagrams.

Once you’ve enabled the feature by setting mermaid_diagrams to true in _config.yml, code like this:

<mermaid>
graph TD;
    A-->B;
    A-->C;
    B-->D;
    C-->D;
    D-->E
</mermaid>

should render like this:

graph TD;
    A-->B;
    A-->C;
    B-->D;
    C-->D;
    D-->E
Loading

You can tweak the height of the diagram by following the closing tag with an element attribute: <!-- .element: style="height: 400px;" -->.

jekyll-revealjs's People

Contributors

dploeger avatar i5ar avatar infotexture avatar mrmanc avatar pganssle avatar phlow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

jekyll-revealjs's Issues

Nested fragment bullets do not render as fragments

Something like this:

+ First
  + Second
     + Third
+ Another First 

renders in two fragments—the second and third points just appear with the first. It should render in four fragments, and I think I can probably adjust the filters in the layout to add the required reveal.js magic to lines which have whitespace and then a +.

Code blocks can’t be fragments

For some reason, this code block fragment does not render properly:

+ What does ‘[Dangit, Git!?!](https://dangitgit.com/)’ say you should do?
  + 
    ```
    git reset HEAD~ --soft
    git stash
    git checkout master
    git stash pop
    git add .
    git commit -m "New message"
    ```

You have do have some text with the fragment, which not be desirable:

+ What does ‘[Dangit, Git!?!](https://dangitgit.com/)’ say you should do?
  + Answer:
    ```
    git reset HEAD~ --soft
    git stash
    git checkout master
    git stash pop
    git add .
    git commit -m "New message"
    ```

Updating reveal.js directory to latest commit fails

Thank you for a great reveal.js slide builder. I've been using this for several months now. If I follow your instructions, I can create a reveal-based slideshow without error. However, I notice the reveal.js directory is out-of-date. To address this, I successfully updated the reveal.js directory from the sha it's pointing to, 8b8cc60 to the latest (as of today), ce8ea84. I then ran the default reveal.js grunt task to prep the reveal.js directory, and added head.min.js from http://headjs.com/site/download.html into reveal.js/lib/js directory and tried to start jekyll s However, after doing so, I am seeing this error; jekyll 2.5.3 | Error: user lambdas.json doesn't exist

This ticket which seems related, suggests adding "exclude: [vendor]" to _config.yaml, but that hasn't helped. I'm guessing this is related to the mustache node module, but I am unclear as to what to try next.

Syntax is wrong for color backgrounds

I made a mistake in #14 when I wrote the replace code for background tags. I should have used <background> and </background> but I used <background/> by mistake. I’ll get a PR raised to resolve at some point. Hopefully, people agree that </background> makes more sense to close the colour definition. I can either do this backwards-compatible or not.

Pygments not supported

GitHub Pages builds with this config currently generate a warning. Switching to rouge resolves this.

The page build completed successfully, but returned the following warning for the master branch:

You are attempting to use the 'pygments' highlighter, which is currently unsupported on GitHub Pages. Your site will use 'rouge' for highlighting instead. To suppress this warning, change the 'highlighter' value to 'rouge' in your '_config.yml' and ensure the 'pygments' key is unset. For more information, see https://help.github.com/articles/page-build-failed-config-file-error/#fixing-highlighting-errors.

For information on troubleshooting Jekyll see:

https://help.github.com/articles/troubleshooting-jekyll-builds

If you have any questions you can contact us by replying to this email.

Description and author are not configurable

I just noticed that the description and author are hard-coded in the layout. I’m guessing you’d be open to a change which made this configurable? Otherwise services like Slack will present the reveal.js tagline rather than something related to the presentation in the snippet alongside a link.

Italic conflicts with fragments

For example, if in one slide I have:

Item one.  <!-- .element: class="fragment" data-fragment-index="1" -->

Item *two*.  <!-- .element: class="fragment" data-fragment-index="2" -->

the word "Item" of element "Item two" will not respect the order of appearance, and will be shown regardless.

Multiple presentations per repository

Single talk per repo

The way this project is currently set up, it seems to assume there will be a single presentation per repository (or branch).

While branches can be used to store multiple talks in the same repo, this requires switching branches and re-running the build/serve commands to switch between talks. This works fine with a local development environment, but breaks down when talks are published via GitHub Pages, which depends on a single branch setting (master, gh-pages or a docs/ folder on the master branch).

How to manage multiple talks?

Users can work around this limitation by cloning or forking the repo for each new presentation, but this seems like overkill when everything except the Markdown content of the presentation would be identical.

The fix for #18 in #27 pulls description and author from the site configuration (rather than hard-coding them in the layout), but this still means only a single value can be specified for each — it just changes the place where this change needs to be made.

The current approach also makes it difficult to integrate this code into other Jekyll sites that already have _posts and pages that are not Reveal.js presentations.

Jekyll collections to the rescue?

I'm wondering whether Jekyll's collections feature could be used to overcome this limitation, so each presentation would be an item in a collection, rather than a post. 🤔

This would enable not only multiple presentations per repository, but also the use of subfolders to structure the collection, for example:

_talks/
├── conference1/
│   └── talk1.md
│   └── talk2.md
├── conference2/
│   └── talk3.md
│   └── talk4.md
└── etc/

Jekyll's collection permalinks could then be used to create a dedicated URL for each presentation, like https://example.com/talks/conference1/talk1/.

I'm not exactly sure how to go about this — and realize it may be out of scope for the original use case — but I'm curious to hear whether this would be useful to others and if anyone has suggestions for how to implement it?

Publish slides as github pages site

I think it would be good to provide a working demo of the slides by changing GitHub Pages to publish the root of master. Currently, the gh-pages branch is used and contains an automatically generated site which doesn’t show off the capability.

I can’t change this myself, I think it is one for @dploeger.

Remote theme doesn’t work due to submodule

The use of a submodule for the reveal.js source means that you can’t use jekyll-remote-theme with this repository, because the submodule doesn’t get included in the zip that the jekyll-remote-theme plugin downloads from GitHub. This is a known issue with GitHub repo zips and submodules. This has been an issue for a while despite people asking GitHub to fix/change it so I see no reason to think it will change.

I did a bit of looking around and it seems that git subtree is an alternative approach that works. The difference as I understand it is that the remote code actually lives in your repo too, rather than it being a pointer to a remote location. I’ve tried this in a fork, and am able to successfully use that fork as a remote theme. There might be a better way to do this with some dependency management but this seemed the easiest solution to me.

Would you be open to a pull request to change the mechanism for including reveal.js? I believe this is safe with reveal.js being under MIT licence.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.