Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Is it possible to link a CSS file into the Preview HTML document?
-
I have a CSS file on Dropbox that I want to use for both workflows and the preview as well as Marked on my Mac. I have this CSS file working to generate PDFs and print output on Editorial. Is it possible to link this CSS file into a Preview HTML file rather than copy/pasting it into the file, which I would have to repeat every time I edit the CSS?
-
Yes, if you get the raw file URL from Dropbox, you can put in the template HTML
<html> <head> <link rel="stylesheet" type="text/css" href="-LINK TO STYLESHEET-"> </head> </html>
-
Unfortunately, it didn't work. I tried a few different methods of getting the URL from Dropbox but none of them worked.
-
To be more specific, it doesn't seem to actually load anything from the linked URL. It's hard to tell without an inspector (again, unless I'm missing something).
-
Are you using this?
Render a file in your browser
Some browsers aren't configured to correctly display files in your browser. For these files, you can tell your browser to download the file instead of attempt to open it. To bypass the preview page and allow your browser to directly render your files, use raw=1 as a query parameter in your URL. For example:
https://www.dropbox.com/s/qmocfrco2t0d28o/Fluffbeast.docx
Becomes:
https://www.dropbox.com/s/qmocfrco2t0d28o/Fluffbeast.docx?raw=1 -
Yes, I tried that. And at first it didn't work. But the trick was to remove the style elements I had wrapping it. Thanks for asking if I used the raw query, it inspired me to give it another go and try a couple other things.
-
Great, glad you found a solution.