logo

redcarpet filter

← Back to Filter List

redcarpet


Converts github-flavored markdown to HTML using redcarpet.

Aliases for this filter

  • redcarpet
  • ghmd

Converts from file formats:

  • .md
  • .txt

To file formats:

  • .html

Available settings:

SettingDescriptionDefault
add-new-filesBoolean or list of extensions/patterns to match.False
added-in-versionDexy version when this filter was first available.1.0.1
additional-doc-filtersFilters to apply to additional documents created as side effects.{}
additional-doc-settingsSettings to apply to additional documents created as side effects.{}
argsArguments to be passed to the executable.
check-return-codeWhether to look for nonzero return code.True
clargsArguments to be passed to the executable (same as 'args').
command-stringThe full command string.%(prog)s %(args)s "%(script_file)s" %(scriptargs)s
data-typeAlias of custom data class to use to store filter output.generic
envDictionary of key-value pairs to be added to environment for runs.{}
examplesTemplates which should be used as examples for this filter.[]
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.[]
executableThe executable to be runredcarpet
extFile extension to output.None
extension-mapDictionary mapping input extensions to default output extensions.None
helpHelpstring for plugin.Converts github-flavored markdown to HTML using redcarpet.
initial-timeout10
input-extensionsList of extensions which this filter can accept as input.['.md', '.txt']
keep-originalsWhether, if additional-doc-filters are specified, the original unmodified docs should also be added.False
make-dummy-outputWhether to make a dummy output file when one is not generated and add-new-files is True.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
parse-autolinkautolink option from redcarpetTrue
parse-disabled-indented-code-blocksdisabled-indented-code-blocks option from redcarpetFalse
parse-fenced-code-blocksfenced-code-blocks option from redcarpetTrue
parse-highlighthighlight option from redcarpetTrue
parse-lax-spacinglax-spacing option from redcarpetTrue
parse-no-intra-emphasisno-intra-emphasis option from redcarpetTrue
parse-quotesquotes option from redcarpetTrue
parse-space-after-headersspace-after-headers option from redcarpetTrue
parse-strikethroughstrikethrough option from redcarpetTrue
parse-subscriptsubscript option from redcarpetTrue
parse-superscriptsuperscript option from redcarpetTrue
parse-tablestables option from redcarpetTrue
parse-underlineunderline option from redcarpetTrue
path-extensionsstrings to extend path with[]
preserve-prior-data-classWhether output data class should be set to match the input data class.False
pygmentsPygments syntax highlighting (requires ananelson/redcarpet fork).False
record-varsWhether to add code that will automatically record values of variables.False
render-filter-htmlfilter-html option from redcarpetFalse
render-hard-wraphard-wrap option from redcarpetFalse
render-no-imagesno-images option from redcarpetFalse
render-no-linksno-links option from redcarpetFalse
render-no-stylesno-styles option from redcarpetFalse
render-prettifyprettify option from redcarpetFalse
render-safe-links-onlysafe-links-only option from redcarpetFalse
render-with-toc-datawith-toc-data option from redcarpetFalse
render-xhtmlxhtml option from redcarpetFalse
require-outputShould dexy raise an exception if no output is produced by this filter?False
scriptargsArguments to be passed to the executable.
tagsTags which describe the filter.[]
timeout10
use-wdWhether to use a custom working directory when running filter.True
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.{}
version-commandCommand to call to return version of installed software.None
windows-version-commandCommand to call on windows to return version of installed software.None
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
write-stderr-to-stdoutShould stderr be piped to stdout?False
Filter Source Code
class Redcarpet(SubprocessStdoutFilter):
    """
    Converts github-flavored markdown to HTML using redcarpet.
    """
    aliases = ['redcarpet', 'ghmd']
    _settings = {
            'added-in-version' : '1.0.1',
            'executable' : 'redcarpet',
            'input-extensions' : [".md", ".txt"],
            'output-extensions' : [".html"],
            # parse options
            'parse-autolink' : ("autolink option from redcarpet", True),
            'parse-disabled-indented-code-blocks' : ("disabled-indented-code-blocks option from redcarpet", False),
            'parse-fenced-code-blocks' : ("fenced-code-blocks option from redcarpet", True),
            'parse-highlight' : ("highlight option from redcarpet", True),
            'parse-lax-spacing' : ("lax-spacing option from redcarpet", True),
            'parse-no-intra-emphasis' : ("no-intra-emphasis option from redcarpet", True),
            'parse-quotes' : ("quotes option from redcarpet", True),
            'parse-space-after-headers' : ("space-after-headers option from redcarpet", True),
            'parse-strikethrough' : ("strikethrough option from redcarpet", True),
            'parse-subscript' : ("subscript option from redcarpet", True),
            'parse-superscript' : ("superscript option from redcarpet", True),
            'parse-tables' : ("tables option from redcarpet", True),
            'parse-underline' : ("underline option from redcarpet", True),
            # render options
            'render-filter-html' : ("filter-html option from redcarpet", False),
            'render-no-images' : ("no-images option from redcarpet", False),
            'render-no-links' : ("no-links option from redcarpet", False),
            'render-no-styles' : ("no-styles option from redcarpet", False),
            'render-safe-links-only' : ("safe-links-only option from redcarpet", False),
            'render-with-toc-data' : ("with-toc-data option from redcarpet", False),
            'render-hard-wrap' : ("hard-wrap option from redcarpet", False),
            'render-prettify' : ("prettify option from redcarpet", False),
            'render-xhtml' : ("xhtml option from redcarpet", False),
            # other options
            'pygments' : ("Pygments syntax highlighting (requires ananelson/redcarpet fork).", False)
            }
  
    def command_string(self):
        args = self.command_string_args()

        args['parse_args'] = " ".join("--%s" % name for name in args if name.startswith("parse-") and args[name])
        args['render_args'] = " ".join("--%s" % name for name in args if name.startswith("render-") and args[name])

        other_args = ['pygments']
        args['other_args'] = " ".join("--%s" % name for name in other_args if args[name])

        return "%(prog)s %(parse_args)s %(render_args)s %(other_args)s %(script_file)s" % args

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