api-console icon indicating copy to clipboard operation
api-console copied to clipboard

getMarkdownHeaders "headers" regex null

Open jeppe1990 opened this issue 10 years ago • 4 comments

I have a RAML file: cusersjbdocumentsraml1stexperiment raml_-_su_2016-03-31_13-27-26

But the documentation section in api console doesn't show the content; just the titles: api_console_ _google_chrome_2016-03-31_13-29-54

I narrowed down the problem to the getMarkdownHeaders function: api_console_ _google_chrome_2016-03-31_13-32-21

If I change the function so that headers = true it throws a few exceptions but it shows the content of the documentation: api_console_ _google_chrome_2016-03-31_13-35-33

Which isn't exactly pretty.

Are there some special characters I need to put in the beginning of my content?

PS: I have virtually zero experience with Regex.

jeppe1990 avatar Mar 31 '16 11:03 jeppe1990

Hi @jeppe1990, thanks for looking into this, @juancoen, @xaka, can you guys give me a hand looking over this?

dmartinezg avatar Mar 31 '16 12:03 dmartinezg

Hi @jeppe1990, that function tries to match Markdown headers (lines starting with #) to display them as sub-sections below each title of the documentation. If no headers are found, to see the content of a documentation section, a user has to click on the title (in your example, clicking on Home will display the content of that documentation section).

I've flagged this as a UX improvement as it can be confusing.

Thanks!

juancoen avatar Apr 01 '16 13:04 juancoen

In the image I included showing the UI ("home" and "legal") I actually clicked on the Home tab before making the screenshot. There is simply no text, if markdown headers are not present. I believe that this must be a mistake since the RAML spec concerning the documentation section only use plain text and no specific markdown syntax in the "content" section (it's simply text): RAML spec concerning User documentation In other words, for text to show up in the documentation section of API Console it seems that text must contain symbols, that are not required by the RAML spec. That's not really a problem if this was evident in the API Console documentation.

jeppe1990 avatar Apr 04 '16 06:04 jeppe1990

Fixed with https://github.com/mulesoft/api-console/commit/c74eacde58e40d1d79c4885b15fa3ff210b6610c

jarrodek avatar Jun 27 '17 17:06 jarrodek