Skip to content

Instantly share code, notes, and snippets.

@SkydiveMike
Last active November 2, 2023 11:02
Show Gist options
  • Save SkydiveMike/d13c5a0fd22ecc0494130512d8337320 to your computer and use it in GitHub Desktop.
Save SkydiveMike/d13c5a0fd22ecc0494130512d8337320 to your computer and use it in GitHub Desktop.
Readwise Obsidian Export Settings

My settings for Readwise Exports to Obsidian

Requirements and assumptions:

Page title

Add a β€œtype” icon to the {{title}} attribute

# {{ "πŸ“š " if category == "books"}}{{"πŸ“° " if category == "articles"}}{{"🐦 " if category == "tweets"}}{{"πŸŽ™ " if category == "podcasts"}}{{ title }}

Page metadata

  • Include cover image if exists
  • Include Author as Dataview Author:: field
  • Use the type icon for a Dataview Category:: field
  • Defults the initial tag to #NoteType/Reference/captures/{{category}}
  • Include any Readwise Document tags
  • Include any Readwise URL’s to Dataview URL:: field
  • Include Sync Date as Synced::
  • Reference notes in Obsidian will include Dataview code for Literature Notes, Permanent Notes, and β€œsee also.”
{% if image_url and (category == "books" or category == "podcasts") -%}
![rw-book-cover]({{image_url}})

{% endif -%}
## Metadata
- Author:: {% if author %}[[{{author}}]]{% endif %}
- Full Title:: {{full_title}}
- Category:: [[{{ "πŸ“š Books" if category == "books"}}{{"πŸ“° Articles" if category == "articles"}}{{"🐦 Tweets" if category == "tweets"}}{{"πŸŽ™ Podcasts" if category == "podcasts"}}]]
- tags:: #NoteType/Reference/captures/{{category}}{% if document_tags -%}{% for tag in document_tags %} #{{tag}}{% endfor %}{% endif %}
{% if url -%}
- URL:: {{url}}
{% endif -%}
- Synced:: [[{{last_highlighted_date|date('Y-m-d')}}]]

{% if document_note -%}
> [!abstract] Document Note
> {{document_note}}
{% endif -%}

## Literature Notes
```dataview 
TABLE WITHOUT ID file.link AS "Literature Note", file.cday AS "Date" 
FROM #NoteType/Literature-Note AND [[]] 
sort date ASCENDING 
```
## Permanent Notes
```dataview 
TABLE WITHOUT ID file.link AS "Permanent Note", file.cday AS "Date" 
FROM (#NoteType/Permanent-Note OR #NoteType/MOC) AND [[]] 
sort date ASCENDING
```
## See Also:

```dataview
LIST
FROM -#Specialty/NoGraph
  AND -#NoteType/Literature-Note
  AND -#NoteType/Permanent-Note
  AND -#NoteType/MOC 
  AND [[#this.file.name]]
  AND !outgoing([[#this.file.name]]) 
```

Highlights Header

{% if is_new_page %}
## Highlights
Synced:: [[{{date|date('c')}}]]
{% elif has_new_highlights -%}

## New highlights added [[{{date|date('Y-m-d')}}]]
Synced:: [[{{date|date('c')}}]]
{% endif -%}

Highlight

- {{ highlight_text }}{% if highlight_tags %} 
    - Tagged:{% for tag in highlight_tags %} #{{tag|replace(" ","-")}}{% endfor %}{% endif %}
    - {% if highlight_location and highlight_location_url %}[{{highlight_location}}]({{highlight_location_url}}), {% elif highlight_location %} {{highlight_location}}, {% endif %}[Open in Readwise](https://readwise.io/open/{{highlight_id}}){% if highlight_note %}
    - Note: {{ highlight_note }}{% endif %}
^rw{{highlight_id}}

YAML Frontmatter

id: rw{{book_id}}
cssClass: reference-note
title: "{{title}}"
aliases:
- "{{title}}"
- "{{ "πŸ“š " if category == "books"}}{{"πŸ“° " if category == "articles"}}{{"🐦 " if category == "tweets"}}{{"πŸŽ™ " if category == "podcasts"}}{{ title }}"
{%- if title != full_title %}
- "{{full_title}}"{%- endif %}
creation-date: '<% tp.file.creation_date("YYYY-MM-DDTHH:mmZZ") %>'
imported-from-readwise-date: {{date|date('c')}}
imported-from-readwise-time: {{time}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment