Jira (PDOC-254) @hiera section for putting example hiera

0 views
Skip to first unread message

Eric Putnam (JIRA)

unread,
May 21, 2018, 4:47:02 PM5/21/18
to puppe...@googlegroups.com
Eric Putnam created an issue
 
Puppet Strings / New Feature PDOC-254
@hiera section for putting example hiera
Issue Type: New Feature New Feature
Assignee: Unassigned
Created: 2018/05/21 1:46 PM
Priority: Normal Normal
Reporter: Eric Putnam

Add a @hiera tag for puppet files so example hiera can be displayed with yaml syntax.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Henrik Lindberg (JIRA)

unread,
May 22, 2018, 2:24:03 AM5/22/18
to puppe...@googlegroups.com
Henrik Lindberg commented on New Feature PDOC-254
 
Re: @hiera section for putting example hiera

How would that work? Why is a tag required?

Bernard Bondos (JIRA)

unread,
Aug 7, 2018, 11:14:10 AM8/7/18
to puppe...@googlegroups.com

that would be nice to have, so i can better document usage of hiera keys that are not based on module parameters. tag would be great to get it out in json as separate key.

Matthias Baur (JIRA)

unread,
Jun 5, 2019, 5:48:03 AM6/5/19
to puppe...@googlegroups.com

Sean Millichamp (JIRA)

unread,
Jun 5, 2019, 7:12:03 AM6/5/19
to puppe...@googlegroups.com

I like the idea of a @hiera tag. Though making the example syntax style configurable might be more flexible.

I actually think that there may be two Hiera-related opportunities here:

1) Documenting keys which are used in lookup() calls which aren't class parameters similar to the style of "@param". Maybe the data type could even be sussed out of the lookup() call parameters, if listed.

2) Documenting example Hiera YAML blocks as they would look in the file. This would be more in keeping with the @example tag.

To Henrik Lindberg's question, I'd like to think the value of #1 is self-evident. From a user standpoint "lookup()" only based keys are still parameters which are part of the interface. For #2 most of my day-to-day user base is very familiar with making changes in Hiera/YAML, but they are not as familiar (in some cases, not at all) with Puppet class syntax and examples shown in Puppet class parameter declaration style wouldn't be nearly as meaningful/useful to them.

Matthias Baur (JIRA)

unread,
Jun 5, 2019, 7:23:03 AM6/5/19
to puppe...@googlegroups.com
Matthias Baur commented on New Feature PDOC-254

For #2 most of my day-to-day user base is very familiar with making changes in Hiera/YAML, but they are not as familiar (in some cases, not at all) with Puppet class syntax and examples shown in Puppet class parameter declaration style wouldn't be nearly as meaningful/useful to them.

Exactly the same for us!

Henrik Lindberg (JIRA)

unread,
Jun 5, 2019, 8:12:02 AM6/5/19
to puppe...@googlegroups.com

I would prefer if there was a @lookup tag, and that it would work more or less as @param, i.e. you can state a data type and what it means. Then any yaml examples (or whatever is needed given whichever backend examples are provided for, that just uses the @example tag.

The reason I want "lookup" as tag rather than "hiera" is that it is "lookup" everywhere else (function, CLI, "Automatic Parameter Lookup", etc.) - and that "hiera" is a particular implementation of lookup.

What remains is to decide on what the output looks like - should for example all @param be included again in the lookup section and mixed with those that are explicitly looked up?

Sean Millichamp (JIRA)

unread,
Jun 5, 2019, 8:40:03 AM6/5/19
to puppe...@googlegroups.com

In my perfect world I'd like @lookup (and yes, you're right, a much better name than @hiera) to look and work more or less exactly like @param, near/in the param section. But maybe just auto-tagged with a "Not available as a class parameter" type message. I don't like the re-including all the @param docs again, it seems unnecessarily verbose bordering on confusing for a class with a very large set of parameters.

Even with a @lookup tag, I still feel that there is a need for an additional @example-style tag for YAML-syntax highlighted groups of keys for specific use cases and complex behaviors requiring setting multiple keys to achieve specific results.

Henrik Lindberg (JIRA)

unread,
Jun 5, 2019, 11:30:03 AM6/5/19
to puppe...@googlegroups.com

Sean Millichamp Isn't it possible to just do

 

@example This is a bit of yaml
```yaml
key: value
```
(code}

Matthias Baur (JIRA)

unread,
Jun 5, 2019, 11:53:04 AM6/5/19
to puppe...@googlegroups.com
Matthias Baur commented on New Feature PDOC-254

Henrik Lindberg Nope it isn't, it breaks syntax highlighting. We currently use the following as a workaround:

# @summary My example summary
#
# #### Examples
#
# ```yaml
# classes:
#   - my_example_class
# ```
#
# @param first_parameter Very important parameter

I'm sure why it works, but i shows up in the generate documentation.

Reply all
Reply to author
Forward
0 new messages