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

highlight_themes_css and extra_syntaxes_and_themes are incompatible if highlight_theme == "css" #1775

Closed
bahlo opened this issue Feb 20, 2022 · 1 comment
Labels
done in pr Already done in a PR

Comments

@bahlo
Copy link

bahlo commented Feb 20, 2022

Bug Report

You can't use themes from extra_syntaxes_and_themes with highlight_themes_css. The extra_syntaxes_and_themes import works if I remove the highlight_themes_css statement and use highlight_theme = "base16-unikitty-dark" (for example).

Environment

Zola version: 0.15.3

Expected Behavior

Zola builds the CSS for the light and dark theme and writes it to static/.

Current Behavior

$ RUST_BACKTRACE=full zola build
Building site...
Checking all internal links with anchors.
> Successfully checked 0 internal link(s) with anchors.
-> Creating 7 pages (0 orphan) and 1 sections
thread 'main' panicked at 'no entry found for key', components/config/src/config/markup.rs:78:33
stack backtrace:
   0:        0x1053a75ff - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hd4fa0e5fd1b0bae0
   1:        0x104e733eb - core::fmt::write::hd6db5571778cce6c
   2:        0x10538873a - std::io::Write::write_fmt::hf56449a28d15bb2b
   3:        0x105390645 - std::panicking::default_hook::{{closure}}::h2d0f2e1e91f96447
   4:        0x105391109 - std::panicking::rust_panic_with_hook::h916e420d7d249caa
   5:        0x1053a79da - std::panicking::begin_panic_handler::{{closure}}::hc926ed443b77e590
   6:        0x1053a7959 - std::sys_common::backtrace::__rust_end_short_backtrace::hf8832c1005df0617
   7:        0x105390985 - _rust_begin_unwind
   8:        0x10561384f - core::panicking::panic_fmt::hedd127944bd71c57
   9:        0x104e6e08b - core::panicking::panic_display::hfb53cabd7daaeed2
  10:        0x10561322c - core::option::expect_failed::hdae270e7e6b89f17
  11:        0x104e1470d - config::config::markup::Markdown::get_highlight_theme_by_name::h806ae2a395ecc82d
  12:        0x10533d05b - site::Site::build::h55620189ec0474ac
  13:        0x104d6f81c - zola::main::he9876c96633a39fe
  14:        0x104d07a66 - std::sys_common::backtrace::__rust_begin_short_backtrace::hd2c498feb33f3837
  15:        0x104d7216b - _main
$ RUST_BACKTRACE=1 zola build
Building site...
Checking all internal links with anchors.
> Successfully checked 0 internal link(s) with anchors.
-> Creating 7 pages (0 orphan) and 1 sections
thread 'main' panicked at 'no entry found for key', components/config/src/config/markup.rs:78:33
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic_display
   3: core::option::expect_failed
   4: config::config::markup::Markdown::get_highlight_theme_by_name
   5: site::Site::build
   6: zola::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Step to reproduce

[markdown]
highlight_code = true
highlight_theme = "css"
extra_syntaxes_and_themes = ["extra_highlight_themes"]
highlight_themes_css = [
  { theme = "base16-unikitty-dark", filename = "syntax-theme-dark.css" },
  { theme = "base16-unikitty-light", filename = "syntax-theme-light.css" },
]
$ ls -lh extra_highlight_themes
total 24K
-rw-r--r--  1 arne staff 12K Feb 20 14:22 base16-unikitty-dark.tmTheme
-rw-r--r--  1 arne staff 12K Feb 20 14:23 base16-unikitty-light.tmTheme
@bahlo bahlo changed the title highlight_themes_css and extra_syntaxes_and_themes are incompatible highlight_themes_css and extra_syntaxes_and_themes are incompatible if highligh_theme == "css" Feb 20, 2022
@bahlo bahlo changed the title highlight_themes_css and extra_syntaxes_and_themes are incompatible if highligh_theme == "css" highlight_themes_css and extra_syntaxes_and_themes are incompatible if highlight_theme == "css" Feb 20, 2022
@Keats Keats added the bug label Feb 21, 2022
@Keats
Copy link
Collaborator

Keats commented Feb 21, 2022

That shouldn't be too hard to fix if someone wants to try!

@Keats Keats added done in pr Already done in a PR and removed bug labels Mar 15, 2022
@Keats Keats closed this as completed in 1f5a524 Jul 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
done in pr Already done in a PR
Projects
None yet
Development

No branches or pull requests

2 participants