Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Hi.
Is it possible to use two captions for a imageblock like the following [#myimage_02] .Caption above image image::myImage[align=center,title-align=center] ..Caption below image |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Administrator
|
That's not something that's supported out of the box. It would require using a custom attribute and using a custom template (e.g., image.html.slim) to place the two captions. Cheers, -Dan On Tue, Dec 11, 2018 at 1:37 PM al-asciidoctor [via Asciidoctor :: Discussion] <[hidden email]> wrote: Hi. ... [show rest of quote] -- Dan Allen | @mojavelinux | https://twitter.com/mojavelinux |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Administrator
|
I don't think you need a custom block. Just something like: [#myimage_02] .Caption above image image::myImage[align=center,title-align=center,lower-caption="Caption below image"] But you need the custom template to take the lower-caption attribute and place it in the HTML. (See https://github.com/asciidoctor/asciidoctor.org/issues/80) -Dan On Tue, Dec 11, 2018 at 2:31 PM al-asciidoctor [via Asciidoctor :: Discussion] <[hidden email]> wrote: Something like this right? -- Dan Allen | @mojavelinux | https://twitter.com/mojavelinux |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Administrator
|
In reply to this post by al-asciidoctor
> I don't think you need a custom block. I meant to say custom block macro. On Tue, Dec 11, 2018 at 2:57 PM Dan Allen <[hidden email]> wrote:
... [show rest of quote] -- Dan Allen | @mojavelinux | https://twitter.com/mojavelinux |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
In reply to this post by mojavelinux
Thanks I will try it.
After I found a solution I will post it here |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
As I'm new to this asciidoctor and slim stuff I hope you are not to angry for my dump questions.
Now I have tried the following. * create a directory `templates` * create a file `upper-caption.html.slim` as the default caption is below the image and I need one above. * content of `upper-caption.html.slim` .imageblock upper-caption=testi Now when I run the asciidoctor command I get the follwing output. asciidoctor -a attribute-missing=warn -v --trace -T ../templates/upper-caption.html.slim Kopie.adoc D:/APPS/msys64/mingw64/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': cannot load such file -- tilt (LoadError) ... What's my mistake? > answer my self. install tilt : gem install tilt |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Administrator
|
In order to use slim templates, you need to add the following two gems: * slim * tilt Install them in the same way that you installed the asciidoctor gem. I also noticed that your template doesn't quite have the right syntax. I would advise consulting this documentation: http://slim-lang.com/ It's good that you are venturing into custom templates because they give you soooooooo much control over what Asciidoctor outputs. Cheers, -Dan On Tue, Dec 11, 2018 at 3:35 PM al-asciidoctor [via Asciidoctor :: Discussion] <[hidden email]> wrote: As I'm new to this asciidoctor and slim stuff I hope you are not to angry for my dump questions. ... [show rest of quote] -- Dan Allen | @mojavelinux | https://twitter.com/mojavelinux |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Thanks I have now installed both.
I have copied the content from https://github.com/asciidoctor/asciidoctor-backends/blob/master/slim/html5/block_image.html.slim to my template and adopted it with `upper-caption: (attr :upper-caption)` The block looks like this [[abbildung_01]] .lower text image::KOPIE-extracted-media/media/image1.png[align=center,title-align=center,upper-caption="upper-text"] = block_with_title({class: 'imageblock', style: (style_value text_align: (attr :align), float: (attr :float), upper-caption: (attr :upper-caption))}, :bottom) I have also copied the asciidoctor-1.5.8\data\stylesheets\asciidoctor-default.css and added the follwing line but I'm sure that's wrong. .imageblock>.upper-caption{margin-bottom:0} As I don't know what's the syntax to tell slim/html to put the upper-caption before the .content. |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Administrator
|
You won't be able to use that template as a base since it relies on a helper. It's probably best to start from scratch using the slim reference I sent. You probably want something like: .imageblock .content .upper-title = attr('upper-caption') img src=image_uri(attr 'target') .title = captioned_title You can build from there. Cheers, -Dan On Tue, Dec 11, 2018 at 4:19 PM al-asciidoctor [via Asciidoctor :: Discussion] <[hidden email]> wrote: Thanks I have now installed both. ... [show rest of quote] -- Dan Allen | @mojavelinux | https://twitter.com/mojavelinux |
Free forum by Nabble | Edit this page |