Closed ggrossetie closed 5 years ago
@mojavelinux @hsablonniere Do you have a list of samples presentations, so I can check that Jade and Slim templates are aligned ?
Try this one https://github.com/opendevise/presentation-documentation-as-code
My version has a Ruby extension and some overridden templates : I like to give you some chanllenges.
Making some progress on the title page:
Asciidoctor Ruby + Slim templates
Asciidoctor.js + Jade templates
Note: I'm using the Asciidoctor.js wrapper API in the Jade templates. This is a bit verbose but the readability is nice :smile:
Nice ;-)
The structure of the presentation is now valid:
and slides with images are now working, next steps:
I also need to understand why the CompositeConverter
is not working.
For now I've created Jade templates for inline_break
, inline_quoted
, etc... but as far as I know these templates should be "provided" by the default html5 converter.
For now I've created Jade templates for inline_break, inline_quoted, etc... but as far as I know these templates should be "provided" by the default html5 converter.
I've found the root cause: https://github.com/asciidoctor/asciidoctor-template.js/issues/9 I've also pushed some improvements, I'm getting closer to an alpha 1 :wink:
I don't know why but slide titles are not rendered (ie. I get the raw text). For instance with Got icon:file-pdf-o[fw]?
.Good (with Asciidoctor Ruby + Slim)
.Bad (with Asciidoctor.js + Jade/Pug)
@mojavelinux @hsablonniere Any idea ?
The presentation looks closer and closer but 4 issues remain:
<figure>
tag inside the <section>
whereas with Slim templates, the <figure>
is absent... I think it has to do with content_for
and yield_content
functions but I haven't figured it out yet.build_roles
functionNice ;-) I'll try it next week (I hope).
I still have some local modifications that I need to push otherwise this won't work on your machine. I will let you know when it's ready :rocket:
@hsablonniere If you want to give it a try: https://github.com/opendevise/presentation-documentation-as-code/pull/2
Instead of duplicating Slim templates I think we should use the same approach as the Reveal.js converter and compile the Slim templates into a single Ruby file: https://github.com/jirutka/asciidoctor-templates-compiler
What do you think ?
Ping @jirutka @obilodeau @mojavelinux
As discussed with @mojavelinux the plan is to (re)write this converter in JavaScript (using String Literals or a JavaScript template engine).
Closing...
Build
Tests
Create a new Node project adjacent to your
asciidoctor-bespoke
clone:Install the dependencies
Create a simple presentation file named
presentation.adoc
:Create a test file named
test.js
//require('asciidoctor-template.js'); require('asciidoctor-bespoke');
var attributes = ''; var options = {safe: 'safe', backend: 'bespoke', attributes: attributes}; asciidoctor.convertFile('presentation.adoc', options);
node test.js
modify Jade templates in
../asciidoctor-bespoke/templates/jade
and/or modify presentation.adocnpm install --save ../asciidoctor-bespoke node test.js