Files
note2any/todo.list
2025-09-22 18:54:59 +08:00

75 lines
3.6 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

1. 目前图片只能识别![[imagefile]],无法识别![img](path/imagefile)把markdownown文件中![img](path/imagefile)转化为[[imagefile]]。
如:![img](img/2025ZK1-7.jpg)转为![[2025ZK1-7.jpg]]
2. 读取markdown的frontmatter属性文章标题取title和作者取author内容。
以附件2025ZK1.md为例
提取以下信息(忽略两端的“”):
- 如tiltle不为空文章title不使用文件名使用: 6月特种兵式观展
- 如果author不为空公众号文章作者: 大童。
- ![alt](path/to/name.ext), ![[name.ext]]不分优先级,看哪个在文章的最前面,取最前面这个作为封面图片
3. 预处理markdown文件
对{{<gallery dir="/img/guanzhan/1" figcaption="毕业展"/>}}{{<load-photoswipe>}}或{{<gallery dir="/img/guanzhan/1"/>}}{{<load-photoswipe>}}
- 获取dir中的内容如"/img/guanzhan/1"与PREPATH拼接全局定义PRE_PATH=/Users/gavin/myweb/static
图片所在路径PREPATH+"/img/guanzhan/1",即/Users/gavin/myweb/static/img/guanzhan/1。
- 这个/Users/gavin/myweb/static/img/guanzhan/1路径下图片<5张取出所有图片; >n张任意取出n张。n=NUM_PIC作为全局定义。
- 比如n=1取出的图片为xx.jpg那么把{{<gallery dir="/img/guanzhan/1" figcaption="毕业展"/>}}{{<load-photoswipe>}}替换为![[xx.jpg]]
如n=2取出的图片为xx.jpg,yy.png那么把{{<gallery dir="/img/guanzhan/1" figcaption="毕业展"/>}}{{<load-photoswipe>}}替换为:
![[xx.jpg]]
![[yy.png]]
3.
对如下:
{{<gallery>}}
{{<figure src="/img/晋中晋北行程.jpeg" caption="晋中晋北行程" >}}
{{<figure src="/img/晋中晋北行程-2.png" caption="晋中晋北行程" >}}
{{<figure src="/img/晋中晋北行程-3.png" caption="晋中晋北行程" >}}
{{</gallery>}}
替换为
![[晋中晋北行程.jpeg]]
![[晋中晋北行程-2.jpeg]]
![[晋中晋北行程-3.jpeg]]
src可能使用link
{{<gallery>}}
{{<figure link="/img/2025ZK12.jpg" caption="">}}
{{<figure link="/img/2025ZK12-2.jpg" caption="">}}
{{</gallery>}}
替换为
![[2025ZK12.jpg]]
![[2025ZK12-2.jpg]]
4.
参考以下代码,渲染[fig content/],|| content,||r content,||g content,||b content等标签
`\[fig([^>]*?)/\]` `<span style="font-style: italic; font-size: 14px; background-color: #f5f5f5; padding: 2px;">$1</span>`
`\|\| (.*)` `<p style="font-family:'Microsoft YaHei',sans-serif;background-color:#E5E4E2 ;padding:10px;border-radius:20px;line-height:30px;">$1</p>`
`\|\|r (.*)` `<p style="font-family:'Microsoft YaHei',sans-serif;color:white;background-color:#6F4E37;padding:10px;border-radius:20px;line-height:30px;">$1</p>`
`\|\|g (.*)` `<p style="font-family:'Microsoft YaHei',sans-serif;background-color:#BCE954;padding:10px;border-radius:20px;line-height:30px;">$1</p>`
`\|\|b (.*)` `<p style="font-family:'Microsoft YaHei',sans-serif;background-color:#B6B6B4;padding:10px;border-radius:20px;line-height:30px;">$1</p>`
`\|\|y (.*)` `<p style="font-family:'Microsoft YaHei',sans-serif;background-color:#FFFFC2;padding:10px;border-radius:20px;line-height:30px;">$1</p>`
||连续多行只渲染第一行,举例:
|| content1
content2
content3
渲染为:
<p style="font-family:'Microsoft YaHei',sans-serif;font-size:14px; background-color:#FFFFC2;padding:10px;border-radius:20px;line-height:30px;">content1</p>
content2
content3
而不是:
<p style="font-family:'Microsoft YaHei',sans-serif;font-size:14px; background-color:#FFFFC2;padding:10px;border-radius:20px;line-height:30px;">content1
content2
content3
</p>
5. 文章没有图片,封面使用一张默认图片(设计一张)。