How does the Readwise to Logseq export integration work?

To begin exporting your Readwise highlights to Logseq, you first need to install the Readwise Official plugin from within your Logseq application:

Readwise to Logseq integration installation
  1. Click into the "..." menu within Logseq (typically in the top right corner)
  2. Select Plugins
  3. Click Marketplace and search for "Readwise Official" (note that there are a few other Readwise plugins, so be sure to choose the official version)
  4. Click Install
  5. Back out of the plugins screen to return to Logseq
  6. In the top right you should now see a Readwise logo
  7. Click the logo and finish the configuration from there

We recommend testing the export in a sandboxed graph until you get the settings dialed into your preferences. Then you can export into your main graph.

What happens when I take new highlights? Will those automatically sync with Logseq?

Yes! You can configure the Readwise Logseq plugin to automatically sync any new highlights that come into Readwise. If the highlight is from a new book, article, or Twitter account, a new page in the Logseq graph will be made. If the highlight is from an existing book, article, or Twitter account, the highlight will be appended to the bottom of the existing page. Because the Readwise plugin is append-only, nothing in Logseq will ever be overwritten.

Certain services such as Amazon Kindle, Instapaper, and Pocket only synchronize with Readwise a few times a day. For this reason, the highlight may not immediately appear in either Readwise or Logseq. If you need to sync sooner, you should first force a manual resync in Readwise of the highlight source and then initiate a sync in Logseq from either the Readwise plugin screen.

How do I trigger a new sync from within Logseq?

You can set the Readwise plugin to automatically sync whenever you open the Logseq app. If syncing is set to manual, you can trigger a new sync by opening the plugin menu and clicking "Initiate Sync."

What happens when I update highlights in Readwise? Will those changes automatically sync with Logseq? (Or vice versa?)

At the moment, no.

Can I rename the file of a book, article, or Twitter page in Logseq?

If you rename a file that was generated by the Readwise plugin, the plugin will create a new file with that name on the next export. This means it's fine to rename files for books and articles where you do not expect to take any more highlights, but if you're continuing to take highlights in the document, you will end up with two files.

Can I move either the Readwise folder or individual pages to another location in my Logseq graph?

Similar to the answer above, if you move a file that was generated by the Readwise plugin, the plugin will create a new file in the original location if you took new highlights. This means it's fine to move files for books and articles where you do not expect to take any more highlights, but if you're continuing to take highlights in the document, you will end up with two files.

Can I edit the text of a book, article, or Twitter page in Logseq?

Yes! You can edit the text of a page as you wish and the Readwise integration will not overwrite any changes you make. New highlights will be appended to the bottom of the page.

How do I reset the export of my whole library or an individual document to start fresh?

You can easily reset the Readwise export to start fresh by opening the Readwise plugin menu and clicking the red Reset button at the very bottom.

Important warning!

This will delete all the pages previously created by the plugin, so only use this option if you are certain you do not need any notes you may have taken.

If you have the Kindle app installed on your desktop, clicking the Location link will launch the Kindle app and jump you to the highlight in the book. More on those links here: Can I jump to a highlight directly in the Kindle app?


How can I customize the Readwise to Logseq Export?

One of the most powerful features of the Readwise to Logseq plugin is the ability to customize the formatting of how your highlight data is imported into Logseq. You can customize a variety of elements including:

  • Page title
  • Metadata (such as author, URL, category, title, cover image)
  • Highlight header (inserted whenever new highlights are added)
  • Highlights themselves (e.g. inclusion of links to original, tags, notes, etc.)
  • Sync notifications (a new entry in Logseq each time the Readwise plugin runs)

To begin customizing your export, head to the Logseq Export page from your Readwise Dashboard.

Each component of the export has a "template" using the Jinja2 templating language. The explanations below should illustrate how customization works and give some useful examples.

Page Title

By default, Readwise will insert the title of each document as an H1 (# in Markdown) in the default template:

# {{title}}

Notice the {{title}} variable. As your highlights are exported to Logseq, Readwise will replace the {{title}} variable with the document's actual title.

Let's say you wanted the first line of your export to be the document's title plus the word "Highlights" in parentheses. All you would have to do is append the text " (Highlights)" to the template as follows:

# {{title}} (Highlights)

You can customize this much more using inline-if statements, Jinja2 filters, and much more. The templating language is quite powerful!

Metadata

One of the nicest aspects of the Readwise plugin is that each document can be enhanced with additional metadata such as author name, document URL, document tags, category, full title, cover image, and more.

In the special metadata first block of Logseq, the default template below will insert the author name with double brackets, full title with double brackets, document category (e.g. Book, Article, or Tweet) with a hashtag, URL (if there is one), and document tags in Readwise (if any) with double brackets. In the second block, the template will insert the cover image, if there is one.

author:: [[{{author}}]]\
full-title:: {{full_title}}\
category:: #{{category}}\
{% if url %}url:: {{url}}{% endif %}\
{% if document_tags %}tags:: {% for tag in document_tags %}#[[{{tag}}]] {% endfor %} {% endif %}
{% if image_url %}![]({{image_url}}){% endif %}

Below is an example of how you'd modify the category line if you wanted to append an emoji to each category tag:

Category: #{{category}}{{ " 📚" if category == "books"}}{{" 📰" if category == "articles"}}{{" 🐦" if category == "tweets"}}{{" 🎙" if category == "podcasts"}}

Again, this templating language is quite powerful! You go much deeper with the customization using inline-if statements, Jinja2 filters, and more.

Highlight Header

Another component of the template is the header text that appears above each set of synced highlights. The first time a document is exported to Logseq, the Highlight section will be delineated by a header reading "Highlights first synced by [[Readwise]] [[date]]". Any new highlights taken in this document will be appended beneath with a new header.

{% if is_new_page %}
Highlights first synced by [[Readwise]] [[{{date}}]]
{% elif has_new_highlights %}
New highlights added [[{{date}}]] at {{time}}
{% endif %}

A common use case in tools for thought such as Roam Research and Obsidian is to backlink the date in this header to your Daily Notes page. To make this work for yourself, you'll need to format the {{date}} variable to match your Daily Notes formatting. For example, if your Daily Note uses the format of YYYY-MM-DD, you could match that format by adding a date filter to the variable like so: {{date|date('Y-m-d')}}

Highlights

Of course, you can also format the export of the highlights themselves. By default, each highlight is inserted as a bullet (using a dash), followed by a hyperlink to the original highlight and then sub-bullets for any tags and notes attached to the highlight.

{{ highlight_text }}
{% if highlight_location and highlight_location_url %} ([{{highlight_location}}]({{highlight_location_url}})){% elif highlight_location %} ({{highlight_location}}){% endif %}
    {% if highlight_tags %}
    **Tags**: {% for tag in highlight_tags %}#[[{{tag}}]] {% endfor %}
    {% endif %}
    {% if highlight_note %}
    **Note**: {{ highlight_note }}
    {% endif %}

As mentioned above, there is much more you can do using inline-if statements, Jinja2 filters, and so on.

Sync Notifications

Finally, you can configure the Readwise plugin to append an entry to your Daily Note each time the sync runs. This notification is particularly useful in tools such as Roam Research where the backlink appears more front and center in the Daily Note.

Previous
Roam

Have a suggestion?

We're pretty familiar with our product, so we occasionally fall victim to the Curse of Knowledge. If any part of this documentation confuses you or seems incomplete, please let us know!