speakernotes filter

← Back to Filter List


↓ examples

Companion to slides filter which helps generate speaker notes.

Aliases for this filter

  • speakernotes

Converts from file formats:

  • .*

To file formats:

  • .html

Available settings:

add-new-filesBoolean or list of extensions/patterns to match.False
added-in-versionDexy version when this filter was first available.1.0.7
additional-doc-filtersFilters to apply to additional documents created as side effects.{}
additional-doc-settingsSettings to apply to additional documents created as side effects.{}
comment-charLines starting with this comment char will not show up in slides.;
comment-markdownComment chars ; are replaced with this markdown. Use None to hide comments.> *
data-typeAlias of custom data class to use to store filter output.generic
examplesTemplates which should be used as examples for this filter.['slides']
exclude-add-new-filesList of patterns to skip even if they match add-new-files.[]
exclude-new-files-from-dirList of directories to skip when adding new files.[]
extFile extension to output.None
extension-mapDictionary mapping input extensions to default output extensions.None
extensionsWhich Markdown extensions to enable.{'nl2br': {}}
helpHelpstring for plugin.Companion to slides filter which helps generate speaker notes.
input-extensionsList of extensions which this filter can accept as input.['.*']
keep-originalsWhether, if additional-doc-filters are specified, the original unmodified docs should also be added.False
mkdirA directory which should be created in working dir.None
mkdirsA list of directories which should be created in working dir.[]
nodocWhether filter should be excluded from documentation.False
outputWhether to output results of this filter by default by reporters such as 'output' or 'website'.False
output-extensionsList of extensions which this filter can produce as output.['.html']
override-workspace-exclude-filtersIf True, document will be populated to other workspaces ignoring workspace-exclude-filters.False
preserve-prior-data-classWhether output data class should be set to match the input data class.False
require-outputShould dexy raise an exception if no output is produced by this filter?True
slide-footerContent to append to end of each slide.
slide-headerContent to prepend to start of each slide.
splitString to use to split slides.
tagsTags which describe the filter.[]
variablesA dictionary of variable names and values to make available to this filter.{}
varsA dictionary of variable names and values to make available to this filter.{}
workspace-exclude-filtersFilters whose output should be excluded from workspace.['pyg']
workspace-includesIf set to a list of filenames or extensions, only these will be populated to working dir.None

Slides Filter

The slides filter takes markdown content, like this:

# My Presentation

## This is a header

Some paragraph text

## Another slide

- foo
- bar
- baz

and lets you generate slides using javascript/css slide presentation tools such as impress.js or deck.js. Just leave 2 blank lines to indicate a new slide (this is configurable with the split setting).

Here is the HTML generated by the slides filter with default settings:

<section class="slide">
<h1>My Presentation</h1>

<section class="slide">
<h2>This is a header</h2>
<p>Some paragraph text</p>

<section class="slide">
<h2>Another slide</h2>

The default settings work for deck.js.

Here is a dexy configuration which inserts content from the slides.md source (as shown above) into a deck.html file which is a deck.js template:

- deck.html|jinja:
    - slides.md|jinja|slides:
        - output: False

Here are the resulting deck.js slides:

To use the slides filter with other presentation tools, change the slide-header and slide-footer settings to whatever each slide needs to be wrapped with. Here are settings which work with impress.js:

- impress.html|jinja:
    - impress.md|jinja|slides:
        - output: False
        - slides: {
            slide-header: "<div class=\"slide step\" id=\"slide%(number)s\">",
            slide-footer: "</div>"

These header and footer strings are run through python string interpolation before they are wrapped around the content of each slide. Currently there is one variable available to this interpolation named number which gives you the slide number, starting with slide 1.

Here are the resulting impress.js slides:

Filter Source Code
class MarkdownSpeakerNotesFilter(MarkdownSlidesFilter):
    Companion to slides filter which helps generate speaker notes.
    aliases = ['speakernotes']

    _settings = {
            'added-in-version' : '1.0.7',
            'comment-markdown' : ("Comment chars ; are replaced with this markdown. Use None to hide comments.", "> *")

    def process_text(self, input_text):
        md = self.initialize_markdown()

        if self.setting('comment-markdown') is None:
            comment_regexp = "^%s(.*)$" % self.setting('comment-char')
            comments_removed = re.sub(comment_regexp, "", input_text, flags=re.MULTILINE)
            comment_regexp = "^%s" % self.setting('comment-char')
            comments_removed = re.sub(comment_regexp, self.setting('comment-markdown'), input_text, flags=re.MULTILINE)

        return md.convert(comments_removed)

Content © 2020 Dr. Ana Nelson | Site Design © Copyright 2011 Andre Gagnon | All Rights Reserved.