omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    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?

    Editorial
    2
    7
    3712
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • d_robertwright
      d_robertwright last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • Webmaster4o
        Webmaster4o last edited by

        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>
        
        1 Reply Last reply Reply Quote 0
        • d_robertwright
          d_robertwright last edited by

          Unfortunately, it didn't work. I tried a few different methods of getting the URL from Dropbox but none of them worked.

          1 Reply Last reply Reply Quote 0
          • d_robertwright
            d_robertwright last edited by

            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).

            1 Reply Last reply Reply Quote 0
            • Webmaster4o
              Webmaster4o last edited by Webmaster4o

              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

              1 Reply Last reply Reply Quote 0
              • d_robertwright
                d_robertwright last edited by

                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.

                1 Reply Last reply Reply Quote 0
                • Webmaster4o
                  Webmaster4o last edited by

                  Great, glad you found a solution.

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post
                  Powered by NodeBB Forums | Contributors