Login  Register

Huge task to propose a slidy or slidy2 backend ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Huge task to propose a slidy or slidy2 backend ?

ch007m
Hi,

Is it a huge task to propose a slidy or slidy2 backend ? Do we have instructions somewhere excepted github issue here - https://github.com/asciidoctor/asciidoctor-backends/issues/12 (doc, ...) ?

Regards,

Charles
Charles Moulliard
Apache Committer / Technologist Evangelist / Blogger / MiddleWare Specialist
Twitter : @cmoulliard
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Huge task to propose a slidy or slidy2 backend ?

asotobu
Hello, no we don't have instructions to build a new template yet, but you only need to do two things, the first one choose between slim or haml. Then when you have chosen one you can start creating your backend. It is as simple as for each AsciiDoc element, you can create a file with the same name. Then when Asciidoctor finds that element, the output will be replaced by the one of the template. See for example deckjs example: https://github.com/asciidoctor/asciidoctor-backends/tree/master/haml/deckjs

you will find some files like section.html.haml is used when a new section is found by renderer, document.html.haml when a new document is found, and so on. So although there is no documentation (which should be fixed), inspecting already running templates you can create your own. And all thanks of Tilt gem.

Hope this has been helped you to start to write for example one for Slidy.

Alex
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Huge task to propose a slidy or slidy2 backend ?

mojavelinux
Administrator
Thanks for the response, Alex! You summarized the current state of things very well.

One thing to note is that when you create a completely new backend, you have to implement a template for every node you use in your document. Otherwise, Asciidoctor will fail with the error that the view could not be found.

The reason this happens is because new backends, like slidy, do not inherit from the built-in backends (in particular, html5). One way to move forward quickly is to copy all the templates from the html5 backend into your new backend folder and begin customizing them one by one. That way, you'll never be missing one.

You know which templates you need to implement by looking at the html5 backend (erb, slim or haml):

* https://github.com/asciidoctor/asciidoctor-backends/tree/master/haml/html5
* https://github.com/asciidoctor/asciidoctor-backends/tree/master/slim/html5
* https://github.com/asciidoctor/asciidoctor-backends/tree/master/erb/html5

These templates aren't used by Asciidoctor by default. However, I keep them up to date to mimic the behavior of the built-in html5 backend and to use as a starting point for new backends.

You certainly don't have to implement the backend in multiple template languages. Just choose the one you like best. I personally recommend slim.

-Dan


On Mon, Nov 18, 2013 at 1:41 PM, asotobu [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hello, no we don't have instructions to build a new template yet, but you only need to do two things, the first one choose between slim or haml. Then when you have chosen one you can start creating your backend. It is as simple as for each AsciiDoc element, you can create a file with the same name. Then when Asciidoctor finds that element, the output will be replaced by the one of the template. See for example deckjs example: https://github.com/asciidoctor/asciidoctor-backends/tree/master/haml/deckjs

you will find some files like section.html.haml is used when a new section is found by renderer, document.html.haml when a new document is found, and so on. So although there is no documentation (which should be fixed), inspecting already running templates you can create your own. And all thanks of Tilt gem.

Hope this has been helped you to start to write for example one for Slidy.

Alex


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Huge-task-to-propose-a-slidy-or-slidy2-backend-tp1013p1015.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Huge task to propose a slidy or slidy2 backend ?

ch007m
Thx for the response. As I have started to work with HAML, I will continue to use this markup language.

Question: I don't see in the asciidoctor documentation a description of the different blocks/macros/nodes. Does it exist ? Can you tell me if each node/block corresponds to an asciidoc block or inline and if we have new blocks ? What is the difference between document and embed ? 

block_admonition.html.haml
block_audio.html.haml
block_colist.html.haml
block_dlist.html.haml
block_example.haml.haml
block_floating_title.html.haml
block_image.html.haml
block_listing.html.haml
block_literal.html.haml
block_math.html.haml
block_olist.html.haml
block_open.html.haml
block_page_break.html.haml
block_paragraph.html.haml
block_pass.html.haml
block_preamble.html.haml
block_quote.html.haml
block_ruler.html.haml
block_sidebar.html.haml
block_table.html.haml
block_toc.html.haml
block_ulist.html.haml
block_verse.html.haml
block_video.html.haml
document.html.haml
embedded.html.haml
inline_anchor.html.haml
inline_break.html.haml
inline_button.html.haml
inline_callout.html.haml
inline_footnote.html.haml
inline_image.html.haml
inline_indexterm.html.haml
inline_kbd.html.haml
inline_menu.html.haml
inline_quoted.html.haml
section.html.haml

Remarks : 
- I suggest to add a table in asciidoctor documentation to define the different node type (block, inline, section, ...) and mention if they correspond or not to asciidoc or are new 
- Would be great to support jade (http://jade-lang.com/) like we use for scalate project (http://scalate.fusesource.org/) which is even more dry than HAML/SLIM.


On Sun, Nov 24, 2013 at 11:40 PM, mojavelinux [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Thanks for the response, Alex! You summarized the current state of things very well.

One thing to note is that when you create a completely new backend, you have to implement a template for every node you use in your document. Otherwise, Asciidoctor will fail with the error that the view could not be found.

The reason this happens is because new backends, like slidy, do not inherit from the built-in backends (in particular, html5). One way to move forward quickly is to copy all the templates from the html5 backend into your new backend folder and begin customizing them one by one. That way, you'll never be missing one.

You know which templates you need to implement by looking at the html5 backend (erb, slim or haml):

* https://github.com/asciidoctor/asciidoctor-backends/tree/master/haml/html5
* https://github.com/asciidoctor/asciidoctor-backends/tree/master/slim/html5
* https://github.com/asciidoctor/asciidoctor-backends/tree/master/erb/html5

These templates aren't used by Asciidoctor by default. However, I keep them up to date to mimic the behavior of the built-in html5 backend and to use as a starting point for new backends.

You certainly don't have to implement the backend in multiple template languages. Just choose the one you like best. I personally recommend slim.

-Dan


On Mon, Nov 18, 2013 at 1:41 PM, asotobu [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hello, no we don't have instructions to build a new template yet, but you only need to do two things, the first one choose between slim or haml. Then when you have chosen one you can start creating your backend. It is as simple as for each AsciiDoc element, you can create a file with the same name. Then when Asciidoctor finds that element, the output will be replaced by the one of the template. See for example deckjs example: https://github.com/asciidoctor/asciidoctor-backends/tree/master/haml/deckjs

you will find some files like section.html.haml is used when a new section is found by renderer, document.html.haml when a new document is found, and so on. So although there is no documentation (which should be fixed), inspecting already running templates you can create your own. And all thanks of Tilt gem.

Hope this has been helped you to start to write for example one for Slidy.

Alex


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Huge-task-to-propose-a-slidy-or-slidy2-backend-tp1013p1015.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--



If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Huge-task-to-propose-a-slidy-or-slidy2-backend-tp1013p1073.html
To unsubscribe from Huge task to propose a slidy or slidy2 backend ?, click here.
NAML



--
Charles Moulliard
Apache Committer / Architect @RedHat
Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io

Charles Moulliard
Apache Committer / Technologist Evangelist / Blogger / MiddleWare Specialist
Twitter : @cmoulliard