docker icon indicating copy to clipboard operation
docker copied to clipboard

CoffeeScript comments and Markdown

Open Prevole opened this issue 13 years ago • 5 comments

Hi,

I have some problem with the Markdown syntax and the CoffeeScript comments syntax.

When I have something like that:

###
## My Title
###

It will generate a H2 tag correctly rendered but when I do something like this:

###
### My Title
###

I have a syntax error in my editor and the generation of the doc is not possible.

In this tool: https://npmjs.org/package/coffeedoc They address the problem by offering the possibility to escape the # comments like that \#\#\#. As the author said, it is ugly but it works and should be a workaround.

Or maybe there is already a solution that I missed?

Prevole avatar Nov 14 '12 06:11 Prevole

I currently have a workaround to write my titles with Markdown in my CoffeeScripts comments.

# ### My title in H3
###
My Block Comments
###

This works but it does not generate exactly the documentation that will normaly be done when you set the title inside the block comment. It generates the title, a line and the block comment.

Prevole avatar Nov 16 '12 06:11 Prevole

Auch, just got bit by the same feature. Just as I thought I was done writing API docs.

mlangenberg avatar Feb 22 '13 20:02 mlangenberg

+1

switz avatar Mar 18 '13 01:03 switz

+1

forivall avatar Oct 15 '14 18:10 forivall

To overcome this problem I introduced the following syntax in my code tool:

###
#3 Heading level 3
###

The reader will transform this to the correct markdown befor transmormation. The same also goes for headings level 4-6.

The code therefore looks like:

text = text.replace /(\n\s*)#([1-6])(\s+)/, (_, pre, num, post) ->
  "#{pre}#{util.string.repeat '#', num}#{post}"

Maybe a similiar replacement can be added to docker, too.

alinex avatar Jul 26 '16 10:07 alinex