tech-angels / vandamme

A Changelog parser (NOT MAINTAINED ANY MORE)
http://tech-angels.github.com/vandamme/
MIT License
214 stars 22 forks source link

Allow any level header, not just H1 #3

Closed sferik closed 11 years ago

sferik commented 11 years ago

Here's an example of a CHANGELOG that uses an H2 instead of an H1 in the header: https://raw.github.com/wycats/thor/master/CHANGELOG.md

I can't think of any reason why this should not be supported. The spec should just require that there be a header row (any level, 1 through 6).

sferik commented 11 years ago

Here's another example that uses H2s: https://raw.github.com/intridea/hashie/master/CHANGELOG.md

H1 is reserved for the title of the document. I believe this use case is pretty common and should be supported.

gonzoyumo commented 11 years ago

Goot catch! but I though HTML5 allows multiple H1? Will dig into this and the markup rules to ensure we respect hierarchy

gravis commented 11 years ago

We could, but if we allow all levels of header + optional date, the regexp will match too many things, because only thing left will be /#+ ([0-9.A-Za-z-]+) \/ \d{4}-\d{2}-\d{2}/ In the provided changelog, there's no h1, so it's a semantic issue, more than parsing.

nathany commented 11 years ago

What about supporting just H1 & H2? /^#{1,2}... or if not that, just switching outright to H2?

As @sferik says, H1 is generally the heading for the document, eg. # Changes or h1. Changes.

Regarding HTML5, there is a <header> tag that would allow multiple H1s in a single page. But since we're using Markdown, Textile, etc, I don't think that really changes anything regarding this request.

fnichol commented 11 years ago

Very glad to see this (H2 support)!