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

Pass non-standard admonition categories on in HTML output #1280

Merged
merged 6 commits into from
Apr 8, 2020

Conversation

mortenpi
Copy link
Member

@mortenpi mortenpi commented Apr 8, 2020

Arguably fixing a regression, although it is an undocumented "feature". But it is a good idea to pass these on.

Compared to pre-0.24 behaviour, the class names are now prepended with admonition- is-category- (not using is-, since that can conflict with various Bulma classes, like is-hidden) and fully sanitized (the final class names match [a-z0-9-]+).

Fix #1279.

@mortenpi mortenpi added Type: Enhancement Format: HTML Related to the default HTML output labels Apr 8, 2020
@mortenpi mortenpi added this to the 0.24.8 milestone Apr 8, 2020
admonition-* clashes with the other admonition-related classes like
admonition-title
@mortenpi mortenpi merged commit 6e92252 into master Apr 8, 2020
@mortenpi mortenpi deleted the mp/admonitioncat branch April 8, 2020 22:24
mortenpi added a commit that referenced this pull request Apr 8, 2020
@kescobo
Copy link
Contributor

kescobo commented Apr 8, 2020

Thank you!

@kescobo
Copy link
Contributor

kescobo commented Apr 9, 2020

Works like a charm:

Screen Shot 2020-04-08 at 7 58 34 PM

From

.admonition.is-category-practice > .admonition-header {
 background-color: rgba(152,78,163,0.8);
}

.admonition.is-category-practice > .admonition-body {
 background-color: rgba(152,78,163,0.3);
}

Would you be interested in a PR to actually add this to the docs?

@mortenpi
Copy link
Member Author

mortenpi commented Apr 9, 2020

I am slightly hesitant to have it documented as public API just yet, in case we still want to make some changes to the structure of CSS classes. But if you don't mind, we could put the example with a few words of explanation into the example build (among other things, the example build functions as sort of a gallery of unofficial Documenter hacks).

briochemc added a commit to briochemc/Documenter.jl that referenced this pull request Apr 10, 2020
* JuliaDocs-master: (138 commits)
  Add example admonition css to example build (JuliaDocs#1284)
  Pass non-standard admonition categories on in HTML output (JuliaDocs#1280)
  Suggest using the `aligned` environment (JuliaDocs#1275)
  Update DiffEq docs link (JuliaDocs#1274)
  Make Deps.pip a closure again (JuliaDocs#1240)
  Recommend Julia 1.4 in the manual (JuliaDocs#1272)
  Add note about doctests in docstrings (JuliaDocs#1265)
  Fix minted/lstlistings escaping (JuliaDocs#1269)
  Changelog for 0.24.7 (JuliaDocs#1266)
  Test with Julia 1.4 instead of 1.3 on CI (JuliaDocs#1268)
  Fix doctest testing on nightly (JuliaDocs#1267)
  remove "only" from search stop word filter (JuliaDocs#1264)
  Reorganize some Sass variables to make theming easier (JuliaDocs#1258)
  Fix outdated links in the manual (JuliaDocs#1255)
  Fix LaTeX tests for tags (JuliaDocs#1256)
  Install TagBot as a GitHub Action (JuliaDocs#1237)
  use Julia 1.3 for .travis hosting example (JuliaDocs#1235)
  Set version to 0.24.5 (JuliaDocs#1233)
  Support REPL softscope for Julia 1.5. (JuliaDocs#1232)
  Discourage use of matrix: in Travis conf (JuliaDocs#1231)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Format: HTML Related to the default HTML output Type: Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: custom admonition styling
3 participants