Login  Register

Use right arrow symbol in menu macro

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

Use right arrow symbol in menu macro

mariocup
20 posts
I am using asciidoctor-pdf (Asciidoctor PDF 1.5.0.alpha.14 using Asciidoctor 1.5.5) and would like to configure the styles of the menu command.

Instead of using the default symbol I would like to configure "right single arrow"  (→) for HTML and pdf.

Is it possible?
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Use right arrow symbol in menu macro

mojavelinux
Administrator
2681 posts
Yes.

You can configure this in Asciidoctor PDF using the theme. See https://github.com/asciidoctor/asciidoctor-pdf/blob/master/docs/theming-guide.adoc#keys-menu

In your case, you probably want:

menu:
  caret_content: ' \u2192 '

For HTML, you'll need to supply a custom template for the inline_menu node. For example, see https://github.com/asciidoctor/asciidoctor-backends/blob/master/slim/html5/inline_menu.html.slim.

I would like the caret to be configurable via CSS. I made this possible in the EPUB3 converter. That needs to be backported to the HTML converter. See https://github.com/asciidoctor/asciidoctor-epub3/blob/master/lib/asciidoctor-epub3/converter.rb#L759-L771.

Since I wrapped the caret in a span with a class, it's possible to use CSS to hide the default content and use the before or after pseudo selectors to inject replacement content.

Cheers,

-Dan

On Fri, Mar 10, 2017 at 1:17 AM, mariocup [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I am using asciidoctor-pdf (Asciidoctor PDF 1.5.0.alpha.14 using Asciidoctor 1.5.5) and would like to configure the styles of the menu command.

Instead of using the default symbol I would like to configure "right single arrow"  (→) for HTML and pdf.

Is it possible?


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Use-right-arrow-symbol-in-menu-macro-tp5362.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Use right arrow symbol in menu macro

mariocup
20 posts
Hi Dan,

thanks for the hint.

I tried to use in my pdf theme:

```
caret_content: ' \u2192 '
````

The code

```
:experimental: true
...
menu:View[Zoom > Reset]
```

was generating the pdf output

View  \u2192  Zoom \u2192 Reset

I tried to change my yml file to:

```
menu:menu_caret_content: ' & #8594; '  
```

With this change I getting the expected result View → Zoom → Reset.

NOTE: You have to remove the space between & and #, but when I write it without the space it will be render automatically in the editor as →
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Use right arrow symbol in menu macro

mojavelinux
Administrator
2681 posts
The string has to be double quoted in order to use Unicode escape codes. The example in the docs is incorrect (and thus fooled me). I'll fix it!

Btw, you can see how it's define in the default theme here:


-Dan

On Sat, Mar 11, 2017 at 12:23 AM, mariocup [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hi Dan,

thanks for the hint.

I tried to use in my pdf theme:

```
caret_content: ' \u2192 '
````

The code

```
:experimental: true
...
menu:View[Zoom > Reset]
```

was generating the pdf output

View  \u2192  Zoom \u2192 Reset

I tried to change my yml file to:

```
menu:menu_caret_content: ' → '
```

With this change I getting the expected result View -> Zoom -> Reset.


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Use-right-arrow-symbol-in-menu-macro-tp5362p5370.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux