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

Markdown support for script editor. #19220

Closed
toger5 opened this issue May 28, 2018 · 7 comments
Closed

Markdown support for script editor. #19220

toger5 opened this issue May 28, 2018 · 7 comments

Comments

@toger5
Copy link
Contributor

toger5 commented May 28, 2018

Background:
there is a fairly big conversation about how addons will work #19178 (sub scene system)
I expect this to result in a more solid addon/plugin system -> more plugin use.
So I thought it would be amazing if there is markdown support inside the editor to show the readme files of the addons which will/should contain information on how to use the addon.
As a result addons kind of have their own documentation inside the editor. But in general it is amazing to have a readme welcome page in projects.

The idea is that markdown will get converted to becode and than a similar system to the docs/editor_help will be used to display it as a script inside the script editor.

Current state:

  • I have code the markdown to bbcode converter.
  • I also have an idea how I would like to structure the rest of this feature.
    • first there will be a new resource called rawText with a ResourceLoader
    • Than there will be a markdown resource which inherits from it.
    • The script editor now has a function called edit which takes a Script Resource as a parameter to than decide which script editor should be used. This function would get changed to just take a Resource. Than the script editor can run checks on the object passed, if it is a Script It opens the according script_editor. (visual, gdscript, mono....) if it is a rawText it opens a pure text editor just to edit the file. but if it is a markdown it shows the file in a RichTextLabel using the same styles than the in editor docs. and using a convert too bbcode function on the markdown resource.
    • I'm still not sure how to deal with markdown class. The issue is:
      • A script does not have to be a text file, visual script, but a markdown/rawText file has none of the script properties except being a Text file. So there is an issue how to build up the inheritance tree.
        I cannot inherit script from rawText because that would make no sense for visual scripts. But inheriting a markdown file from a script also makes no sense because it is not a script/has no script capabilities.
    • another method would be to just add new functions to the script editor to handle .md files and add a function that adds the appropriate editor to it without the edit method (the same way it is done with the help at the moment)

I would really appreciate any feedback, if this feature is desired. I also need advice where the new Classes should be added.
Current approach:

  • markdown.h + cpp inside a module
  • rawText (with it's loader) inside scene/resources
  • handlng the editing of the md and rawText files directly inside EditorPlugin.
  • the needed editor extending form script_editor_base are two new files one for rawText and one for markdown (don't know in which folder to put them)
@vnen
Copy link
Member

vnen commented May 28, 2018

Relate to #1390

@toger5
Copy link
Contributor Author

toger5 commented May 31, 2018

To sum up:
Most of the tings i mentioned were solved,

So this issue now only contains the actual markdown editor implementation!

@Anutrix
Copy link
Contributor

Anutrix commented Jul 6, 2019

This could help in the implentation.

@Jeremi360
Copy link

@Pilvinen
Copy link

@toger5 What's the status on this? Are you still working on it? Should I make my own implementation?

@toger5
Copy link
Contributor Author

toger5 commented Nov 13, 2019

@Pilvinen No i am not working on it anymore. Would be cool if you can add some solution!

@Calinou
Copy link
Member

Calinou commented May 26, 2020

Feature and improvement proposals for the Godot Engine are now being discussed and reviewed in a dedicated Godot Improvement Proposals (GIP) (godotengine/godot-proposals) issue tracker. The GIP tracker has a detailed issue template designed so that proposals include all the relevant information to start a productive discussion and help the community assess the validity of the proposal for the engine.

The main (godotengine/godot) tracker is now solely dedicated to bug reports and Pull Requests, enabling contributors to have a better focus on bug fixing work. Therefore, we are now closing all older feature proposals on the main issue tracker.

If you are interested in this feature proposal, please open a new proposal on the GIP tracker following the given issue template (after checking that it doesn't exist already). Be sure to reference this closed issue if it includes any relevant discussion (which you are also encouraged to summarize in the new proposal). Thanks in advance!

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

No branches or pull requests

6 participants