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

Clarify the Custom Styles documentation page #513

Open
refaelsh opened this issue Jun 25, 2023 · 1 comment
Open

Clarify the Custom Styles documentation page #513

refaelsh opened this issue Jun 25, 2023 · 1 comment

Comments

@refaelsh
Copy link
Contributor

refaelsh commented Jun 25, 2023

The Custom Styles documentation page is a bit misleading/incomplete:

https://docs.asciidoctor.org/reveal.js-converter/latest/converter/custom-styles/

It states that: "If the :customcss: attribute value is empty then asciidoctor-revealjs.css is the CSS resource that the presentation is linked to."

It does not mention that asciidoctor-revealjs.css must/should be provided by the user.

Here's the actual code:

link rel="stylesheet" href="#{revealjsdir}/dist/reset.css"
link rel="stylesheet" href="#{revealjsdir}/dist/reveal.css"
/ Default theme required even when using custom theme
link rel='stylesheet' href=(attr :revealjs_customtheme, %(#{revealjsdir}/dist/theme/#{attr 'revealjs_theme', 'black'}.css)) id='theme'
/! This CSS is generated by the Asciidoctor reveal.js converter to further integrate AsciiDoc's existing semantic with reveal.js
style type="text/css"
include asciidoctor-compatibility.css
- if attr? :icons, 'font'
/ iconfont-remote is implicitly set by Asciidoctor core. See https://github.com/asciidoctor/asciidoctor.org/issues/361
- if attr? 'iconfont-remote'
- if (iconfont_cdn = (attr 'iconfont-cdn'))
link rel='stylesheet' href=iconfont_cdn
- else
/ default icon font is Font Awesome
- font_awesome_version = (attr 'font-awesome-version', '5.15.1')
link rel='stylesheet' href=%(#{cdn_base}/font-awesome/#{font_awesome_version}/css/all.min.css)
link rel='stylesheet' href=%(#{cdn_base}/font-awesome/#{font_awesome_version}/css/v4-shims.min.css)
- else
link rel='stylesheet' href=(normalize_web_path %(#{attr 'iconfont-name', 'font-awesome'}.css), (attr 'stylesdir', ''), false)
= generate_stem(cdn_base)
- syntax_hl = self.syntax_highlighter
- if syntax_hl && (syntax_hl.docinfo? :head)
=syntax_hl.docinfo :head, self, cdn_base_url: cdn_base, linkcss: linkcss, self_closing_tag_slash: '/'
- if attr? :customcss
link rel='stylesheet' href=((customcss = attr :customcss).empty? ? 'asciidoctor-revealjs.css' : customcss)
- unless (_docinfo = docinfo :head, '-revealjs.html').empty?
=_docinfo

If the :customcss: attribute value is empty then asciidoctor-revealjs.css is the CSS resource that the presentation is linked to.

The documentation is actually true but the extension does not provide it, the user has to provide it. Not sure if it's a good idea to link to a file that might not exists.

It might be worth mentioning that we are also using the following stylesheets regardless of customcss value:

  • reset.css (from reveal.js)
  • reveal.css (from reveal.js)
  • theme/black.css (from reveal.js) - can be overridden using revealjs_theme attribute
  • asciidoctor-compatibility.css

Originally posted by @ggrossetie in #508 (comment)

@refaelsh
Copy link
Contributor Author

Please open a new issue so we can discuss how to improve the documentation.

Done.

@ggrossetie ggrossetie changed the title Discussion on how to improve the documentation Clarify the Custom Styles documentation page Jun 26, 2023
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

2 participants