-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Add full Markdown support for use in browsing, creating, and editing projects and addons #139
Comments
From the module side there's two c based libraries for commonmark:
Edited: See https://github.com/commonmark/cmark/blob/master/src/main.c#L75 for an example program. |
I have written a cmark github module. It takes commonmark input and outputs html. https://github.com/godot-extended-libraries/cmark_gfm |
To write a walker for markdown to bbcode, this is how you do it. void
usage_example(cmark_node *root) {
cmark_event_type ev_type;
cmark_iter *iter = cmark_iter_new(root);
while ((ev_type = cmark_iter_next(iter)) != CMARK_EVENT_DONE) {
cmark_node *cur = cmark_iter_get_node(iter);
// Do something with `cur` and `ev_type`
}
cmark_iter_free(iter);
} I would create a Edited: |
@greenfox1505 is investigating markdown/commonmark to RichTextLabel via the module I posted. |
https://github.com/fire/godot/tree/cmark was able do a patch
Wasn't able to do markdown/commonmark to richtextlabel as rich text. |
My branch changed to https://github.com/v-sekai/godot/tree/cmark. |
I don't know what state this is in but https://github.com/V-Sekai/godot/tree/vsk-cmark-4.2 is my current work branch. I wasn't able to work on the rich text code but its salvageable |
Describe the project you are working on:
Designing solutions (either for editor changes or an addon) that involve browsing and displaying data regarding third-party addons.
Describe the problem or limitation you are having in your project:
Markdown README files are an industry-standard resource for sharing project information. Creators need to be able to edit and preview (render) them, and users need to be able to view (render) them. The Asset Library could then be refactored to render Markdown files (related to #12).
Describe how this feature / enhancement will help you overcome this problem or limitation:
Show a mock up screenshots/video or a flow diagram explaining how your proposal will work:
This would be similar to how VS Code's Extensions tab looks. Below is an example for #12 on how things could appear in the Asset Library if refactored to display Markdown files.
.
In fact, @fenix-hub's TextEditor plugin already has a dedicated viewport with an editor and previewer for Markdown files, so it would be an excellent starting place for creating an extension to the built-in ScriptEditor that does the same.
Raw .md file:
WIP conversion to rendered content (will eventually have headers, online images, etc.):
Describe implementation detail for your proposal (in code), if possible:
/editor/markdown_editor.h
class for editing Markdown files and integrate it into the ScriptEditor./editor/markdown_renderer.h
class for rendering a Markdown file's contents.If this enhancement will not be used often, can it be worked around with a few lines of script?:
Most of the community using any sort of addon (either creating OR using) would use this, so almost everyone.
Yes, this could be done as a plugin in script code. No, it would not be just a few lines. It would be a huge amount of work just to create a well-written editor and renderer pair.
Is there a reason why this should be core and not an add-on in the asset library?:
Yes. The ScriptEditor integration portion is something that can only properly be done with direct editor modifications in the source code.
Furthermore, we are talking about an industry-standard text format. It should be built into the editing experience for all users, without the need for a plugin.
The text was updated successfully, but these errors were encountered: