-
Notifications
You must be signed in to change notification settings - Fork 16.2k
build: move to the new docs parser #18103
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
Conversation
52ae92e
to
d24c458
Compare
So the diff in the https://gist.github.com/MarshallOfSound/14fdce4022c3453eeb24c7520f0c8356 And here is the actual new file: https://gist.github.com/MarshallOfSound/7773cc6501a303fa6dfb62792d477ba1 |
0f34737
to
4fd63bd
Compare
4fd63bd
to
07c7172
Compare
Co-Authored-By: MarshallOfSound <samuel.r.attard@gmail.com>
Co-Authored-By: MarshallOfSound <samuel.r.attard@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems legit.
Release Notes Persisted
|
* build: move to the new docs parser * chore: remove the bad getTitle param doc * build: update parser/ts gen deps + fix some docs issues highlighted by GH desktop * chore: apply suggestions from code review Co-Authored-By: MarshallOfSound <samuel.r.attard@gmail.com> * chore: update docs for accidentally removed things * chore: update docs/api/command-line.md Co-Authored-By: MarshallOfSound <samuel.r.attard@gmail.com>
Switched from:
electron-docs-linter
-->@electron/docs-parser
electron-typescript-definitions
-->@electron/typescript-definitions
This makes our definition file way better, we don't lose any information in the docs. Noticeably this means markdown, links and code blocks are persisted in the TS definitions. It is also much better under the hood so future improvements / fixes will be much easier. E.g.
readonly
support is in a branch somewhere :)I'm planning on writing a blog post at some point detailing how
@electron/docs-parser
now works. But from a thousand foot view.doc-linter
used to parse the markdown in HTML and then parse the docs as a DOM structure withjquery
and selector querying. This had a few issues the biggest being it was very hard to semantically now what was "inside" a heading when the generated HTML just looks like this:The new
docs-parser
module parses the markdown file into a markdown AST which does know where things start and end so it makes parsing things way easier and it means we can losslessly maintain the markdown in each block without worrying about HTML entities or escaping or anything like that.This PR also fixes a bunch of issues with a current documentation, highlights below.
app.commandLine.*
andapp.dock.*
are now in separate "module" files. Lumping them in withapp.md
over-complicated the parser and the read experience.Event
documentation not havingReturns:
(the magic keyword to document the event properties)-
and:
and\n
so that documentation for properties in deep objects are correctly parsed.Notes: Switched to a new Typescript Definitions generator. This means that some interface names may have changed, if your Typescript build is failing this is the cause.