asterisk / documentation

The Asterisk Documentation Project.
https://docs.asterisk.org/
Other
27 stars 24 forks source link

Note parsing does not parse end note #65

Closed InterLinked1 closed 6 months ago

InterLinked1 commented 6 months ago

https://docs.asterisk.org/Asterisk_21_Documentation/API_Documentation/Dialplan_Functions/CHANNEL/

The note starting at "If not specified, 'audio' is used by default." is never closed.

Looking at the underlying XML documentation in channels/pjsip/dialplan_functions_doc.xml, it appears to be correct (the note is properly closed):

<enumlist>
    <enum name="audio">
        <para>Retrieve information from the audio media stream.</para>
        <note><para>If not specified, <literal>audio</literal> is used
        by default.</para></note>
    </enum>
    <enum name="video">
        <para>Retrieve information from the video media stream.</para>
    </enum>
</enumlist>
seanbright commented 6 months ago

The full contents of the !!! note admonition (same with !!! warning) needs to have the same amount of leading indentation as the surrounding list items for this to render properly. Right now we put it all at the beginning of a line during the XSLT processing.

gtjoseph commented 6 months ago

I think switching to the /// admonition style might fix this because it doesn't require the leading spaces in the first sentence and it has a closing /// delimiter. It looks like this...


/// info | Some Title
<any text>
///

I'll try it.
gtjoseph commented 6 months ago

Nope made things worse. I think not using the admonitions at all may be better. Just using **Note: <note text>** would look like this when used in an enum/param list...

image

When used in normal text, it'd look like this...

image

What do you think?

seanbright commented 6 months ago

I think the admonitions look better but whatever you think is best.

InterLinked1 commented 6 months ago

Nope made things worse. I think not using the admonitions at all may be better. Just using **Note: <note text>** would look like this when used in an enum/param list...

image

When used in normal text, it'd look like this...

image

What do you think?

I liked having a red block for warnings, like in the old docs, since they're mot distinguished than just boldface, but if there's not an easy way to retain that, I guess it is what it is.

gtjoseph commented 6 months ago

I'll take another pass at it tomorrow and see if I can keep the admonitions but still get them to render correctly in both lists and regular paragraphs.

gtjoseph commented 6 months ago

Sorry guys, I don't think there's a way to make admonitions work when they're inside enum lists without serious xslt work and imposing stricter rules on the XML itself. I'll continue to research though.

gtjoseph commented 6 months ago

OK, I think I got it figured out. Checkout the PR and build it if you want to test, otherwise I'll merge it on Wednesday.