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

Doesn't work with panel-tabset #15

Closed
kdheepak opened this issue Apr 24, 2023 · 4 comments
Closed

Doesn't work with panel-tabset #15

kdheepak opened this issue Apr 24, 2023 · 4 comments

Comments

@kdheepak
Copy link

kdheepak commented Apr 24, 2023

Thanks for making this extension and maintaining it! It is one of my favorite extensions for quarto!

The following code doesn't seem to work for me:

::: panel-tabset

## Example1

```{julia}
#| eval: false

@info "Open Database"
OpenDB() #<<
```

## Example2

```{julia}
#| eval: false

@info "Close Database"
CloseDB() #<<
```

:::

image

Do you know if this can be supported?

@shafayetShafee
Copy link
Owner

Uhh, well it seems the extension actually making changes (necessary for enabling line highlighting) for the code blocks within the panel-tabset, but after that quarto-filter itself strips off all that changes keeping only the code texts, and returns a new code block with those texts along with other things to create panel-tabset (That's my understanding after doing a quick go through over panel-tabset.lua). And that's why in the final rendered output, line highlighting is not working for code-chunks within the panel-tabset.

Therefore, with this understanding, the solution is straightforward. Just run line-highlight filter after the quarto filter, which we can do as,

filters: 
  - quarto
  - line-highlight

Full Reprex

---
title: "Untitled"
format: html
filters: 
  - quarto
  - line-highlight
---

## Quarto

::: panel-tabset

## Example1

```julia
@info "Open Database"
OpenDB() #<<
```

## Example2

```julia
@info "Close Database"
CloseDB() #<<
```

:::

image


And note that, line-highlight now works on non-executable code blocks too as you have requested in #2. See here on README for details.

@kdheepak
Copy link
Author

That's awesome! Works perfectly! Thank you so much!

@kdheepak
Copy link
Author

Do you have a GitHub sponsors link? I'd like to donate to buy you a coffee as a gesture of my appreciation :)

@shafayetShafee
Copy link
Owner

Uhm, Not now currently. But I will let you know 😀.

Also you can star this repo if you like this one 🙂.

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

No branches or pull requests

2 participants