Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kbd macro doesn't work #276

Closed
marcdexet-cnrs opened this issue Nov 24, 2019 · 3 comments
Closed

kbd macro doesn't work #276

marcdexet-cnrs opened this issue Nov 24, 2019 · 3 comments

Comments

@marcdexet-cnrs
Copy link

Hi.

I'm' using asciidoctor 2.0.0

I'm using same source for html5, pdf and revealsjs for courses with a few adaptations depending the backend.

But I discoverd that kbd macro doesn't work with the revealjs backend.
It is not interpreted.
Do I miss something ?

@ggrossetie
Copy link
Member

Hi @marcdexet-cnrs

I believe the kbd macro is correctly converted to HTML using the following template:

- if (keys = attr 'keys').size == 1
kbd=keys.first
- else
span.keyseq
- keys.each_with_index do |key, idx|
- unless idx.zero?
|+
kbd=key

But I think there's no style associated with span.keyseq.
To workaround this issue, you can provide a custom stylesheet with the following rules:

.keyseq{color:rgba(51,51,51,.8)}
kbd{font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;display:inline-block;color:rgba(0,0,0,.8);font-size:.65em;line-height:1.45;background:#f7f7f7;border:1px solid #ccc;-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:0 1px 0 rgba(0,0,0,.2),0 0 0 .1em white inset;box-shadow:0 1px 0 rgba(0,0,0,.2),0 0 0 .1em #fff inset;margin:0 .15em;padding:.2em .5em;vertical-align:middle;position:relative;top:-.1em;white-space:nowrap}
.keyseq kbd:first-child{margin-left:0}
.keyseq kbd:last-child{margin-right:0}

Taken from: https://github.com/asciidoctor/asciidoctor/blob/master/data/stylesheets/asciidoctor-default.css

@obilodeau Do you want to add built-in support? ie. add the above CSS rules in https://github.com/asciidoctor/asciidoctor-reveal.js/blob/master/templates/asciidoctor_revealjs.css.slim ?

@obilodeau
Copy link
Member

FYI #77 tracks compliance issues like this one.

ggrossetie added a commit to ggrossetie/asciidoctor-reveal.js that referenced this issue Dec 18, 2019
Also move the styles to a proper CSS file
obilodeau added a commit that referenced this issue Feb 10, 2020
@obilodeau
Copy link
Member

Support for this was just merged and will be part of the upcoming 4.0.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants