Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate markdown files automatically #232

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open

Conversation

j-f1
Copy link
Contributor

@j-f1 j-f1 commented Jul 28, 2020

I transcribed the human-readable markdown files into spec.estree then adapted estree-formal to make a script to parse it back into markdown documents.

There’s also the ability to generate JSON and TypeScript output, although it’s not being used at this time.

If you agree that this is a good direction, I can also look into generating the other es-version files with only the changes included.

Closes #209. Closes #208.

View rendered ES5 spec
View full rendered spec

@j-f1
Copy link
Contributor Author

j-f1 commented Jul 28, 2020

An overview of the spec.estree syntax:

  • it’s mostly additive on top of the old syntax; the only thing that’s been removed is comment support.
  • Add an @added([year], [proposal-slug]) decorator to almost anything to indicate it was added in that version (or use @es6 for ES6)
  • Add an @section(level1 > level2 > ....) decorator to an interface to place it under a given heading. The default is to place it under a heading named for the first parent interface
  • Add an @at-root decorator to an interface to place it at the top level
  • Add an @headerless decorator to suppress creating a header (and section) for this interface
  • Add a “comment” (using // syntax on one or more lines) before a key in an interface or the interface itself to add human-readable documentation.

@j-f1
Copy link
Contributor Author

j-f1 commented Jul 28, 2020

Another note: it would be easy to generate versions of the es2015es2020 files that contain the entire spec as of that version instead of just the diffs by changing one function parameter in index.js. Outputting only the new/changed things should be possible but requires a bit more work.

j-f1 added 3 commits July 28, 2020 18:25
This reverts commit 2729ade.
This reverts commit cc52484.
@j-f1
Copy link
Contributor Author

j-f1 commented Aug 4, 2020

I'm not the person who is going to be maintaining the specs for years to come, so if you have any suggestions for changes to the syntax, I would be happy to implement them.

@nzakas
Copy link
Contributor

nzakas commented Aug 5, 2020

Wow, this is intriguing. I think we're trying to figure out how to move forward with spec-year versions right now, so we will follow up here once we've resolved the direction. Thanks so much for this.

Copy link
Contributor

@JLHwung JLHwung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@j-f1
Copy link
Contributor Author

j-f1 commented Sep 8, 2020

Any opinions on what should be done with the versioned Markdown files? Should they contain the entire spec as of that version or should I figure out how to make them just contain the relevant changes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A single specification?
3 participants