Unit test: programlisting.013

These verbatim listings explicitly use the ‘table’ style.

1 |
  |
  |
  |
5 |
ProgramListing: This is a test
  Only a test.
Had this been a real emegency,
  We would have fled in terror
And you would not have been informed.

A program listing for the language “python” (explicitly).

 1 |
   |
   |
   |
 5 |
   |
   |
   |
   |
10 |
   |
   |
   |
   |
    def _check_arg(self, arg):
        if ":" in arg:
            pos = arg.index(":")
            name = arg[0:pos]
            value = arg[(pos + 1):]
            if name in ("-x", "-y", "-r", "-init"):
                raise JavaClassRunnerException(
                    f"The {arg} option cannot be specified")
            if name == "-catalog":
                self.catalogs.append(value)
                return
            elif name == "-xsl":
                self.stylesheet = arg
        self._app_args.append(arg)

A program listing for the language “xml”

1 |
  |
  |
  |
5 |
  |
  |
<xsl:function name="f:verbatim-trim-trailing" as="xs:boolean">
  <xsl:param name="context" as="element()"/>
  <xsl:variable name="pi" select="f:pi($context, 'verbatim-trim-trailing')"/>
  <xsl:sequence select="if ($pi)
                        then f:is-true($pi)
                        else f:is-true($verbatim-trim-trailing-blank-lines)"/>
</xsl:function>