Skip to content

Instantly share code, notes, and snippets.

@mi-skam
Last active October 24, 2025 10:27
Show Gist options
  • Select an option

  • Save mi-skam/d7fcddb905881edec6df6fb5bf6cda89 to your computer and use it in GitHub Desktop.

Select an option

Save mi-skam/d7fcddb905881edec6df6fb5bf6cda89 to your computer and use it in GitHub Desktop.
Readwise to Obsidian Export Template

Readwise to Obsidian Export Template

File Name

{{title|replace("#","")|replace("?","")|replace(".","")|replace(""","")|replace(""","")|replace("'","")|replace("'","")|truncate(127)}}

Page Metadata (book_page_metadata_template)


author: {% if author %}"[[{{author}}]]"{% endif %} title: "{{full_title}}" source_type: {{category}} highlighted: {{last_highlighted_date|date('Y-m-d')}} published: {{published_date|date('Y-m-d')}} {% if url -%} url: {{url}} {% endif -%} tags:

  • literature {% if document_tags %}{% for tag in document_tags %} - {{tag}} {% endfor %}{% endif %}

{% raw %}

[!IMPORTANT] Next highlight

not done
path includes {{query.file.path}}
hide scheduled date
hide edit button
hide backlink
hide postpone button
LIMIT 1

{% endraw %}

{% if image_url -%} cover

{% endif -%}

Highlights Header (book_header_template)

{% if is_new_page %}

Highlights

{% elif has_new_highlights -%}

New highlights added {{date|date('F j, Y')}} at {{time}}

{% endif -%}

Highlight (book_highlight_template)

  • {{ highlight_text }}{% if highlight_location and highlight_location_url %}
    • {{highlight_location}}{% elif highlight_location %}
    • {{highlight_location}}{% endif %}{% if highlight_tags %}
    • Tags: {% for tag in highlight_tags %}#readwise/{{tag}} {% endfor %}{% endif %}{% if highlight_note %}
    • Note: {{ highlight_note }}{% endif %}

Next highlight to review

TASK
FROM #literature
WHERE !completed
LIMIT 1

All pending highlights

TASK
FROM #literature
WHERE !completed
GROUP BY file.link

Progress overview (incomplete only)

TABLE
  length(filter(file.tasks, (t) => t.completed)) as "Done",
  length(file.tasks) as "Total",
  choice(
    length(filter(file.tasks, (t) => t.completed)) = 0,
    "📝",
    "⏳"
  ) as "Status"
FROM #literature
WHERE file.tasks AND length(filter(file.tasks, (t) => t.completed)) < length(file.tasks)
SORT length(filter(file.tasks, (t) => t.completed)) / length(file.tasks) ASC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment