Skip to content

Instantly share code, notes, and snippets.

@lguenth
Last active August 24, 2022 11:59
Show Gist options
  • Save lguenth/83762c3678da37d906d14c4b8869fff0 to your computer and use it in GitHub Desktop.
Save lguenth/83762c3678da37d906d14c4b8869fff0 to your computer and use it in GitHub Desktop.

Readwise Settings

File name

{{title|replace('.','')|replace('&','and')|replace(',','')|replace('•','')|replace('.','')|replace('"','')|replace('','')|replace(':','–')|replace('/','')|replace('*','')|replace('=','equals')|replace('|','')|replace('[','')|replace(']','')|replace('#','')|replace('%','')|replace('----','')|replace('---','')|replace('--','–')|replace('@', '')}}

Page title

# {{full_title if category!="tweets" else author|replace("on Twitter", "")|replace("@", "")}}

Page metadata

{% if image_url and source == "twitter" %}![rw-tweet-author|200x200]({{image_url}}){% endif %}
> [!meta] Metadaten
> - Titel:: {{title if category!="tweets"}}
> - Autor:: [[{{author|replace("on Twitter", "")|replace("@", "")-}}]]
> - Quelle:: {{url if category!="books"}}
> - Themen:: {% for tag in document_tags %}[[{{tag|title|replace("Liked", "Favoriten")|replace("Favorites", "Favoriten")}}]]{{", " if not loop.last}}{% endfor %}
> - Gelesen am:: {{last_highlighted_date|date("Y-m-d")}}

Highlights header

{% if is_new_page %}
{{"## Thread" if category=="tweets"}}
{{"## Highlights" if category!="tweets"}}
*Hinzugefügt am: [[{{last_highlighted_date|date("Y-m")}}#{{last_highlighted_date|date("Y-m-d")}}|{{last_highlighted_date|date("Y-m-d")}}]]*
{% elif has_new_highlights %}

---

*Hinzugefügt am: [[{{last_highlighted_date|date("Y-m-d")}}]]*
{% endif %}

Highlight

> "{{highlight_text|replace("#", "#twitter/")}}"{% if highlight_location and highlight_location_url %} ([{{highlight_location|replace("Page", "S.")|replace("View Highlight", "🔗")}}]({{highlight_location_url}})){% elif highlight_location %} ({{highlight_location|replace("Page", "S.")}}){% endif %} ^rw{{highlight_id}}
{% if highlight_note -%}

- {{ highlight_note|replace("\n   ","\n-")}}
{% if highlight_tags %}- Siehe auch: {% for tag in highlight_tags %}[[{{tag|title}}]]{{", " if not loop.last}}{% endfor %}
{% endif %}{% endif %}

YAML front matter

tags: inbox/readwise
type: extern/{{"buch" if category == "books"}}{{"artikel" if category == "articles"}}{{"tweet" if category == "tweets"}}{{"podcast" if category == "podcasts"}}
readwise-id: {{book_id}}
created: {{date|date('Y-m-d')}}

Sync notification

- {{date|date('Y-m-d')}} {{time}} — Synced {{num_highlights}} highlight{{num_highlights|pluralize}} from {{num_books}} document{{num_books|pluralize}}.
{% for book in books %}    - {{ book.num_highlights_added}} highlights from {{ book.title }}
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment