Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] template 能否加入yaml格式 #157

Closed
stdAri opened this issue Sep 27, 2022 · 10 comments
Closed

[Feature] template 能否加入yaml格式 #157

stdAri opened this issue Sep 27, 2022 · 10 comments
Labels
enhancement New feature or request

Comments

@stdAri
Copy link

stdAri commented Sep 27, 2022

为了配合其他md软件使用,有没有办法可以利用yaml格式给笔记添加信息。目的是将文献的metadata写入到yaml,在obsidian中利用利用dataview去直接检索相关的yaml内容。

  • 当前如果用---的方式添加yaml文本,导出的文本为\---
  • 如果用下面这种方式导出的话,导出文本为* * *,都没有办法很好地兼容yaml。
    image
@stdAri stdAri added the enhancement New feature or request label Sep 27, 2022
@windingwind
Copy link
Owner

是需要导出为yaml文件,还是在导出md过程中遇到符号转义问题?

@stdAri
Copy link
Author

stdAri commented Sep 30, 2022

编辑器会自动将MD的---语法转义成单行,如果直接是---导出的时候会变成\---,单行导出为* * *,所以可以理解为导出为MD文件,但是是包含了YAML格式的信息,作为markdown的metadata,但是这种行为在Zotero内部是不支持的,或者说Zotero不认为这是yaml格式的信息,导出过程中会对其进行转义,破坏原有的格式

@windingwind
Copy link
Owner

你是通过何种方式导出的,导出并不会转义行分隔符。
image

@stdAri
Copy link
Author

stdAri commented Sep 30, 2022

你这种是按照作为单行导出的。

我是按照这种方式,直接将对应的yaml格式文本复制进去。然后进行导出(这样子的做法,是考虑到自定义Template导出的时候,可以复制到粘贴板,然后在将对应的metadata粘贴到笔记里)

---
test:test
---

image

如果用这种导出方式的话,是会转义字符的

@windingwind
Copy link
Owner

已去除对-的转义,将在下一版本发布

@windingwind
Copy link
Owner

已更新

@luohuaaa
Copy link

luohuaaa commented Mar 7, 2023

已更新
没有吧,---导出到markdown照样变成\---

@windingwind
Copy link
Owner

专门模板控制文件头的yaml header,因此不会支持正文的yaml

@luohuaaa
Copy link

luohuaaa commented Mar 7, 2023

正文加yaml其实是因为betternote自带的表头基本没什么用,比如作者、年份这类最基本的信息全都没有,理论上只要是条目笔记就应该可以读取这些信息吧,能否扩充一下表头的内容?

@windingwind
Copy link
Owner

请看文档。表头由模板自定义

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants