4 ms·
One example of when generating from source can make for a less than ideal experience is the Monaco editor's documentation[0]. - Most modules don't have intro s
by sdegutis 8y ago
One example of when generating from source can make for a less than ideal experience is the Monaco editor's documentation[0].
- Most modules don't have intro sections to guide you to where you might want to start looking for the most common tasks. You have to guess the kinds of names they might have chosen for the given tasks. Turns out customizing syntax highlighting is mainly done with setMonarchTokensProvider and not setTokensProvider.
- Many methods or classes have redundant docstrings, like how setLanguageConfiguration[1] says "Set the editing configuration for a language" or setTheme() says "Switches to a theme."
- To find out what you can do with instances of a code editor, you don't click "monaco.editor" in the right sidebar like I kept thinking. Instead, you'd click the create() method on that page, and click through to its return type, which is actually IStandaloneCodeEditor.
- The search field only searches on exact prefixes of the basename. This isn't exactly a generate-from-code problem but a typedoc UI issue that led me to just download the code and use search-in-project instead (within VS Code ironically enough).
Fortunately, for the most common tasks, the Monaco playground[2] and Monarch playground[3] were helpful in pointing me to the right direction. So that offsets some of these annoyances. But I actually switched away from generating bland documentation via typeoc for my app, and started using a custom documentation generator that allows me to structure my app's docs in a way that is more human-friendly.
[0] https://microsoft.github.io/monaco-editor/api/index.html https://microsoft.github.io/monaco-editor/api/index.html
[1] https://microsoft.github.io/monaco-editor/api/modules/monaco.languages.html#setlanguageconfiguration https://microsoft.github.io/monaco-editor/api/modules/monaco...
[2] https://microsoft.github.io/monaco-editor/playground.html https://microsoft.github.io/monaco-editor/playground.html
[3] https://microsoft.github.io/monaco-editor/monarch.html https://microsoft.github.io/monaco-editor/monarch.html