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

Lost CSS preview rendering #61

Closed
andreagam opened this issue May 27, 2021 · 5 comments
Closed

Lost CSS preview rendering #61

andreagam opened this issue May 27, 2021 · 5 comments

Comments

@andreagam
Copy link

andreagam commented May 27, 2021

Hello and thanks for this beautiful piece of software. I’m using it for my documents and I like the idea to keep content and styling separated.
But from version 0.8.0 my files with a yaml header that recalls a css file are not working anymore.
Example:
My yaml header is something like this:

---
type: doc
---

Then I have a css file called doc.css in the PanWriterUserData folder which applies the style rules for the document in the preview.
From version 0.8.0 this is not working. I’m running Panwriter on a MacBook with Big Sur OS.
By the way, I downgraded to version 0.7.2 but it keeps to automatically update to 0.8.0 every time I launch the app. Anyone can tell how to prevent it from updating?
Thanks a lot!

@mb21
Copy link
Owner

mb21 commented May 30, 2021

Thanks for getting in touch! I just added a proper note to the 0.8.0 release:

Major refactorings were done for 0.8.0, which should be a better basis for future work.

In the process, one feature was removed: the ability to read user-customizable css files

Maybe we can add something like that in the future again, but will have to work with pandoc's document-css (which we'd need to parse properly) or work with pandoc's default files.

So yes, that feature was removed for now, sorry!

I also just checked the electron-updater package for a way to be disable the auto-update, but I think I'll have to implement that myself (and haven't done so yet in 0.8.0)... so besides blocking the app from accessing the internet, I'm afraid it will probably auto-update all the time...

I'll try to come up with a fix for these issues shortly!

@andreagam
Copy link
Author

Hi Mauro, thanks for your answer. I'm sorry to hear that the ability to read external user-customizable css files has been removed purposedly.
In fact, that was the killing feature for me because it was super-useful to write a text (e.g.: a software project) and having the possibility to apply different dresses (with different headers, and logos, and styles...) based on the context or the addressee of the document.
I found v0.7.2 was nearly perfect to me, missing only the ability to compose a toc automatically.
But maybe you've got different plans and different uses than mine in your mind.
Thanks for your time and your efforts and best wishes.

@mb21
Copy link
Owner

mb21 commented Jun 1, 2021

I'll add some way of doing it back, but I wasn't sure what the best way was. I've pushed a commit to the default-css branch (not very well tested yet), which allows you to place e.g.

header-includes: |-
  <style>
  p {
    font-weight: bold
  }
  </style>

in the file doc.yaml in the PanWriter User Data directory. The CSS should show up in the preview, just like it did in 0.7. If you can, please give it a try (see the build instructions).

@andreagam
Copy link
Author

Hi Mauro, it's very kind of you. I will surely give it a try and let you know.
Thank you so much for your help.

@mb21
Copy link
Owner

mb21 commented Jun 5, 2021

I did some more testing and seemed fine, so just did a new release with this. Let me know if you find any bugs, thanks!

@mb21 mb21 closed this as completed Jun 5, 2021
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