How to force a refresh on CSS fiels for Markdown?

I use a lot of Markdown docs with a linked CSS file.

That works generally fine in DTP, but when I change the CSS (in DTP or outside) the rendered version of a Markdown document linking to this CSS file does not always change, only sometimes… Looks like the CSS is cached somewhere in Devonthink.

The only certain way I know of to force using the changed CSS is shutting down DTP!!! Is there a better way?

Did you try to empty the cache, see DEVONthink menu?

Tried it - does not do the trick. :frowning:

My test workflow:

  1. Double-click the Markdown document to view layout.
  2. Close Markdown document window.
  3. Double click the CSS file.
  4. Change something (say color of headers)
  5. Save and close CSS file.
  6. Click menu item Empty cache.
  7. Double-click the Markdown document to view layout. - Color has not changed.
  8. Restart DTP.
  9. Double-click the Markdown document to view layout. - Color has changed.

Maybe it’s a limitation of the WebKit, we’ll check this.

Thanks for this. I’m curious what you find out. :smile:

Right-click and convert the file to HTML to preview the change has been made.
This often will immediately affect the rendering of the Markdown file when subsequently viewed.

@BLUEFROG Clever ideam but unfortunately this does not work: The converted HTML file is still displayed with the old style sheet information.

@cgrunenberg The HTML source does use the correct in-database path in the LINK tag drawing in the CSS file. So I assume it has nothing to do with Markdown or HTML but with the fact that DTP somehow caches the CSS file itself.

Would be great to be able ti flush this cache without restarting DTP… :slight_smile:

Clever ideam but unfortunately this does not work: The converted HTML file is still displayed with the old style sheet information.

You have something else going on, and yes potentially a cached file. I use this mechanism whenever I run into this issue and it works without fail.

Actually DEVONthink doesn’t cache this on its own (otherwise this would be easy to fix :slight_smile: ) but the WebKit might.

Makes sense. Any chance to trigger a WebKit refresh in DTP?

It’s not a cache issue of the WebKit either (or emptying the cache doesn’t work as expected) but the next maintenance release will slightly revise the handling, maybe this will help.

Great. Will test it.

FYI for anyone finding this thread and wondering about other solutions: I describe a simple method in another posting that is useful for iterating CSS designs.

1 Like