grammarkdown
grammarkdown copied to clipboard
Feature request: Extract grammarkdown source from ecmarkup
I see there's a grammar for ECMAScript 2020. It'd be nice if grammarkdown provided an option for emitting Grammarkdown source from an Ecmarkup file. Something to the effect of:
$ wget https://raw.githubusercontent.com/tc39/ecma262/es2022/spec.html
$ grammarkdown --extract spec.html
@ line 5012 file:///Users/Alhadis/Desktop/spec.html
StringNumericLiteral :::
StrWhiteSpace?
StrWhiteSpace? StrNumericLiteral StrWhiteSpace?
StrWhiteSpace :::
StrWhiteSpaceChar StrWhiteSpace?
StrWhiteSpaceChar :::
WhiteSpace
LineTerminator
⋮
grammarkdown only has very minimal support for HTML. This is actually something I'd rather see ecmarkup support itself. It's one of the reasons I added @line directives in the first place, though that was primarily motivated by an ecmarkup VS code extension I was working on a few years ago (but have yet to finish, unfortunately).