Skip to content

Tag Definition: codesnippet

Generated by rlextra version 3.6.13

Attributes

Name

Required?

Default_Value

Values

language

implied

None

maxLineLength

implied

None

newLineChars

implied

None

splitChars

implied

None

style

implied

None

Can contain
(#PCDATA | name | getName | pageNumber | evalString | loop_i | switch_i | assign_i | if_i | expr)*

Purpose

This lets you display code snippets with syntax highlighting. You will need the Pygments package.

See the relevant rml sample here.

Example usage

    <story>
        <codesnippet language="python">
def example_command(my_var=None):
    print(my_var)

example_command("Test")
        </codesnippet>
    </story>

Note: Only relevant sections are used in this snippet. Some tags were not included. See some of our samples for further insight of how you may go about setting up a full document using rml.

Example of nesting path from the parent tags to the current tag

<document> ➔ <story> ➔ <codesnippet>