GuntherRademacher / rr

RR - Railroad Diagram Generator
Apache License 2.0
467 stars 51 forks source link

Feature Request: Comment all that is not extracted #7

Open e-gaulue opened 3 years ago

e-gaulue commented 3 years ago

First, thanks a lot to share this nice job.

I use your tool to describe a grammar that is in between computing and true language. I managed to do almost everything I needed.

But I want to use it as a documentation. I mean, I want to put classical HTML before and after elements.

As far as I've seen, your tool can extract elements from URL. But it removes the rest. You can make your changes and then regenerate but hence, you have to put all your "documentation" back and it's not easy.

It would be great if we could use special markup in our HTML page to keep the content as comments that would be rendered as HTML by your "view diagram".

I mean:

/!*
<h1> Title 1 </h1>
<p> lorem ipsum....</p>
!*/

Grammar ::= Production*
Production ::= NCName '::=' ( Choice | Link )
NCName ::= [http://www.w3.org/TR/xml-names/#NT-NCName]
Choice ::= SequenceOrDifference ( '|' SequenceOrDifference )*

/!*
<h1> Title 2 </h1>
<p> lorem ipsum....</p>
!*/

...

Would render:

<!--RR-begin Here begin an html zone-->
<h1> Title 1 </h1>
<p> lorem ipsum....</p>
<!--RR-end Here end an html zone-->

Rendering of EBNF

<!--RR-begin Here begin an html zone-->
<h1> Title 2 </h1>
<p> lorem ipsum....</p>
<!--RR-end Here end an html zone-->

...

Which in turns could be again extracted to:

/!*
<h1> Title 1 </h1>
<p> lorem ipsum....</p>
!*/

Grammar ::= Production*
Production ::= NCName '::=' ( Choice | Link )
NCName ::= [http://www.w3.org/TR/xml-names/#NT-NCName]
Choice ::= SequenceOrDifference ( '|' SequenceOrDifference )*

/!*
<h1> Title 2 </h1>
<p> lorem ipsum....</p>
!*/

...

It would be so practical to edit and modify our documentation.

Best regards,