Linking to help files in war/src and including dynamic content

21 views
Skip to first unread message

Christopher Orr

unread,
Mar 13, 2016, 7:54:00 PM3/13/16
to jenkin...@googlegroups.com
Hi all,

I’m trying to work on some of the core documentation, and a lot of it seems to be kept away from the core source — in `war/src/main/webapp/help`, where all of the files are HTML-only.

However, for one of these files, I would like to have some documentation followed by some dynamic content — specifically the contents of `Jenkins.getInstance().getMarkupFormatter()?.getDescriptor().getHelpFile()`.

Is there an easy way I can include .jelly content in the `war` directory, which then includes the contents of the markup formatter’s help file (which I can presumably somehow include somehow with `${app.markupFormatter.helpFile}`)?
Or what’s the best way to do this?

Thanks,
Chris

Jesse Glick

unread,
Mar 14, 2016, 10:59:14 AM3/14/16
to Jenkins Dev
On Sun, Mar 13, 2016 at 7:53 PM, Christopher Orr <ch...@orr.me.uk> wrote:
> I’m trying to work on some of the core documentation, and a lot of it seems to be kept away from the core source — in `war/src/main/webapp/help`, where all of the files are HTML-only.

Generally I would consider this a deprecated location; help files
should be moved to their conventional locations:

· `core/src/main/resources/pkg/SomeDescribable/help.html`, for the
object as a whole
· `core/src/main/resources/pkg/SomeDescribable/help-someField.html`,
for a particular property

There are exceptions: help that is not (and cannot easily be)
associated with conventional form binding; or cases where the same
content must be shared between multiple forms.

At any rate, for files in the recommended locations, it is possible to
replace `.html` with `.jelly` and use dynamic content.

Christopher Orr

unread,
Mar 16, 2016, 8:29:26 PM3/16/16
to jenkin...@googlegroups.com
On 14/03/16 15:59, Jesse Glick wrote:
> On Sun, Mar 13, 2016 at 7:53 PM, Christopher Orr <ch...@orr.me.uk> wrote:
>> I’m trying to work on some of the core documentation, and a lot of it seems to be kept away from the core source — in `war/src/main/webapp/help`, where all of the files are HTML-only.
>
> Generally I would consider this a deprecated location; help files
> should be moved to their conventional locations:
>
> · `core/src/main/resources/pkg/SomeDescribable/help.html`, for the
> object as a whole
> · `core/src/main/resources/pkg/SomeDescribable/help-someField.html`,
> for a particular property

Ahh.. ok, it's good to know that it's considered deprecated.


> There are exceptions: help that is not (and cannot easily be)
> associated with conventional form binding; or cases where the same
> content must be shared between multiple forms.

Right, I've seen a bunch of this in core already. Makes sense.


> At any rate, for files in the recommended locations, it is possible to
> replace `.html` with `.jelly` and use dynamic content.

Yup.

Thanks!
Chris


Reply all
Reply to author
Forward
0 new messages