├── 首页展示图 ├── pic ├── 鼠标悬浮效果.gif ├── 生成双链精度笔记.gif ├── dataviw内联代码.gif ├── Pasted image 20240129133915.png ├── Pasted image 20240129152557.png ├── Pasted image 20240129153610.png ├── Pasted image 20240129154904.png ├── Pasted image 20240129155207.png ├── Pasted image 20240129164516.png ├── Pasted image 20240129172330.png └── Pasted image 20240129172738.png ├── 无格式分组版nunjucks ├── 无格式混排版nunjucks ├── 美化混排版nunjucks ├── 美化混排版css └── README.md /首页展示图: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sleepleeps/Template-for-obsidian-weread-plugin/HEAD/首页展示图 -------------------------------------------------------------------------------- /pic/鼠标悬浮效果.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sleepleeps/Template-for-obsidian-weread-plugin/HEAD/pic/鼠标悬浮效果.gif -------------------------------------------------------------------------------- /pic/生成双链精度笔记.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sleepleeps/Template-for-obsidian-weread-plugin/HEAD/pic/生成双链精度笔记.gif -------------------------------------------------------------------------------- /pic/dataviw内联代码.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sleepleeps/Template-for-obsidian-weread-plugin/HEAD/pic/dataviw内联代码.gif -------------------------------------------------------------------------------- /pic/Pasted image 20240129133915.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sleepleeps/Template-for-obsidian-weread-plugin/HEAD/pic/Pasted image 20240129133915.png -------------------------------------------------------------------------------- /pic/Pasted image 20240129152557.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sleepleeps/Template-for-obsidian-weread-plugin/HEAD/pic/Pasted image 20240129152557.png -------------------------------------------------------------------------------- /pic/Pasted image 20240129153610.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sleepleeps/Template-for-obsidian-weread-plugin/HEAD/pic/Pasted image 20240129153610.png -------------------------------------------------------------------------------- /pic/Pasted image 20240129154904.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sleepleeps/Template-for-obsidian-weread-plugin/HEAD/pic/Pasted image 20240129154904.png -------------------------------------------------------------------------------- /pic/Pasted image 20240129155207.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sleepleeps/Template-for-obsidian-weread-plugin/HEAD/pic/Pasted image 20240129155207.png -------------------------------------------------------------------------------- /pic/Pasted image 20240129164516.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sleepleeps/Template-for-obsidian-weread-plugin/HEAD/pic/Pasted image 20240129164516.png -------------------------------------------------------------------------------- /pic/Pasted image 20240129172330.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sleepleeps/Template-for-obsidian-weread-plugin/HEAD/pic/Pasted image 20240129172330.png -------------------------------------------------------------------------------- /pic/Pasted image 20240129172738.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sleepleeps/Template-for-obsidian-weread-plugin/HEAD/pic/Pasted image 20240129172738.png -------------------------------------------------------------------------------- /无格式分组版nunjucks: -------------------------------------------------------------------------------- 1 | --- 2 | isbn: {{metaData.isbn}} 3 | category: {{metaData.category}} 4 | lastReadDate: {{metaData.lastReadDate}} 5 | --- 6 | # {{metaData.title}} 7 | `{{metaData.author}}` 8 | {{metaData.intro}} 9 | >[!abstract] [![cover|100]({{metaData.cover}})](<{{metaData.title}}细读>) 10 | > - 作者:{{metaData.author}} 11 | > - 出版时间:{{metaData.publishTime|replace("00:00:00","")}} 12 | > - ISBN:{{metaData.isbn}} 13 | > - 分类:{{metaData.category}} 14 | > - 出版社:{{metaData.publisher}} 15 | > - 划线数量:{{metaData.noteCount}} 16 | > - 笔记数量:{{metaData.reviewCount}} 17 | 18 | ## 笔记 19 | 20 | {%- set allNotes = [] -%} 21 | 22 | {%- for highlightItem in chapterHighlights -%} 23 | {%- for highlight in highlightItem.highlights -%} 24 | {%- set allNotes = allNotes.concat({'type': 'highlight', 'data': highlight}) -%} 25 | {%- endfor -%} 26 | {%- endfor -%} 27 | 28 | {%- for reviewitem in bookReview.chapterReviews -%} 29 | {%- for review in reviewitem.reviews -%} 30 | {%- set allNotes = allNotes.concat({'type': 'review', 'data': review}) -%} 31 | {%- endfor -%} 32 | {%- for chapterReview in reviewitem.chapterReviews -%} 33 | {%- set allNotes = allNotes.concat({'type': 'chapterReview', 'data': chapterReview}) -%} 34 | {%- endfor -%} 35 | {%- endfor -%} 36 | 37 | {%- set allNotes = allNotes|sort(attribute='data.chapterUid')|groupby('data.chapterUid') -%} 38 | 39 | {% for chapterUid, notes in allNotes %} 40 | 41 | ### {{ notes[0].data.chapterTitle }} 42 | 43 | {%- for type, group in notes|groupby('type') %} 44 | ###### {{type | replace("highlight", "高亮") | replace("review", "评论") | replace("chapterReview", "章节评论")}} 45 | {%- for note in group %} 46 | {%- if type == 'highlight' %} 47 | - ▨ {{ note.data.markText | trim }} ^{{note.data.chapterUid}}-{{note.data.range}} 48 | - {{note.data.createTime}} 49 | {%- elif type == 'review' %} 50 | - ◨ {{ note.data.abstract | trim }} 51 | - {{ note.data.content }} ^{{note.data.reviewId}} 52 | - {{note.data.createTime}} 53 | {%- elif type == 'chapterReview' %} 54 | - ◰{{ note.data.content }} ^{{note.data.reviewId}} 55 | - {{note.data.createTime}} 56 | {%- endif %} 57 | {%- endfor %} 58 | {%- endfor %} 59 | {% endfor %} 60 | 61 | {%- for bookReview in bookReview.bookReviews %} {% if bookReview.mdContent.length %} 62 | ## 书评 63 | `写于{{bookReview.createTime}}` 64 | {{bookReview.mdContent}} ^{{bookReview.reviewId}} 65 | {% endif %} {% endfor %} 66 | -------------------------------------------------------------------------------- /无格式混排版nunjucks: -------------------------------------------------------------------------------- 1 | --- 2 | isbn: {{metaData.isbn}} 3 | category: {{metaData.category}} 4 | lastReadDate: {{metaData.lastReadDate}} 5 | --- 6 | # {{metaData.title}} 7 | `{{metaData.author}}` 8 | {{metaData.intro}} 9 | >[!abstract] [![cover|100]({{metaData.cover}})](<{{metaData.title}}细读>) 10 | > - 作者:{{metaData.author}} 11 | > - 出版时间:{{metaData.publishTime|replace("00:00:00","")}} 12 | > - ISBN:{{metaData.isbn}} 13 | > - 分类:{{metaData.category}} 14 | > - 出版社:{{metaData.publisher}} 15 | > - 划线数量:{{metaData.noteCount}} 16 | > - 笔记数量:{{metaData.reviewCount}} 17 | 18 | ## 笔记 19 | 20 | {%- set allNotes = [] -%} 21 | 22 | {%- for highlightItem in chapterHighlights -%} 23 | {%- for highlight in highlightItem.highlights -%} 24 | {%- set allNotes = allNotes.concat({'type': 'highlight', 'data': highlight, 'range': highlight.range.split("-")[0] | int}) -%} 25 | {%- endfor -%} 26 | {%- endfor -%} 27 | 28 | {%- for reviewitem in bookReview.chapterReviews -%} 29 | {%- for review in reviewitem.reviews -%} 30 | {%- set allNotes = allNotes.concat({'type': 'review', 'data': review,'range': review.range.split("-")[0] | int}) -%} 31 | {%- endfor -%} 32 | {%- for chapterReview in reviewitem.chapterReviews -%} 33 | {%- set allNotes = allNotes.concat({'type': 'chapterReview', 'data': chapterReview}) -%} 34 | {%- endfor -%} 35 | {%- endfor -%} 36 | 37 | {%- set allNotes = allNotes|sort(attribute='data.chapterUid')|groupby('data.chapterUid') -%} 38 | 39 | {% for chapterUid, notes in allNotes %} 40 | ### {{ notes[0].data.chapterTitle }} 41 | 42 | {%- for note in notes|sort(attribute='range') %} 43 | 44 | {% if note.type == 'highlight' and not note.data.reviewContent %} 45 | ###### ▨高亮 46 | - {{ note.data.markText | trim }} ^{{note.data.chapterUid}}-{{note.data.range}} 47 | - {{note.data.createTime}} 48 | {% elif note.type == 'review' %} 49 | ###### ◨评论 50 | - {{ note.data.abstract | trim }} 51 | - {{ note.data.content }} ^{{note.data.reviewId}} 52 | - {{note.data.createTime}} 53 | {% elif note.type == 'chapterReview' %} 54 | ###### ◰章节评论 55 | - {{ note.data.content }} ^{{note.data.reviewId}} 56 | - {{note.data.createTime}} 57 | {%- endif %} 58 | {%- endfor %} 59 | {% endfor %} 60 | 61 | {%- for bookReview in bookReview.bookReviews %} {% if bookReview.mdContent.length %} 62 | ## 书评 63 | `写于{{bookReview.createTime}}` 64 | {{bookReview.mdContent}} ^{{bookReview.reviewId}} 65 | {% endif %} {% endfor %} 66 | -------------------------------------------------------------------------------- /美化混排版nunjucks: -------------------------------------------------------------------------------- 1 | --- 2 | isbn: {{metaData.isbn}} 3 | category: {{metaData.category}} 4 | lastReadDate: {{metaData.lastReadDate}} 5 | --- 6 | >[!rnb|noicon] 7 | ># {{metaData.title}} 8 | >` {{metaData.author}}` 9 | 10 | >[!nb|noicon] 11 | 12 | >[!weread1|noicon] 13 | > {{metaData.intro}} 14 | 15 | >[!weread2|noicon] [![cover|100]({{metaData.cover}})](<{{metaData.title}}细读>) 16 | > - 作者: {{metaData.author}} 17 | > - 出版时间: {{metaData.publishTime}} 18 | > - ISBN: {{metaData.isbn}} 19 | > - 分类: {{metaData.category}} 20 | > - 出版社:{{metaData.publishTime|replace("00:00:00","")}} 21 | > - 划线数量:{{metaData.noteCount}} 22 | > - 笔记数量: {{metaData.reviewCount}} 23 | 24 | >[!nb|noicon] 25 | 26 | >[!rnb|noicon] 27 | >## 笔记 28 | 29 | >[!nb|noicon] 30 | 31 | {%- set allNotes = [] -%} 32 | 33 | {%- for highlightItem in chapterHighlights -%} 34 | {%- for highlight in highlightItem.highlights -%} 35 | {%- set allNotes = allNotes.concat({'type': 'highlight', 'data': highlight, 'range': highlight.range.split("-")[0] | int}) -%} 36 | {%- endfor -%} 37 | {%- endfor -%} 38 | 39 | {%- for reviewitem in bookReview.chapterReviews -%} 40 | {%- for review in reviewitem.reviews -%} 41 | {%- set allNotes = allNotes.concat({'type': 'review', 'data': review,'range': review.range.split("-")[0] | int}) -%} 42 | {%- endfor -%} 43 | {%- for chapterReview in reviewitem.chapterReviews -%} 44 | {%- set allNotes = allNotes.concat({'type': 'chapterReview', 'data': chapterReview}) -%} 45 | {%- endfor -%} 46 | {%- endfor -%} 47 | 48 | {%- set allNotes = allNotes|sort(attribute='data.chapterUid')|groupby('data.chapterUid') -%} 49 | 50 | {% for chapterUid, notes in allNotes %} 51 | ### {{ notes[0].data.chapterTitle }} 52 | 53 | {%- for note in notes|sort(attribute='range') %} 54 | {% if note.type == 'highlight' and not note.data.reviewContent %} 55 | >[!weread4] {{ note.data.markText | trim | replace('\n', '
') }} ^{{ note.data.chapterUid }}-{{note.data.range}} 56 | >- {{note.data.createTime}} 57 | >{{ '---' }} 58 | {% elif note.type == 'review' %} 59 | >[!weread3] {{ note.data.abstract | trim | replace('\n', '
') }} 60 | >- {{ note.data.content }} ^{{note.data.reviewId}} 61 | >- {{note.data.createTime}} 62 | >{{ '---' }} 63 | {% elif note.type == 'chapterReview' %} 64 | ###### ◰章节评论 65 | *写于{{note.data.createTime}}* 66 | - {{ note.data.content }} ^{{note.data.reviewId}} 67 | {%- endif %} 68 | {%- endfor %} 69 | {% endfor %} 70 | 71 | {%- for bookReview in bookReview.bookReviews %} {% if bookReview.mdContent.length %} 72 | >[!rnb|noicon] 73 | >## 书评 74 | *写于{{bookReview.createTime}}* 75 | {{bookReview.mdContent}} ^{{bookReview.reviewId}} 76 | {% endif %} {% endfor %} 77 | -------------------------------------------------------------------------------- /美化混排版css: -------------------------------------------------------------------------------- 1 | /*---callout=rnb---*//*---callout=rnb---*//*---callout=rnb---*/ 2 | /*---这个是一个无背景的靠右的悬浮框---*/ 3 | .callout[data-callout="rnb"] { 4 | --callout-color:transparent; 5 | background-color:transparent; 6 | width:40%; 7 | float:right;/*靠右悬浮*/ 8 | border:none; 9 | text-align: right; 10 | } 11 | 12 | /*---隐藏标题栏---*/ 13 | .callout[data-callout="rnb"] .callout-title-inner { 14 | display: none; 15 | } 16 | 17 | 18 | /*---callout=weread1---*/ 19 | /*---这里用来展示书的简介abstract---*/ 20 | .callout[data-callout="weread1"] { 21 | --callout-color:transparent; 22 | background-color:transparent; 23 | font-size:0.95em; 24 | border:none; 25 | text-align:left; 26 | padding:30px; 27 | 28 | 29 | } 30 | 31 | 32 | .callout[data-callout="weread1"] .callout-title-inner { 33 | display: none; 34 | } 35 | 36 | /*---首字下沉---*/ 37 | .callout[data-callout="weread1"] .callout-content p::first-letter{ 38 | 39 | float: left; 40 | font-size: 3em; 41 | font-weight: bold; 42 | line-height: 1; 43 | margin: -0.07em 0.1em -0.1em 0; 44 | } 45 | 46 | 47 | /*---callout=weread2,bookcard---*//*---callout=weread2,bookcard---*//*---callout=weread2,bookcard---*/ 48 | /*---这里用来展示书的卡片---*/ 49 | .callout[data-callout="weread2"] { 50 | --callout-color: 245,207,194; 51 | display:inline-flex; 52 | align-items: center; 53 | font-size:0.9em; 54 | width:90%; 55 | align-content:center; 56 | position:relative; 57 | left:6%; 58 | color:rgb(142,145,106); 59 | 60 | } 61 | 62 | 63 | /*---callout=weread3,notes---*//*---callout=weread3,notes---*//*---callout=weread3,notes---*/ 64 | /*---设定划线评论样式---*/ 65 | .callout[data-callout="weread3"] { 66 | --callout-color: 238,231,187; 67 | --callout-icon: quote; 68 | border:none; 69 | transition: box-shadow 0.3s ease-in-out; 70 | } 71 | 72 | /*---设定标题的样式---*/ 73 | .callout[data-callout="weread3"] .callout-title-inner { 74 | padding:15px; 75 | font-size:0.9em; 76 | font-weight:500; 77 | font-family:"猫啃网糖圆体"; 78 | /*这是我自带的字体,可以任意换成喜爱的样式*/ 79 | } 80 | 81 | /*---设定划线笔记的样式---*/ 82 | .callout[data-callout="weread3"] .callout-content { 83 | 84 | font-family:"ChiuKong Gothic CL";/*这是我自带的字体,可以任意换成喜爱的样式*/ 85 | font-weight: 300; 86 | color:rgb(70,66,52); 87 | font-size:1.01em; 88 | margin-left: 50px; 89 | margin-right: 15px; 90 | padding:10px; 91 | 92 | } 93 | 94 | 95 | /*---设定下划线的样式---*/ 96 | .callout[data-callout="weread3"] .callout-content hr { 97 | border: 0; 98 | height: 0; 99 | border-top: 1px solid rgba(0, 0, 0, 0.1); 100 | border-bottom: 1px solid rgba(255, 255, 255, 0.3); 101 | } 102 | 103 | /*---设定悬浮框样式---*/ 104 | .callout[data-callout="weread3"]:hover { 105 | box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 106 | 107 | 108 | } 109 | 110 | 111 | /*---设定日期预览不显示---*/ 112 | .callout[data-callout="weread3"] .callout-content ul li:nth-child(2) { 113 | display: none; 114 | } 115 | 116 | /*---设定日期悬浮显示---*/ 117 | .callout[data-callout="weread3"]:hover .callout-content ul li:nth-child(2){ 118 | display:inline-flex; 119 | float:right; 120 | background-color:rgb(15,26,121); 121 | color:rgb(220,227,208); 122 | font-size:0.7em; 123 | } 124 | 125 | 126 | /*---callout=weread4,notes---*//*---callout=weread4,notes---*//*---callout=weread4,notes---*/ 127 | /*---设定整体callout的样式---*/ 128 | .callout[data-callout="weread4"] { 129 | --callout-color: 225,217,228; 130 | --callout-icon: star; 131 | border:none; 132 | transition: box-shadow 0.3s ease-in-out; 133 | 134 | } 135 | 136 | /*---设定标题的样式---*/ 137 | .callout[data-callout="weread4"] .callout-title-inner { 138 | padding:15px; 139 | font-size:0.9em; 140 | font-weight:500; 141 | font-family:"猫啃网糖圆体"; 142 | /*这是我自带的字体,可以任意换成喜爱的样式*/ 143 | 144 | } 145 | 146 | /*---设定下划线的样式---*/ 147 | .callout[data-callout="weread4"] .callout-content hr { 148 | 149 | border: 0; 150 | height: 0; 151 | border-top: 1px solid rgba(0, 0, 0, 0.1); 152 | border-bottom: 1px solid rgba(255, 255, 255, 0.3); 153 | 154 | } 155 | 156 | .callout[data-callout="weread4"]:hover { 157 | box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 158 | 159 | } 160 | 161 | 162 | .callout[data-callout="weread4"] .callout-content ul li:first-child { 163 | display: none; 164 | } 165 | 166 | 167 | .callout[data-callout="weread4"]:hover .callout-content ul li:first-child { 168 | display:inline-flex; 169 | float:right; 170 | background-color:rgb(15,26,121); 171 | color:rgb(220,227,208); 172 | font-size:0.7em; 173 | 174 | } 175 | 176 | /*---callout=nb---*//*---callout=nb---*//*---callout=nb---*/ 177 | /*---这个是一个无背景无边框的全行悬浮框---*/ 178 | /*---我拿来换行的,你也可以用别的办法---*/ 179 | 180 | 181 | .callout[data-callout="nb"] { 182 | --callout-color:transparent; 183 | background-color:transparent; 184 | border:none; 185 | width:100%; 186 | 187 | } 188 | 189 | .callout[data-callout="nb"] .callout-title-inner { 190 | display: none; 191 | } 192 | 193 | 194 | /*---callout=metadata---*//*---callout=metadata---*//*---callout=metadata---*/ 195 | /*---这是一个去icon写法,在写callout类型时加|noicon就可以,对任何callout包括默认的都适用---*/ 196 | /*---有别的写法---*/ 197 | .callout:is([data-callout-metadata^="noicon"]) .callout-icon { 198 | display: none; 199 | } 200 | 201 | 202 | 203 | 204 | 205 | 206 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ob-微信读书插件模板大魔改 2 | 3 | ⚜你一直在找的**微信读书模板**: 4 | 5 | + 按照`章节排序`,按照`原文顺序`,`高亮评论混排`, 6 | + 没有高亮的评论(笔记)也能展示 7 | + 没有高亮、评论的章节不展示“高亮”“评论”的相应板块…… 8 | 9 | ⚜**全文导览** 10 | + [三个版本](#我一共做了三个版本满足不同需求)|[功能演示](#美化混排版为例)|[拓展用法](#拓展用法)| [代码](#代码) 11 | 12 | 13 | ![演示图](https://github.com/Sleepleeps/Template-for-obsidian-weread-plugin/blob/main/%E9%A6%96%E9%A1%B5%E5%B1%95%E7%A4%BA%E5%9B%BE) 14 | 15 | 16 | 17 | > [!NOTE] 18 | >+ 我一直想找按照章节和原文顺序排列笔记的模板,苦等无果,贼心四起,搞起代码,几个月前整出一个[雏形](https://forum-zh.obsidian.md/t/topic/26281),但是发现有一点问题。 19 | >+ 作者大人自己有[新版式](https://github.com/zhaohongxuan/obsidian-weread-plugin/discussions/62#discussioncomment-3164134),可以实现类似功能,不过只能展示已经高亮(划线)的评论,如果做评论的时候没有划线,就也无法展示;这不太方便。 20 | >+ 所以我就做了个全新大套件,给大家用用。有问题快来告诉我🌷🌷🌷~ 21 | >>+ 之前做的那个模板没人用,所以有问题我自己过了几个月才发现呢——主要是章节标题没有按照顺序展示的问题。 22 | >> 23 | >> 24 | 25 | ## 我一共做了三个版本满足不同需求。 26 | 27 | 1. `美化混排版` 28 |
29 | 点击查看大图 30 |
31 | 32 |
33 |
34 | 35 | 2. `无格式混排版` 36 |
37 | 点击查看大图 38 |
39 | 40 |
41 |
42 | 43 | 3. `无格式分组版` 44 |
45 | 点击查看大图 46 |
47 | 48 |
49 |
50 | 51 | 52 | 53 | | | **美化混排版** | **无格式混排版** | **无格式分组版** | 54 | | -------------------------------- | -------------- | ---------------- | ---------------- | 55 | | 高亮[^1] |🌷 |🌷 |🌷 | 56 | | 评论[^2]. |🌷 |🌷 |🌷 | 57 | | 章节评论[^3]. |🌷 |🌷 |🌷 | 58 | | 书籍评论[^4]. |🌷 |🌷 |🌷 | 59 | | blockid |🌷 |🌷 |🌷 | 60 | | 时间日期显示 |🌷 |🌷 |🌷 | 61 | | 笔记按章节排序 |🌷 |🌷 |🌷 | 62 | | 章节内按笔记类型排序[^5]. | ✖️ | ✖️ |🌷 | 63 | | 章节内按原文顺序排序[^6]. |🌷 |🌷 | ✖️ | 64 | | 笔记设置了特殊css格式? |🌷 | ✖️ | ✖️ | 65 | | 既“高亮”又“评论”的笔记展示一次? |🌷 |🌷 | ✖️ | 66 | 67 | 以下以`美化混排版`为例,详细讲解**功能**和**拓展用法**。也可以🌟💨*快速通道:直接查看[代码](#代码) 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | [^1]: 空板块不生成。 77 | [^2]: 空板块不生成。 78 | [^3]: 空板块不生成。 79 | [^4]: 空板块不生成。 80 | [^5]: 即章节内,”高亮“、”评论“、”章节评论“分别生成板块 81 | [^6]: 即章节内,”高亮“、”评论“、”章节评论“板块混在一起,按照原文顺序排列 82 | 83 | ## 美化混排版为例 84 | 1. 章节顺序: 85 | 按照章节顺序展示高亮和评论,而不是分成两个部分; 86 | 2. 原文顺序: 87 | 章节标题下,按照原文顺序展示高亮和评论; 88 | 89 |
90 | 点击查看大图 91 |
92 | 93 |
94 |
95 | 96 | 4. 高亮评论不重复: 97 | 同一段话,如果同时“高亮+评论”,只出现一次; 98 | 5. 书籍详情卡: 99 | 书记详情卡图片点击一下会生成跳转链接,创立一个细读文件,方便新做关联。 100 |
101 | 点击查看大图 102 |
103 | 105 |
106 |
107 | 108 | 7. callout优化: 109 | 用callout重新规划了页面的布局,同时做了callout优化,如果原文是分段的,在你的笔记里也是同样的格式。 110 | 如果你不喜欢我的callout,或者怕麻烦,可以直接修改成系统自带的。 111 | 如下: 112 | + 我的callout版式:分段的内容还在标题栏 113 | 114 | 116 | 117 | 118 | + 普通callout版式:分段的内容会直接到callout的内容栏 119 | 120 | 122 | 123 | 124 | 8. 页面美化: 125 | + 笔记开始的时候列出标题、作者和简介,可以使得书本内容一目了然; 126 | + 书籍详情卡片视图,方便查看,也方便截图分享; 127 | + 当鼠标停留在词条上,会有悬浮卡片的效果,同时在右下角显示创建日期,更有互动感; 128 | + 130 | 131 | ## 拓展用法 132 | 1. 标签法: 133 | 我的版本中,因为是混合排列,所以并没有给“高亮”和“评论”加标题;而且我通过不同的callout已经实现了区分。如果后期想要分类查看,可以加标签。代码可以这样修改,评论部分也是这样。 134 | ``` 135 | >[!weread4] {{ note.data.markText | trim | replace('\n', '
') }} ^{{ note.data.chapterUid }}-{{ note.data.range }} 136 | >- {{note.data.createTime}} #高亮 137 | >{{ '---' }} 138 | ``` 139 | 140 | 2. 双链法: 141 | 在阅读中,对于要进一步查阅的地方,直接评论的时候就打上双链标签,这样返回的时候笔记就会生成双链。 142 | + **Step 1** 143 | 144 | 146 | 147 | + **Step 2:** 148 | 149 | 151 | 152 | + **Step 3:** 153 | 为了进一步使用这个双链,你可以使用dataview插件的内联语句,在代码中加上这一句话,就可以看到这个笔记的关联事项。 154 | ``` 155 | `=filter(this.file.outlinks,(x) => meta(x).display != "cover")` 156 | ``` 157 | 159 | 160 | 注:meta(x).display != "cover"是我之前设置的,笔记封面自动双链一个(<{{metaData.title}}细读>))的文档。在这段代码里,我把这个文档过滤了,剩下的筛选出来的,就是自己看书生成的笔记双链。 161 | 162 | 如果你不想生成《{{书名}}细读笔记》这个文档,可以直接删除这行代码,那么dataview的内联代码就改成: 163 | ``` 164 | `=this.file.outlinks` 165 | ``` 166 | 167 | ## 代码 168 | 1. `美化混排版` 169 | + [nunjucks](https://github.com/Sleepleeps/Template-for-obsidian-weread-plugin/blob/main/%E7%BE%8E%E5%8C%96%E6%B7%B7%E6%8E%92%E7%89%88nunjucks) 170 | + [css](https://github.com/Sleepleeps/Template-for-obsidian-weread-plugin/blob/main/%E7%BE%8E%E5%8C%96%E6%B7%B7%E6%8E%92%E7%89%88css) 171 | + 字体 172 | + + [猫啃网糖圆体](https://www.maoken.com/tangyuan) 173 | + [秋空黑体](https://www.maoken.com/freefonts/13086.html) 174 | + [霞鹜新晰黑](https://www.maoken.com/freefonts/8999.html) 175 | 2. `无格式混排版` 176 | + [nunjucks](https://github.com/Sleepleeps/Template-for-obsidian-weread-plugin/blob/main/%E6%97%A0%E6%A0%BC%E5%BC%8F%E6%B7%B7%E6%8E%92%E7%89%88nunjucks) 177 | 3. `无格式分组版` 178 | + [nunjucks](https://github.com/Sleepleeps/Template-for-obsidian-weread-plugin/blob/main/%E6%97%A0%E6%A0%BC%E5%BC%8F%E5%88%86%E7%BB%84%E7%89%88nunjucks) 179 | --------------------------------------------------------------------------------