10

According to documentation, it should be possible to include *.txt file with help/documentation:

(root)
 +- src                     # Groovy source files
 |   +- org
 |       +- foo
 |           +- Bar.groovy  # for org.foo.Bar class
 +- vars
 |   +- foo.groovy          # for global 'foo' variable/function
 |   +- foo.txt             # help for 'foo' variable/function
 +- resources               # resource files (external libraries only)
 |   +- org
 |       +- foo
 |           +- bar.json    # static helper data for org.foo.Bar

...

The vars directory hosts scripts that define global variables accessible from Pipeline scripts. The basename of each *.groovy file should be a Groovy (~ Java) identifier, conventionally camelCased. The matching *.txt, if present, can contain documentation, processed through the system’s configured markup formatter (so may really be HTML, Markdown, etc., though the txt extension is required).

Unfortunately it hasn't worked for me by simply creating *.txt with some arbitrary content.

Am I missing something? Or does Global Shared Library doesn't shown documentation in usual Jenkins places: enter image description here

luka5z
  • 7,525
  • 6
  • 29
  • 52
  • 2
    Apparently it works just fine, but it reappeared just after first build with this library completed. – luka5z Dec 15 '16 at 10:46
  • 1
    My custom step's documentation is appended to the list in the 'pipeline-syntax/globals' section for a project which has just sucessfully used it. However the HTML tags appears as text, and the documentation doesn't say which markdown formatting is expected? – simon.watts Jan 24 '18 at 12:05
  • 1
    @simon.watts You need to enable a Markup Formatter on the jenkins security configuration as described [here](https://stackoverflow.com/a/33821442/2249614) – Fabian Braun Sep 26 '18 at 11:15

1 Answers1

3

Please note that the PipelineSyntax/Global Variables Reference page is ONLY updated when the pipeline's run is successful. And therefore ONLY for this pipeline (and not any others).

Here's a link!

Stephen Rauch
  • 47,830
  • 31
  • 106
  • 135