Open lanthaler opened 10 years ago
... and Kingsley's +1
:+1: i could help with adding N3.js which can run both in node.js and browser!
+1 I think this would help a lot
+1
The first problem is that the examples are just snippets. Not completely valid JSON-LD. The second problem is that the comments are often important and that it’s not easy to preserve them when automatically converting to a different syntax. Last but not least, the module you mentioned doesn’t output “nice” Turtle, it outputs N-Triples (in this case). So, summarized, at the moment I don't see how it would be possible to automate this translation.
What about extracting the comments as regular paragraphs and make the examples fully functional snippets?
We add a bit of misdirection but the examples will be more realistic and changing syntax will be no problem.
How about always including full examples in code block but then use html comments and js rendering to hide those not relevant parts and show inline comments in json?
I would see it as 3 tabs
BTW rdf-ext soon may output nice Turtle, which will make writing such script much simpler! https://github.com/bergos/rdf-ext/issues/6
I think it might actually be simpler to just convert the examples to Turtle manually instead of inventing some complex markup structure. That being said, if you have time to work on this I would definitely be interested in it.
For consistency, manual conversion might not be optimal. Maybe better to wait until the spec is final?
_Raised by @rubenverborgh on the mailing list:_
Meta-remark: did you consider giving the examples in Turtle? You would reach a broader audience that way.
[...]
For instance, my understanding is quite slowed down by the syntax. You could add some JavaScript to the page that can toggle between Turtle and JSON-LD, if you want to maintain JSON-LD as well. (Just a thought.)