Open sriramab opened 6 years ago
For the Github Wiki I'm afraid that it's impossible (mainly because we can't do any design more than the MarkDown Structure of the file). But I'm working on it for the gama-platform website :)
Since we moved to Docusaurus V2, CodeBlocks are rendered using the Prism engine (source).
It's not easier to implement, but it's a famous tool in JS world and used by Ghost, MDN, etc; so it may be easy to extend it to other usages (like, maybe, a plugin for GitHub Highlight library :smile: ).
I won't work on it any time soon, but if anyone wants to do it, feel free to help :wink: It can either be a PR on the main project, or just a language extension added only on the website
Hi @RoiArthurB ,
Please find below a very small js tentative for GAML (rename it as .js). prism-gaml.txt
If GAMA produces such a file you can use it on the website?
Hi @benoitgaudou ,
You're quick implementation does work good, see below :
Before | After |
---|---|
So if you can generate this file from GAMA, I'll be easily able to integrate it during the website compilation 👌
I also made the branch syntax-gaml to work on it :)
Thanks! I am not so impressed by the after version : it was supposed to highlight the statement names also ... but get italic instead, I guess it is mainly due to the css ... Thanks for the integration and for the branch.... but how to use this new branch ? I can produce the website by myself locally ?
@benoitgaudou
I am not so impressed by the after version : it was supposed to highlight the statement names also ... but get italic instead, I guess it is mainly due to the css ...
Yes, we probably can also tweak the color theme or badly used the syntax to just have appropriate colors on the wiki 🤷 But it's minor tweaking in my point of view :)
Thanks for the integration and for the branch.... but how to use this new branch ? I can produce the website by myself locally ?
Yes you can, it's a little tricky so either we can do it together, otherwise it's mostly following step-by-step the github action here : https://github.com/gama-platform/gama-platform.github.io/blob/sources/.github/workflows/github-travis.yml
You'll need to have Python3, pip (package manager for Python), NodeJS, yarn (or npm; both package managers for NodeJS) and bash - I know it's a bit heavy and complex 😅😅
Re-opening to work on full Github's syntax support color (forgot that initial issue request 🙈)
Hi,
I have been wondering if it is possible to have some custom gaml highlighting for code blocks in github markdown. For example, if you use a code block
code block
with a language preference for r , it highlights r keywords as belowor for python as below:
or java as below:
Is it possible to create a custom syntax highlight for gaml language on github markdown? I do not know how easy or difficult it is, but could be nice in sharing or exhibiting code on github tutorials.