angular-asciidoc-directive
angular-asciidoc-directive copied to clipboard
AngularJS directive for AsciiDoctor
angular-asciidoc-directive 
Angular-asciidoc-directive use the project asciidoctor.js the javascript version of AsciiDoctor to generate the HTML render.
Asciidoctor.js couldn't work with AngularJS out of the box, Opal, the cross-compiler used to generate the JS file, add $inject method :
https://github.com/opal/opal/issues/400
To resolve the problem, the project use grunt and 'string-replace' to modify asciidoctor.js :
...
'string-replace': {
options: {
replacements: [
{
pattern: /(\$inject)/ig,
replacement: '\$opalInject'
},
{
pattern: /(\$scope)/ig,
replacement: '\$opalScope'
}
]
},
...
Usage
bower install angular-asciidoc-directive- Include the
asciidoc.all.jsscript into your app.opal.jsandasciidoctor.jsare include and minify in theasciidoc.all.js. - Add
aql.asciidocas a module dependency to your app. - See examples/demo.html for usage
License
MIT