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

Extending markdown mode codeblocks #5190

Open
2 tasks
cdbdev opened this issue Jun 4, 2023 · 3 comments
Open
2 tasks

Extending markdown mode codeblocks #5190

cdbdev opened this issue Jun 4, 2023 · 3 comments

Comments

@cdbdev
Copy link

cdbdev commented Jun 4, 2023

Extending markdown mode

Hi,

Is it possible to extend the markdown mode to support more languages for codeblocks than the ones listed below:

this.createModeDelegates({
        javascript: require("./javascript").Mode,
        html: require("./html").Mode,
        bash: require("./sh").Mode,
        sh: require("./sh").Mode,
        xml: require("./xml").Mode,
        css: require("./css").Mode
    });

Or is there already a way to do this?

Thank you

Use Case

I'm using markdown for technical documentation on other languages than currently supported

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

ACE version used

Latest

@whazor
Copy link
Contributor

whazor commented Jun 5, 2023

Hi, you could create your own custom mode and extend MarkdownMode, afterwards which you can call this.createModeDelegates again, and it should work. Or if you think the community would benefit from it, you could extend this method in ace/src/mode/markdown.js.

@cdbdev
Copy link
Author

cdbdev commented Jun 5, 2023

Thanks for your answer. So if I understand correctly, I would have to extend the sourcecode and rebuild with nodejs to be able to achieve this?

@akoreman akoreman added the p2 label Oct 24, 2023
@whazor
Copy link
Contributor

whazor commented Feb 1, 2024

Contributing to Ace is actually relatively simple. There is no need to rebuild Ace.

Developing

  1. Run node static.js and open the link that is in the logs
  2. Click on kitchen-sink.html and see the kitchen sink
  3. Edit any of the files, in your case likely src/mode/markdown.js or src/snippets/markdown.snippets.js
  4. Refresh to see your changes

Testing

  1. npm install
  2. npm run test to run the tests

Then you contribute by creating a PR.

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

3 participants