Hello,
I want to make a parsing extension for Discourse which would change text like say [Hello World!] to
and many other images of this type. Do I need to make any changes to the existing Discourse files or can I just start writing code without making any changes to the existing files.
AI-generated summary
The discussion is about creating a parsing extension for Discourse to convert text into images. R4356th is seeking guidance on how to proceed and whether changes need to be made to existing Discourse files. Johani advises against modifying existing files, recommending the use of a plugin or theme / theme component instead. For this specific feature, a plugin is necessary, and Johani suggests looking at the bbcode plugin source code for inspiration. merefield also recommends checking out the Markdown extensions guide and notes that extensions are typically written in EmberJS and Rails, but JavaScript will likely be sufficient for this project.
Hey and welcome to Meta @R4356th ![]()
No, making changes to Discourse files on your server (in this context) means that you’ll either be unable to update your site or that your changes will be wiped with the next update.
The way to approach this is to either create a plugin or a theme / theme component.
Those are the methods your can use to extend Discourse to match your needs.
For your particular feature, you’ll need a plugin. I recommend taking a look at the source code of the bbcode plugin for inspiration.
https://github.com/discourse/discourse-bbcode
Thank you very much this should help.
Is it to write the parser in PHP?
You might want to look at Developer's guide to Markdown extensions
(In general FYI all Discourse extensions are written in EmberJS and Rails, but you will only need JavaScript here I expect)
Thank you.