This package is abandoned and no longer maintained. No replacement package was suggested.

Simple bundle that uses Reveal.js and Symfony to make maintainable presentations

Installs: 396

Dependents: 0

Suggesters: 0

Security: 0

Stars: 4

Watchers: 30

Forks: 3

Open Issues: 3


dev-master 2017-10-16 18:59 UTC

This package is auto-updated.

Last update: 2022-09-23 13:37:33 UTC


Build Status


This bundle aims to simplify slides maintenance by keeping them in Markdown or HTML templates. If you have very few slides, you might be better using only Reveal.js, but in case you have hundreds of slides it could be useful.

Reveal.js is a javascript library to impress your new audience with nifty transitions and stuff.


Just add the bundle to your project

composer require knplabs/knp-reveal-bundle 'dev-master'

Register the bundle:

// app/AppKernel.php

public function registerBundles()
    $bundles = array(
        // ...
        new Knp\RevealBundle\KnpRevealBundle(),
    // ...

Dump assets:

app/console assets:install


Creating a presentation

Just add a new Controller using SlideTrait and define a directory where you will store the slides.


namespace Knp\AppBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Knp\RevealBundle\Controller\SlideTrait;

class FooController extends Controller
    use SlideTrait;

    public function getSlidesDirectory()
        return "@KnpAppBundle/Resources/views/Foo";

And corresponding route :

    pattern:  /foo
    defaults: { _controller: KnpAppBundle:Foo:slides }

Adding slides

Just add some templates in your presentation's template directory, for example @KnpAppBundle/Resources/views/Foo/01.title.html.twig :

    <h1>My super Foobar presentation</h1>
    <h2>Offered to you by KNPLabs</h2>

Html helper

You can extends the html base slide to use various helpers.

{% extends 'KnpRevealBundle:Slide:slide.html.twig' %}

{% block content %}
    <h1>My super Foobar presentation</h1>
    <h2>Offered to you by KNPLabs</h2>
{% endblock %}

Markdown helper

In the same way, you can extends the md base slide.

{% extends '' %}

{% block content %}
# My super Foobar presentation

## Offered to you by KNPLabs
{% endblock %}

More customization

Section attributes

If you want to set section's attributes, like background or transition, do it with the section_attributes block.

{% extends '' %}

{% block section_attributes %}
    data-background="{{ asset('/bundles/knpapp/fromnovicetoninja/images/002_edgar_city.png') }}"
    data-background-position="bottom right"
{% endblock %}

{% block content %}
# My super Foobar presentation

## Offered to you by KNPLabs
{% endblock %}

Using reveal

Best way to understand reveal is to see the reveal presentation.