danielgtaylor / aglio

An API Blueprint renderer with theme support that outputs static HTML
4.75k stars 481 forks source link

The members section doesn't render encoded hyphens (%2D) and the description is missing #137

Closed tciuro closed 9 years ago

tciuro commented 9 years ago

Check the following snippet:

+ filter (optional, string) ... blah
    + Members
        + non%2Dfoo - description goes here
        + with%2Dbar%2Dresults - description goes here

Rendered results:

screen shot 2015-07-22 at 11 40 05 am

The spec seems to imply that each choice can contain a description:

+ <parameter name>: `<example value>` (<type> | enum[<type>], required | optional) - <description>

    <additional description>

    + Default: `<default value>`

    + Members
        + `<enumeration value 1>` - <enumeration description 1>
        + `<enumeration value 2>` - <enumeration description 2>
        ...
        + `<enumeration value N>` - <enumeration description N>

Please note that the URI is being rendered fine if it contains encoded hyphens (%2D).

tciuro commented 9 years ago

I just discovered that if I wrap the string with the hyphen using back ticks, it gets rendered well:

+ filter (optional,enum[string])
    + Members
        + `non-foo` - This is A
        + `with-bar-results` - This is B

screen shot 2015-07-22 at 12 05 44 pm

Not that This is A and This is B are not being rendered at all.

danielgtaylor commented 9 years ago

@tciuro Thanks for noticing this. I'll be fixing the %-encoded display of choices shortly. As for the choice description, the default theme has no way of displaying those at the moment. This may be a feature I look into adding in the future.