Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tasmo/reveal-jekyll

Online presentation for GitHub Pages and Jekyll in Markdown using reveal.js with a Solarized Color Theme
https://github.com/tasmo/reveal-jekyll

dark-theme github-page jekyll light-theme markdown presentation reveal-js solarized-colors

Last synced: about 1 month ago
JSON representation

Online presentation for GitHub Pages and Jekyll in Markdown using reveal.js with a Solarized Color Theme

Awesome Lists containing this project

README

        

# reveal-jekyll

Transforms Markdown files into presentation slides using [reveal.js](#revealjs) and [Jekyll](#jekyll). The theme is based on [Solarized Colors](https://github.com/altercation/solarized) (by Ethan Schoonover) containing a light and a dark theme.
**reveal-jekyll** is ready for [GitLab Pages](https://docs.gitlab.com/ee/user/project/pages/) as well as [GitHub Pages](https://pages.github.com/).

[![Build Status](https://travis-ci.org/tasmo/reveal-jekyll.svg?branch=master)](https://travis-ci.org/tasmo/reveal-jekyll)

Try the **[DEMO presentation](https://tasmo.gitlab.io/reveal-jekyll)** (how to use Jekyll written in German).

- [Get `reveal-jekyll` running](#get-reveal-jekyll-running)
- [Hosted on GitLab Pages](#hosted-on-gitlab-pages)
- [Hosted on GitHub Pages](#hosted-on-github-pages)
- [Local Jekyll](#local-jekyll)
- [Write Your Slides](#write-your-slides)
- [Personalize](#personalize)
- [Start Your Slide Show](#start-your-slide-show)
- [reveal.js](#revealjs)
- [Jekyll](#jekyll)
- [Differences and Limitations](#differences-and-limitations)
- [Slide Attributes](#slide-attributes)
- [Fragments](#fragments)
- [Vertical Slides](#vertical-slides)
- [Configuration](#configuration)
- [Code Syntax Highlighting](#code-syntax-highlighting)
- [Slide Numbers](#slide-numbers)
- [Speaker Notes](#speaker-notes)
- [Runtime Dependencies for Development](#runtime-dependencies-for-development)
- [Licenses](#licenses)

## Get `reveal-jekyll` running

### Hosted on GitLab Pages

To see how it works follow the [Tutorial: Create a GitLab Pages website from scratch](https://docs.gitlab.com/ee/user/project/pages/getting_started/pages_from_scratch.html).

#### As a User or Organization Site on GitLab

To set up a user or organization site `https://${yourname}.gitlab.io/`, fork [reveal-jekyll](https://gitlab.com/tasmo/reveal-jekyll) and name your fork with your user or organization name like `https://gitlab.com/${yourname}/${yourname}.github.io`. Your site will build off the `main` branch.

#### As a Project Site on GitLab

To set up a project site `https://${yourname}.gitlab.io/${projectname}`:

- Fork as above, but name your fork with whatever `${projectname}` you want.
- In [\_config.yml](./_config.yml) change `baseurl: ""` to `baseurl: /${projectname}`. This is [needed](https://byparker.com/blog/2014/clearing-up-confusion-around-baseurl/) to construct asset include and internal link URLs correctly when you are serving your site from a non-root path.

#### For an Existing Repository on GitLab

- Clone your repository.
- Go into it.
- Add [reveal-jekyll](https://github.com/tasmo/reveal-jekyll) as an upstream remote.
- Create an empty branch named like `pages`.
- Delete all cached files of your new `pages` branch from git.
- Clean the directory from uncached files.
- Merge [`reveal-jekyll/main`](https://gitlab.com/tasmo/reveal-jekyll/-/tree/main) with your `${repository}/pages` branch.

```shell
git clone [email protected]/${yourname}/${repository}.git
cd ${repository}
git remote add upstream https://gitlab.com/tasmo/reveal-jekyll.git
git checkout --orphan pages
git rm --cached -r .
git clean -fdx
git merge upstream/main
```

---

### Hosted on GitHub Pages

Follow the instructions on [get started with GitHub Pages](https://pages.github.com/).

#### As a User or Organization Site on GitHub

To set up a user or organization site `https://${yourname}.github.io/`, fork [reveal-jekyll](https://github.com/tasmo/reveal-jekyll) and name your fork with your user or organization name like `${yourname}.github.io`. Your site will build off the main branch.

#### As a Project Site on GitHub

To set up a [project site](https://help.github.com/articles/user-organization-and-project-pages/#project-pages) `https://${yourname}.github.io/${projectname}`:

- Fork as above, but name your fork with whatever `${projectname}` you want.
- Your site will build from the `gh-pages` branch, so you should [set that as the default branch](https://help.github.com/articles/setting-the-default-branch/).
- In [\_config.yml](./_config.yml) in your `gh-pages` branch change `baseurl: ""` to `baseurl: /${projectname}`. This is [needed](https://byparker.com/blog/2014/clearing-up-confusion-around-baseurl/) to construct asset include and internal link URLs correctly when you are serving your site from a non-root path.

#### For an Existing Repository on Github

- Clone your repository.
- Go into it.
- Add [reveal-jekyll](https://github.com/tasmo/reveal-jekyll) as an upstream remote.
- Create an empty branch named `gh-pages`.
- Delete all cached files of your new `gh-pages` branch from git.
- Clean the directory from uncached files.
- Merge [reveal-jekyll](https://github.com/tasmo/reveal-jekyll)/master with your `${repository}/gh-pages`.

```shell
git clone [email protected]/${yourname}/${repository}.git
cd ${repository}
git remote add upstream https://github.com/tasmo/reveal-jekyll.git
git checkout --orphan gh-pages
git rm --cached -r .
git clean -fdx
git merge upstream/main
```

---

### Local Jekyll

Install [RubyGems](https://rubygems.org/pages/download) for your system.

Clone [reveal-jekyll](https://github.com/tasmo/reveal-jekyll) with submodule reveal.js (recommended):

```shell
git clone --recursive --depth 1 https://github.com/tasmo/reveal-jekyll.git
```

…or just download the [zip file](https://gitlab.com/tasmo/reveal-jekyll/-/archive/main/reveal-jekyll-main.zip).

Make sure you have a `Gemfile` in the root of your project containing at least:

```ruby
source "https://rubygems.org"

gem 'github-pages'
```

Install [Bundler](https://bundler.io/) and the dependencies:

```shell
gem install bundler \
bundle install
```

---

### Write Your Slides

Put your Markdown slides in the `_posts` folder [like in any Jekyll](https://jekyllrb.com/docs/posts/) instance.
Name the files in numbered order or dated following a pattern like `YEAR-MONTH-DAY-TITLE.md`:

```text
2014-1-1-start.md
2014-1-1-intro.md

2014-3-2-third-topic-second-slide.md

2014-9-8-end.md
2014-9-9-very-last-slide.md
```

Write the slide's header in [Front-matter](https://jekyllrb.com/docs/frontmatter/) and put the Markdown formatted content below. In the header you need at least the `layout: slide` attribute:

```markdown
---
layout: slide
title:
---

MARKDOWN_FOMATTED_SLIDE_CONTENT
```

### Personalize

In the `_config.yml` give your slide show an name, author's name and a description:

```yml
title: reveal-jekyll
author: Thomas Friese
description: Reveal.js for Jekyll with Solarized Color theme
```

### Start Your Slide Show

On GitLab/GitHub Pages you are done. Just open your pages URL in your browser.

An your local machine run:

```shell
bundle exec jekyll serve
```

…and go to `https://127.0.0.1:4000/`.

---

## [reveal.js](https://lab.hakim.se/reveal-js/)

A framework for easily creating beautiful presentations using HTML.

[reveal.js](https://github.com/hakimel/reveal.js) comes with a broad range of features including [nested slides](https://github.com/hakimel/reveal.js#markup), [markdown contents](https://github.com/hakimel/reveal.js#markdown), [PDF export](https://github.com/hakimel/reveal.js#pdf-export), [speaker notes](https://github.com/hakimel/reveal.js#speaker-notes) and a [JavaScript API](https://github.com/hakimel/reveal.js#api). It's best viewed in a browser with support for CSS 3D transforms but [fallbacks](https://github.com/hakimel/reveal.js/wiki/Browser-Support) are available to make sure your presentation can still be viewed elsewhere.

### Links for reveal.js

- [Installation](#installation): Step-by-step instructions for getting reveal.js running on your computer.
- [Changelog](https://github.com/hakimel/reveal.js/releases): Up-to-date version history.
- [Examples](https://github.com/hakimel/reveal.js/wiki/Example-Presentations): Presentations created with reveal.js, add your own!
- [Browser Support](https://github.com/hakimel/reveal.js/wiki/Browser-Support): Explanation of browser support and fallbacks.
- [Instructions](https://github.com/hakimel/reveal.js#instructions) How to use reveal.js.
- [MIT License](https://github.com/hakimel/reveal.js/blob/master/LICENSE)

## [Jekyll](https://jekyllrb.com/)

[Jekyll](https://github.com/jekyll/jekyll) is a simple, blog-aware, static site generator perfect for personal, project, or organization sites. Think of it like a file-based CMS, without all the complexity. Jekyll takes your content, renders Markdown and Liquid templates, and spits out a complete, static website ready to be served by Apache, Nginx or another web server. Jekyll is the engine behind [GitHub Pages](https://pages.github.com), which you can use to host sites right from your GitHub repositories.

### Links for Jekyll

- [Getting Started](https://github.com/jekyll/jekyll#getting-started) If you don't know Jekyll yet.
- [Runtime Dependencies](https://github.com/jekyll/jekyll#runtime-dependencies)
- [MIT License](https://github.com/jekyll/jekyll/blob/master/LICENSE)
- [Contributors](https://github.com/jekyll/jekyll/graphs/contributors)

## Differences and Limitations

### Slide Attributes

Attributes to the slide `` elements are written in the [Front-matter](https://jekyllrb.com/docs/frontmatter/):

```markdown
---
layout: slide
title: Background Transitions
data:
transition: linear
background: 'red'
background-transition: slide
---
```

### Fragments

Markdown fragments must be covered in a HTML block element using the attribute `markdown="1"`:

```html


# Markdown Heading

Fragment 1 text


Fragment 2 text

```

Fragments can be nested.

### Vertical Slides

For vertical scrolling you need to leave the `title:` blank. All content on vertical slides must be wrapped in HTML `` blocks:

```html
---
layout: slide
title:
---

# Top Slide

# Bottom Slide

```

### Configuration

All options for the reveal.js presentation are available in the `_config.yml` as sub keys of `reveal:`.

The configuration will be built in the `` block at the bottom of the `index.html` presentation file.

### Code Syntax Highlighting

To insert a highlighted code block the code can be surrounded with the [Liquid](https://shopify.github.io/liquid/) tag `highlight`:

```liquid
{% highlight coffee %}
# Objects:
math =
root: Math.sqrt
square: square
cube: (x) -> x * square x
{% endhighlight %}
```

Insted of Rouge for highlighting the code, reveal-jekyll uses the [Reveal.js's preferred method](https://revealjs.com/code/) via [highlight.js](https://highlightjs.org/). To use all options it is possible to surround the code with HTML nodes `pre` and `code` using the class `language-*` adding optional `data` tags:

```html



# Objects:
math =
root: Math.sqrt
square: square
cube: (x) -> x * square x

```

### Slide Numbers

You can show slide numbers by selecting a format in the `_config.yml` file:

```coffee
slideNumber:
# Slide number formatting can be configured using these variables:
# "h.v": horizontal . vertical slide number (default)
# "h/v": horizontal / vertical slide number
# "c": flattened slide number
# "c/t": flattened slide number / total slides
# "none": don't show slide numbers
format: "c/t"
```

### Speaker Notes

reveal.js comes with a speaker notes plug-in which can be used to present per-slide notes in a separate browser window. The notes window also gives you a preview of the next upcoming slide so it may be helpful even if you haven't written any notes. Press the 's' key on your keyboard to open the notes window.

Notes are defined by appending an `` element to a slide as seen below. You can add the `markdown="1"` attribute to the aside element if you prefer writing notes using Markdown:

```html
---
layout: slide
---

Slide text...

Oh hey, these are some notes. They'll be hidden in your presentation, but you can see them if you open the speaker notes window (hit 's' on your keyboard).

```

When used locally, this feature requires that reveal.js [runs from a local web server](https://github.com/hakimel/reveal.js#full-setup).

---

## Runtime Dependencies for Development

### Running Jekyll on Your Server

- Commander: Command-line interface constructor (Ruby)
- Colorator: Colorizes command line output (Ruby)
- Classifier: Generating related posts (Ruby)
- Directory Watcher: Auto-regeneration of sites (Ruby)
- Kramdown: Default Markdown engine (Ruby)
- Liquid: Templating system (Ruby)
- Pygments.rb: Syntax highlighting (Ruby/Python)
- Safe YAML: YAML Parser built for security (Ruby)
- Sass: CSS extension language (Ruby)
- CoffeeScript: compiling to JavaScript (Ruby)

### Running reveal.js

Reveal.js doesn't _rely_ on any third party scripts to work but a few optional libraries are included by default. These libraries are loaded as dependencies in the order they appear, for example:

```javascript
Reveal.initialize({
dependencies: [
// Cross-browser shim that fully implements classList - //github.com/eligrey/classList.js/
{ src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } },

// Zoom in and out with Alt+click
{ src: 'plugin/zoom-js/zoom.js', async: true },

// Speaker notes
{ src: 'plugin/notes/notes.js', async: true },

// Remote control your reveal.js presentation using a touch device
{ src: 'plugin/remotes/remotes.js', async: true },

// MathJax
{ src: 'plugin/math/math.js', async: true }
]
});
```

You can add your own extensions using the same syntax. The following properties are available for each dependency object:
- **src**: Path to the script to load
- **async**: [optional] Flags if the script should load after reveal.js has started, defaults to false
- **callback**: [optional] Function to execute when the script has loaded
- **condition**: [optional] Function which must return true for the script to be loaded

---

## Licenses

[Jekyll](https://github.com/jekyll/jekyll): [MIT licensed](https://github.com/jekyll/jekyll/blob/master/LICENSE)

[reveal.js](https://github.com/hakimel/reveal.js): [MIT licensed](https://github.com/hakimel/reveal.js/blob/master/LICENSE)
Copyright (C) 2020 Hakim El Hattab,

[reveal-jekyll](https://github.com/tasmo/reveal-jekyll) contains the third party fonts:

- [Open Sans](https://www.google.com/fonts/specimen/Open+Sans) ([Apache License, version 2.0](https://www.apache.org/licenses/LICENSE-2.0.html))
- [Droid Serif](https://www.google.com/fonts/specimen/Droid+Serif) ([Apache License, version 2.0](https://www.apache.org/licenses/LICENSE-2.0.html))
- [Font Awesome](https://github.com/FortAwesome/Font-Awesome) ([License: SIL OFL 1.1](https://fontawesome.io/license/))
and the color scheme [Solarized Colors](https://github.com/altercation/solarized) ([MIT License](https://github.com/altercation/solarized/blob/master/LICENSE))

[reveal-jekyll](https://gitlab.com/tasmo/reveal-jekyll/): [MIT licensed](https://gitlab.com/tasmo/reveal-jekyll/-/blob/main/LICENSE)