ejmg / zerm

a minimalist and dark theme for Zola
https://zerm.ejmg.now.sh/
MIT License
116 stars 39 forks source link

Code blocks with line numbers have table formatting. #62

Closed djacu closed 2 years ago

djacu commented 2 years ago

Inserting a code block with linenos turns it into a table.

From the zola documentation on Syntax Highlighting:

When line numbers are active, the code block is turned into a table with one row and two cells. The first cell contains the line number and the second cell contains the code. Highlights are done via the HTML tag. When a line with line number is highlighted two tags are created: one around the line number(s) and one around the code.

As you can see from the examples below, the styling does not look great for a code block. Would it be possible so that code blocks to not have this styling applied to them? I noticed that when you have a code block, regardless of whether it has line numbers enabled or not, it is wrapped in <pre> and <code> tags. Not sure if this is helpful but it is different than tables which are not nested in other tags.

Without linenos

```python
try:
    from jupyter_client.kernelspec import install_kernel_spec
except ImportError:
    from IPython.kernel.kernelspec import install_kernel_spec
from IPython.utils.tempdir import TemporaryDirectory
![image](https://user-images.githubusercontent.com/7043297/173472395-b51be546-b9c3-4aad-8f43-3272a0ddbcae.png)

With `linenos`
try:
    from jupyter_client.kernelspec import install_kernel_spec
except ImportError:
    from IPython.kernel.kernelspec import install_kernel_spec
from IPython.utils.tempdir import TemporaryDirectory

![image](https://user-images.githubusercontent.com/7043297/173472573-fdcd34d4-5fee-45bb-85bb-da3d27d632fb.png)
ejmg commented 2 years ago

thank you for filing this issue. whatever this behavior is by zerm, it's definitely incorrect and should be fixed.

djacu commented 2 years ago

I think I might have a fix. I'll submit a PR soon.

ejmg commented 2 years ago

Resolved by #63, thanks again @djacu!