hakimel / reveal.js

The HTML Presentation Framework
https://revealjs.com
MIT License
67.77k stars 16.64k forks source link

Markdown example doesn't produce multiple slides. #2840

Closed rustysys-dev closed 3 years ago

rustysys-dev commented 3 years ago

The example shows a single section with a textarea element that produces 3 slides. Here is the implementation using the basic install.

<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

    <title>reveal.js</title>

    <link rel="stylesheet" href="dist/reset.css">
    <link rel="stylesheet" href="dist/reveal.css">
    <link rel="stylesheet" href="dist/theme/black.css" id="theme">

    <!-- Theme used for syntax highlighted code -->
    <link rel="stylesheet" href="plugin/highlight/monokai.css" id="highlight-theme">
</head>

<body>
    <div class="reveal">
        <div class="slides">
            <section data-markdown>
                <textarea data-template>
                    ## Slide 1
                    A paragraph with some text and a [link](http://hakim.se).
                    ---
                    ## Slide 2
                    ---
                    ## Slide 3
                </textarea>
            </section>
        </div>
    </div>

    <script src="dist/reveal.js"></script>
    <script src="plugin/notes/notes.js"></script>
    <script src="plugin/markdown/markdown.js"></script>
    <script src="plugin/highlight/highlight.js"></script>
    <script>
        // More info about initialization & config:
        // - https://revealjs.com/initialization/
        // - https://revealjs.com/config/
        Reveal.initialize({
            hash: true,
            plugins: [RevealMarkdown, RevealHighlight, RevealNotes]
        });
    </script>
</body>

</html>

this produces the following.

image

I have followed the instructions, what might be going wrong?

manuelbb-upb commented 3 years ago

Try adding data-separator="---" to the section tag. Had the same problem. Does not seem to be the dafault anymore?

rustysys-dev commented 3 years ago

thanks that works for me!