Does AsciiDoc(tor) allow for extending the language?
Created by: dtu-compute
Looking at the styling options AsciiDoctor supports, it looks almost too good to be true.
- http://asciidoctor.org/docs/asciidoc-writers-guide/
- https://asciidoctor.org/docs/extensions/
- https://github.com/asciidoctor/asciidoctor-extensions-lab#extension-types
Ignore everything below here.
__END__
Editor
https://codemirror.net/ supports AcciiDoc so that could be an option for editor.
https://github.com/asciidoctor/codemirror-asciidoc
Editor with previewer
- http://gist.asciidoctor.org/
- https://github.com/asciidoctor/docgist
- https://github.com/jichu4n/asciidoclive (https://asciidoclive.com/)
HubPress also has a similar editing environment. See https://github.com/HubPress/hubpress.io.
Live preview
I suppose this is the one to use https://github.com/asciidoctor/asciidoctor.js ?
Start here http://asciidoctor.org/docs/install-and-use-asciidoctorjs/
You'll need the opal.js and asciidoctor.js files and some CSS
<script src="opal.js"></script>
<script src="asciidoctor.js"></script>
<link rel="stylesheet" type="text/css" href="themes/asciidoctor.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/3.2.1/css/font-awesome.min.css" />
Then some JavaScript to render the Asciidoctor
var asciidoctorAttributes = Opal.hash2(['attributes'], { 'attributes': ['icons=font@'] }); // by adding the @ symbol, attributes added in line in the asciidoc text takes precedence over this hard-coded attribute
var html_doc = Opal.Asciidoctor.$render(document.getElementById("txtAscii").value, asciidoctorAttributes);
document.getElementById('content').innerHTML = html_doc;
(some explanation here: http://discuss.asciidoctor.org/Icons-in-JavaScript-tp1737.html)
Live rendering using a browser plugin: http://asciidoctor.org/docs/editing-asciidoc-with-live-preview/ .
Edited by mttj