Skip to content

Commit

Permalink
Docs update for reveal 4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
McShelby committed May 19, 2020
1 parent bb2c71e commit 726b753
Showing 1 changed file with 37 additions and 14 deletions.
51 changes: 37 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
# ThemeOverride

A [reveal.js](https://github.com/hakimel/reveal.js/) plugin to easily change themes of reveal.js and its syntax highlightning.
A [reveal.js](https://github.com/hakimel/reveal.js/) 3.x / 4.x plugin to easily change themes of reveal.js and its syntax highlightning.

## Installation

Copy this repository into the plugins folder of your reveal.js presentation, ie ```plugin/themeoverride```.
Copy this repository into the plugin folder of your reveal.js presentation, ie ```plugin/themeoverride```.

Add the plugin to the dependencies in your presentation, as below.
Add the plugin to the initialization of your presentation, as below.

### reveal 4.x

```javascript
<script src="plugin/themeoverride/themeoverride.js"></script>
// ..
Reveal.initialize({
// ...
plugins: [
// ..
ThemeOverride,
]
});
```

### reveal 3.x

```javascript
Reveal.initialize({
Expand All @@ -18,7 +34,7 @@ Reveal.initialize({
});
```

To be able to override themes, you may need to edit your HTML file.
For **reveal 3.x only** you may need to edit your HTML file to be able to override themes.

- The ```<link>``` element of the reveal.js theme needs an ```id``` attribute of ```theme```.
- The ```<link>``` element of the syntax highlighting theme needs an ```id``` attribute of ```highlight-theme```.
Expand All @@ -34,7 +50,9 @@ To be able to override themes, you may need to edit your HTML file.

The value for this ```id``` is not configurable. It must be ```theme``` and ```highlight-theme``` respectivly otherwise the plugin will not find the stylesheets in your presentation file.

Please remember that no other syntax highlightning themes besides ```zenburn.css``` are shipped with the standard reveal.js package. You may want to install further highlight.js themes from [https://highlightjs.org/](https://highlightjs.org/) into the ```lib/css/``` directory.
### Remark

Please remember that no other syntax highlightning themes besides ```zenburn.css``` are shipped with the standard reveal.js package. You may want to install further highlight.js themes from [https://highlightjs.org/](https://highlightjs.org/) into the same directory as the shipped themes.

## Usage

Expand All @@ -55,14 +73,19 @@ Reveal.initialize({
// ...

// Overrides the theme set in <link> element by the
// given value. If your presentation was copied from reveal.js
// demo.html, everything just works. Otherwise you need to
// set id="theme" on reveal.js theme <link> element.
// given value.
// If your presentation was copied from the reveal.js demo.html,
// everything just works.
// Otherwise you need to set id="theme" on reveal.js theme
// <link> element.
theme: 'serif',

// Overrides the syntax highlightning theme set in <link> element by the
// given value. This only works if you set id="highlight-theme" on the
// <link> element.
// Overrides the syntax highlightning theme set in <link> element
// by the given value.
// For reveal 4.x, if your presentation was copied from the reveal.js
// demo.html, everything just works.
// For reveal 3.x this only works if you set id="highlight-theme"
// on the <link> element.
highlightTheme: 'monokai',
});
```
Expand All @@ -79,11 +102,11 @@ http://example.com/demo.html?theme=serif&highlightTheme=monokai

Values for themes may contain one of the following:

- a style name (eg. ```serif```). The plugin will append ```.css``` to the name and tries to access the file from the directory ```css/theme``` (for reveal.js themes) or ```lib/css``` (for syntax highlightning themes) relative to your reveal.js installation.
- a style name (eg. ```serif```). The plugin will append ```.css``` to the name and tries to access the file from the theme directory of reveal.js or the syntax highlightning theme directory relative to your reveal.js installation.

- a stylesheet filename (eg. ```serif.css```). The plugin will try to access the file from the directory ```css/theme``` (for reveal.js themes) or ```lib/css``` (for syntax highlightning themes) relative to your reveal.js installation.
- a stylesheet filename (eg. ```serif.css```). The plugin will try to access the file from the theme directory of reveal.js or or the syntax highlightning theme directory relative to your reveal.js installation.

- a relative path with filename (eg. ```css/theme/serif.css```). The plugin will try to access the file relative to your reveal.js installation.
- a relative path with filename (eg. ```dist/theme/serif.css```). The plugin will try to access the file relative to your reveal.js installation.

## API

Expand Down

0 comments on commit 726b753

Please sign in to comment.