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

Codeblock highlight for SPARQL and turtle #704

Open
vemonet opened this issue May 15, 2024 · 1 comment
Open

Codeblock highlight for SPARQL and turtle #704

vemonet opened this issue May 15, 2024 · 1 comment
Labels
enhancement pressing Will fix issue in next release
Milestone

Comments

@vemonet
Copy link

vemonet commented May 15, 2024

Is your feature request related to a problem? Please describe.

When providing example code blocks in turtle or SPARQL the code is not hightlighted which makes it harder to read.

Having built-in highlight for common RDF languages such as SPARQL or turtle would make the examples provided in markdown much easier to read for users

Describe the solution you'd like

I am not sure of how the markdown is processed by widoco (is it done at build time by java?)

The highlight.js npm package would make it possible to add hightlighting for RDF languages, they have support for turtle and SPARQL: https://github.com/highlightjs/highlightjs-turtle

But we would also need to make it work with the markdown processor used by widoco

Describe alternatives you've considered

I did not looked into it deeply but maybe there is already a way for us to inject a npm dependency and a small JS script to enable highlighting without touching the widoco code itself?

Additional context

You might want to make this optional (opt-in with a flag, e.g. --highlightjs), so that only people who uses it. Another option would be to check for the presence of code blocks tagged with sparql or ttl/turtle in provided markdown code and only add the dependencies when such tags are detected

@dgarijo
Copy link
Owner

dgarijo commented May 15, 2024

Hi @vemonet,
the markdown is processed through a javascript library, so your solution makes sense to me.
Will have a look to include the js file when I have the chance! I think the flag may not be needed, it's pretty cool to have rdf highlights by default

@dgarijo dgarijo added this to the v1.4.xx milestone May 15, 2024
@dgarijo dgarijo added the pressing Will fix issue in next release label Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement pressing Will fix issue in next release
Projects
None yet
Development

No branches or pull requests

2 participants