本篇文章针对 Weread 插件进行介绍梳理,主要包括需求分析、插件安装、核心功能设置、模板分享以及示例参考等。原文地址:Obsidian插件篇-Weread插件。
---
isbn: {{metaData.isbn}}
category: {{metaData.category}}
lastReadDate: {{metaData.lastReadDate}}
---
# {{metaData.title}}
>[!info] 简介
{{metaData.intro | striptags | trim }}
>[!abstract] 书籍信息
> - 
> - 作者:{{metaData.author}}
> - 出版时间:{{metaData.publishTime|replace("00:00:00","")}}
> - ISBN:{{metaData.isbn}}
> - 分类:{{metaData.category}}
> - 出版社:{{metaData.publisher}}
> - 划线数量:{{metaData.noteCount}}
> - 笔记数量:{{metaData.reviewCount}}
{%- for bookReview in bookReview.bookReviews %} {% if bookReview.mdContent.length %}
## 书评
- ⏱ {{bookReview.createTime}}
^{{bookReview.reviewId}}
{{bookReview.mdContent}}
{% endif %} {% endfor %}
{%- set allNotes = [] -%}
{%- for highlightItem in chapterHighlights -%}
{%- if highlightItem.highlights.length>0 -%}
{%- for highlight in highlightItem.highlights -%}
{%- set allNotes = allNotes.concat({'type': 'highlight', 'data': highlight, 'range': highlight.range.split("-")[0] | int}) -%}
{%- endfor -%}
{%- else -%}
{%- set allNotes = allNotes.concat({'type': '0', 'data': highlightItem, 'range': '0' }) -%}
{%- endif -%}
{%- endfor -%}
{%- for reviewitem in bookReview.chapterReviews -%}
{%- for review in reviewitem.reviews -%}
{%- set allNotes = allNotes.concat({'type': 'review', 'data': review,'range': review.range.split("-")[0] | int}) -%}
{%- endfor -%}
{%- for chapterReview in reviewitem.chapterReviews -%}
{%- set allNotes = allNotes.concat({'type': 'chapterReview', 'data': chapterReview}) -%}
{%- endfor -%}
{%- endfor -%}
{%- set allNotes = allNotes|sort(attribute='data.chapterUid')|groupby('data.chapterUid') -%}
{% for chapterUid, notes in allNotes %}
### {{notes[0].data.chapterTitle}}
{%- for note in notes|sort(attribute='range') %}
{% if note.type == 'highlight' and not note.data.reviewContent %}
###### 高亮
- ⏱ {{note.data.createTime}} ^{{note.data.chapterUid}}
{{ note.data.markText}}
{% elif note.type == 'review' %}
###### 划线评论
- ⏱ {{note.data.createTime}}
^{{note.data.reviewId}}
{{ note.data.abstract}}
{{note.data.content}}
{% elif note.type == 'chapterReview' %}
###### 章节评论
- ⏱ {{note.data.createTime}}
^{{note.data.reviewId}}
{{note.data.content}}
{%- endif %}
{%- endfor %}
{% endfor %}
---
tags: WeRead
isbn: {{metaData.isbn}}
lastReadDate: {{metaData.lastReadDate}}
---
# 书籍信息
> [!abstract] {{metaData.title}}
> - 
> - 书名: {{metaData.title}}
> - 作者: {{metaData.author}}
> - 简介: {{metaData.intro| striptags | trim }}
> - 出版时间: {{metaData.publishTime}}
> - ISBN: {{metaData.isbn}}
> - 分类: {{metaData.category}}
> - 出版社: {{metaData.publisher}}
> - PC地址:{{metaData.pcUrl}}
# 书评
{% if bookReview.bookReviews %}
{% for bookReview in bookReview.bookReviews %}
## 书评 No.{{loop.index}}
⏱ {{bookReview.createTime}}
^{{bookReview.reviewId}}
{{bookReview.mdContent}}
{% endfor %}
{% endif %}
# 笔记
{% for chapter in bookReview.chapterReviews %}
{% if chapter.reviews or chapter.chapterReview %}
## {{chapter.chapterTitle}}
{% if chapter.chapterReviews %}
{% for chapterReview in chapter.chapterReviews %}
###### 章节评论 No.{{loop.index}}
- ⏱ {{chapterReview.createTime}}
^{{chapterReview.reviewId}}
{{chapterReview.content}}
{% endfor %}
{% endif %}
{% if chapter.reviews %}
{% for review in chapter.reviews %}
###### 划线评论
- ⏱ {{review.createTime}}
^{{review.reviewId}}
{{review.abstract}}
{{review.content}}
{% endfor %}
{% endif %}
{% endif %}
{% endfor %}
# 划线
{% for chapter in chapterHighlights %}
{% if chapter.level == 1 %}## {{chapter.chapterTitle}}
{% elif chapter.level == 2 %}### {{chapter.chapterTitle}}
{% elif chapter.level == 3 %}#### {{chapter.chapterTitle}}
{% endif %}
{% for highlight in chapter.highlights %}
- ⏱ {{highlight.createTime}} ^{{highlight.bookmarkId}}
{{ highlight.markText}}
{% endfor %}{% endfor %}
超级快速阅读-摘录与笔记