Skip to content

Commit

Permalink
Merge pull request #28 from opendevise/jetty-block-docs
Browse files Browse the repository at this point in the history
add documentation for the jetty block extension
  • Loading branch information
jmcc0nn3ll authored May 16, 2024
2 parents cb1c0ba + e9f0c04 commit 0b25407
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions lib/jetty-block.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,39 @@ const MAIN_CLASS = {
10: 'org.eclipse.jetty.tests.hometester.RunJetty',
}

/**
* This extension introduces a custom literal block named jetty to the AsciiDoc syntax.
*
* Usage:
*
* [jetty%nowrap]
* ....
* [jetty]
* setupModules=code:example$jetty-modules/jvm.mod,code:example$jetty-modules/postgresql.mod
* setupArgs=--add-modules=server,http,postgresql,jvm
* args=--list-config
* ....
*
* When this block is encountered, the contents are passed to the RunJetty class provided by the
* Jetty project. This main class sets up Jetty and runs it with the specified parameters. The
* extension then captures the filtered output from that main class and uses it as the contents of a
* new literal block, which it then returns. Any options set on the jetty block (e.g., %nowrap) will
* be passed through to this new block.
*
* The contents of the jetty block must be sequential lines of key=value pairs with an optional
* [jetty] opening line for labeling. The supported keys are as follows: setupModules, setupArgs,
* args, and highlight. The setupModules key is used to enable additional Jetty modules before
* running Jetty. The setupArgs keys is used to run Jetty before capturing the output. The args key
* is used to run Jetty when capturing the output. The highlight key is used to apply AsciiDoc
* formatting to the output. AsciiDoc attribute references are permitted in the value of any key.
*
* This extension will only process the contents of the jetty block if the jetty-home attribute
* points to a Jetty home directory and the run-jetty-classpath attribute contains a valid classpath
* for running the RunJetty main class. If these attributes are not set appropriately, the extension
* will return a plain literal block. This is where the optional [jetty] label comes in handy.
*
* To print the RunJetty command, run Antora with the logging level set to info.
*/
function createExtensionGroup (context) {
return function () {
let jettyHome, runJettyClasspath
Expand Down

0 comments on commit 0b25407

Please sign in to comment.