tommilligan / mdbook-admonish

A preprocessor for mdbook to add Material Design admonishments.
MIT License
171 stars 18 forks source link

admonish code block do not render properly #67

Closed nicolaslesquoy closed 1 year ago

nicolaslesquoy commented 1 year ago

I use mdbook-admonish in my book. To test the installation, I wrote:

Some text

'''admonish
A beautifully styled message.
'''

(replace the ' with markdown's fenced block syntax)

When building the book with mdbook serve --open, the block is rendered as plain text without any style and without errors or warnings. I downloaded the package today and I updated mdbook to v0.4.25.

The installation process didn't yield any error either. I installed the package with cargo install mdbook-admonish & mdbook-admonish install path/to/my_book with path/to/my_book set to the correct path.

Attached to this issue, is a minimal working example (as a .zip archive) with all the plugins I use in the book.

docs.zip

schungx commented 1 year ago

It doesn't seem to be copying the file mdbook-adminosh.css to the output...

And that file seems to be empty...

nicolaslesquoy commented 1 year ago

@schungx I tried your example and I also tried other blocks before but the result remains the same, without any error

nicolaslesquoy commented 1 year ago

mdbook-admonish.css is indeed empty, It was like that by default as I installed it via the crate.


EDIT I tried to copy the content of ./src/bin/assets/mdbook-admonish.css directly in the book's mdbook-admonish.css, but each time I build the book with mdbook serve --open, the file is wiped.

schungx commented 1 year ago

Can you run it again? It should at least not be empty...

nicolaslesquoy commented 1 year ago

@schungx I uninstalled the mdbook-admonish crate and reinstalled it again. This didn't produce any errors. I deleted the previous config files and rerun the installation process for my book. The result remains the same (no errors, no warning, admonish block rendered as plain text). The .css file is still empty and wiped each time I run mdbook serve --open.

schungx commented 1 year ago

Can you try not having a full path?

Just do additional_css = ["mdbook-admonish.css"] in book.toml...

schungx commented 1 year ago

I believe the absolute path is screwing things up because it makes the output file the same as the input file, instead of inside the output directory.

Notice the instructions specifically calls for a relative path based off the book.toml root...

image

@tommilligan It might be a good idea to mention in the README that the install path should be relative to the root...

nicolaslesquoy commented 1 year ago

Can you try not having a full path?

Just do additional_css = ["mdbook-admonish.css"] in book.toml...

This solved the issue. Thank you for your help. I believe the README.md is not clear on that point. I will close the issue.