Comments (5)
如果你不喜欢目录的方法,还是想在正文实现,等我这两天稍微修改一下原文代码。
因为作者的“空白章节”的设置是放在chapterHighlights数组进行判断的,所以只要打开开关后,在代码开头加上以下代码即可。
{% for highlightItem in chapterHighlights -%}
{{ highlightItem.chapterTitle }}<br>
{%- endfor %}
如果希望目录还有跳转笔记的功能,只要改成
{% for highlightItem in chapterHighlights -%}
[{{ highlightItem.chapterTitle }}](#{{ highlightItem.chapterTitle | replace(' ', '&') }})<br>
{%- endfor %}
from template-for-obsidian-weread-plugin.
啊,太感谢了!谢谢~!
不急,等您有空的时候帮忙看着改下就行的
主要想实现的其实是这种效果:在目录栏,可以同时看到所有目录(包括没有高亮的)
【原因】这样对于全书的内容可以有一个概览,同时当我需要看某一章节的高亮或划线时,通过目录点过去就可以
再次感谢,期待
from template-for-obsidian-weread-plugin.
所以确实是想在正文中实现的
类似:
元数据
本书评论
# 笔记
## 章节标题
###### 高亮
## 章节标题(没划线没高亮)
## 章节标题
###### 笔记/划线批注
from template-for-obsidian-weread-plugin.
我试了一下,打开空白章节开关后,你把代码开头改成这样就行
{%- 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 -%}
from template-for-obsidian-weread-plugin.
可以了~!可以了~!
太感谢了~!
真的非常感谢~!
from template-for-obsidian-weread-plugin.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from template-for-obsidian-weread-plugin.