Readwise to Obsidian export settings

These are settings for the Readwise-to-Obsidian export template settings page — with some additional context and explanation.

Jump straight into the configuration or keep reading for more context.

the goal (examples + context)

Here's the primary outcome I'm after — easily referenceable highlights that can be embedded in other notes, like this:


In medieval Latin a florilegium (plural florilegia) was a compilation of excerpts from other writings.
The word is from the Latin flos (flower) and legere (to gather): literally a gathering of flowers, or collection of fine extracts from the body of a larger work. (via)

🔑 The key to making this happen is a block ID like ^rwhi1234567890 on the exported highlights. See this explanation. There's some other customization to the frontmatter and filename and such, but they're much less important.

Here's context about my current Readwise usage: readwise features and how i use them

I also strongly suggest: treat readwise exports as read-only

obsidian extension settings

Useful settings in the readwise obsidian plugin itself:

the configuration

Sections ordered by how they appear on the Readwise-to-Obsidian export template settings page, but the highlight settings are definitely the most important of the configuration.

file name

Readwise's default export settings for filenames aren't sanitized to Obsidian's restrictions on filenames, so this snippet should help avoid most bad characters in the filenames:

{{ title|replace('@', '')|replace('#', 'no.')|replace('^', '')|replace('[', '(')|replace(']', ')')|replace('^', '')|replace(': ', ' - ')|replace(' | ', ' - ')  }}
Changing filename formatting may break links

... because any backlinks referencing those files will be referencing the incorrect name upon a fresh sync. It's an easy fix, especially if you're using the ^rwid block IDs from my #highlight config further down this note, so maybe do that first.

#no. is opinionated, but i am designing for my common case — numbered podcasts like Podcast Name (episode #123)Podcast Name (episode no.123).

If you want to remove # from a title altogether so it isn't replaced with no.: how to edit Readwise document metadata

page title

# {{ title }}

page metadata

{% if image_url -%}
{% endif %}

{% if document_note -%}
## Document note: {{document_note}}
{% endif -%}

highlights header

{% if is_new_page %}
## Highlights
{% endif -%}


rwhi is meant to represent all readwisehighlights, and the number that follows is the highlight's ID in Readwise's database. This is a convention I invented so the ^blockid is always stable for referencing.

Breaklines in highlights

If the readwise highlight contains breaklines, they may not appear quite the same in Obsidian.

This is intentional because of how "blocks" work in markdown — the ^blockref wouldn't work if there's actual breaklines.

The solution is to style the <br> in your Obsidian theme. Here's how I do that:

/* spacing for embeds */*
.internal-embed br {
    margin: 1em 0;
    display: block;
    content: "";

/* increase <br> in reading mode */
.markdown-reading-view p br {
    margin: 1em 0;
    display: block;
    content: "";

YAML front matter

note the quotes on the outside of the backlink brackets
  - "{{title}}"
{% if author %}author: "{{author}}"{% endif %}
{% if document_tags %}related to: {% for tag in document_tags %}
  - "[[{{tag}}]]"{% endfor %}{% endif %}
  - artifact/readwise{% if category %}/{{category}}{{ "📚" if category == "books"}}{{"📰" if category == "articles"}}{{"🐦" if category == "tweets"}}{{"🎙" if category == "podcasts"}}{% endif %}

YAML frontmatter example:
Pasted image 20240528201006.png

why the tag?

no harm and can produce some interesting obsidian graph states or serve as a count of exported documents in my obsidian vault.

i also liked the idea that artifacts represented a sort of read-only thing in my vault.

the emojis were just to try emojis in tags.