Stylesheets for Markdown?

In the Help documents for DT3, it mentions that stylesheets for display Markdown being available in ~/Library/Application Support/DEVONthink3/StyleSheets. When I clicked on the Select button in the Style Sheets section of the settings, it didn’t take me to that folder, but rather to the folder my databases are stored in.

When I opened a terminal, I found that there wasn’t a StyleSheets directory in that location.

Is DT3 meant to ship with a few StyleSheets, or is the help just telling users where they could/should put a style sheet if they so desired?

2 Likes

These are the stylesheets for feeds, see Preferences > RSS. But the “Select” button allows you to choose any stylesheet on your disk(s).

1 Like

Thanks.

I’ve made a simple CSS file…just to use Arial rather than Times, and a larger font and selected it. After restarting DT3 the style is applied (without restarting the application, Markdown files were rendered with the build in theme).

Probably a caching issue as DEVONthink 3 uses various caches to improve the performance. Beta 2 should fix this.

1 Like

You can save a stylesheet in your database and use the metadata to load it into your .md files.

Example:

date: 2019-05-05  
css: x-devonthink-item://9288164B-FFF1-4DBE-ABFB-7654EA50C3C6
1 Like

Thanks @phillipsmn. I think this method worked in DEVONThink 2. However, a big part of my database is clipped webpages stored as Markdown (personal intranet), and so I’m looking for is a solution which changes the default appearance of all MD files…which is now possible in DT3 (thanks so much devs!!).

Excuse me but where is that “select” button? I didn’t know it was possible to assign custom CSS files to MD files.

It’s in the Preferences dialog under Media (in about the middle of that window).

Ah yes, obviously…

Thanks!

It definitely worked in DT2, and I may have misread the thread, but it looks like cgrunenberg said

These are the stylesheets for feeds, see Preferences > RSS.

So if they are for feeds only, then they wouldn’t globally apply to all .md files.

Nevermind…I found what you were talking about and it works great. The next thing is to see if that will be ported to DTTG so that I won’t have to include it in the header of my documents. :wink:

1 Like

If anyone is interested in giving DT3 some style and white space using the new stylesheet option :sunglasses:

Here is a preview of the CSS stylesheets I found for markdown. You can download the CSS files from the github repo.

The repo will have several files but all you need is the filename.css. Place it somewhere that you won’t accidentally delete it on your computer. Point to the file from DT3 options>Media>Stylesheet. Then click on a markdown file to view the new style. You do not need to put the CSS reference header at the top like in DT2.

I modified the Splendor.css file to have my own font as shown on the screenshot. The only downside is no color highlighting for code :neutral_face: but it at least puts the code in a codeblock.

:vulcan_salute:

5 Likes

Brett Terpstra’s Marked 2 application — which many people use for Markdown preview — also contains a bunch of really nice stylesheets. You’ll find them inside Contents/Resources in the application bundle.

@MosCool_Noel Nice!

People can put them in ~/Library/Application Support/DEVONthink 3/StyleSheets if they’d like.

1 Like

I took mine from Typora the Markdown editing app and modified it so it looks close to the Wolfram notebook look and feel.

IMHO, you all are just continuing to make the case for why Markdown is awesome! :slight_smile:

2 Likes

There’s no way to do in-line styling in DT3 the way Markdown text editors do, is there? E.g., start a line with # and it changes the line to h1 styling, but leaves the Markdown syntax.

I know I can open the file in those editors for those features, which is great. It’d just be greater if I never had to leave DT3, ha.

1 Like

If you’re using Side-by-Side mode, you’d see the rendered result when the file saves (or you do).

PS: Live styling, i.e. you see the formatting and the codes in the document, is a matter of personal taste. I personally hate it. I want to see code or I want to see the rendered result. I started with MacDown with this side-by-side preview and that suits me just fine. That’s one of the reasons why I initially wrote the Open in two windows script and why I’m happy with @cgrunenberg’s addition of this mode native to DT3.

1 Like

Thanks. Agreed, it’s definitely a matter of taste.

Side-by-side is nice and has its uses for me, but takes up display real estate in contrast to live styling. I’ll stick with open in a different app for now!

1 Like

This is awesome, indeed!

It would be great to setup code highlighting in the codeblocks. That would be the icing of the cake. :cake: :slight_smile:

PS/ I’m using this stylesheet: https://gist.github.com/luispuerto/494d05b95b9677410c6b09ccf8337943

1 Like