lexical
lexical copied to clipboard
Improve Documentation
Generic Issue for Documentation Improvement.
- [x] Setup autogenerated API Docs
- [ ] Lexical lifecycle overview Resources: https://www.youtube.com/watch?v=EwoS0dIx_OI https://drafts.dio.la/article/lexical-state-updates
- [ ] Example: how to generate HTML from Lexical EditorState
- [ ] Example: how to use Commands/Transformers to disable core functionality
- [x] Example: how to set initial editor state
- [x] Example: how to set up collaborative editing
- [ ] API Docs: lexical
- [x] API Docs: @lexical/clipboard
- [ ] API Docs: @lexical/code
- [ ] API Docs: @lexical/dragon
- [x] API Docs: @lexical/file
- [x] API Docs: @lexical/hashtag
- [x] API Docs: @lexical/headless
- [x] API Docs: @lexical/history
- [ ] API Docs: @lexical/html
- [x] API Docs: @lexical/link
- [x] API Docs: @lexical/list
- [ ] API Docs: @lexical/mark
- [ ] API Docs: @lexical/markdown
- [ ] API Docs: @lexical/offset
- [ ] API Docs: @lexical/overflow
- [ ] API Docs: @lexical/selection
- [ ] API Docs: @lexical/table
- [x] API Docs: @lexical/text
- [x] API Docs: @lexical/utils
- [ ] API Docs: @lexical/yjs
- [ ] API Docs: DecoratorNode
- [ ] API Docs: ElementNode
- [x] API Docs: LexicalEditor
- [x] API Docs: LexicalNode
- [ ] API Docs: LineBreakNode
- [ ] API Docs: NodeSelection
- [ ] API Docs: ParagraphNode
- [x] API Docs: RangeSelection
- [ ] API Docs: RootNode
- [x] API Docs: TextNode
Others?
Working with API Docs
We use typedoc to autogenerate API docs.
Check out what I did here. If you go in and add similar comments to the functions in other files, they'll show up on the website. You can watch for changes and see them live by doing
npm run start:website
The changes will show up in the section you get to by clicking "API" in the site navigation.
Here are the typedoc docs: https://typedoc.org/guides/declaration-references/
I'd add an example with initializing, updating, and persisting state (this should be most common use case)
Ideally I'd like to see JSdoc comments in all exported objects, functions, etc. Using @example
and adding links to documentation is great too for IDE experience.
I would like to see for commands a description of the different priority levels. As a newcomer, it might avoid some confusion. (see #2868 as an example)
I found this file that explains the idea and usage of decorator nodes way better than the documentation. Is there a reason for not having this file integrated in the documentation? Or could I try to merge them with a PR, so we see the information on the documentation?
I found this file that explains the idea and usage of decorator nodes way better than the documentation. Is there a reason for not having this file integrated in the documentation? Or could I try to merge them with a PR, so we see the information on the documentation?
Yea, this is a good idea! I think we just overlooked it.
My idea would be to have a separate subheading under Concepts called "Decorators" that contains this content. Let me know if you need help doing that a PR would be welcome!
um... I know where I write description about API Docs. But I dont know where I write example.
I'm trying npm run start:website
and getting 'TYPEDOC_WATCH' is not recognized as an internal or external command, operable program or batch file.
Any idea how to fix this? I've npm i
to install all dependencies to no avail.
Oh are you running windows? Easiest fix is to go into that script in the package.json and just locally delete TYPEDOC_WATCH. I will try to fix it to run on windows later
um... I know where I write description about API Docs. But I dont know where I write example.
@youngkyo0504 hmmm - I guess there really isn't a place yet. Which example were you thinking of writing?
um... I know where I write description about API Docs. But I dont know where I write example.
@youngkyo0504 hmmm - I guess there really isn't a place yet. Which example were you thinking of writing?
I'd like to write example:how to set initial editor state