我试图以这种方式解析组织模式文本:
* head
** sub-head
- word :: description
** sub-head
- word :: description
- some notes
* head2
** sub-head2
- some more notes
Run Code Online (Sandbox Code Playgroud)
我试图以这样的方式捕获数据(例如"word :: description"和"some notes"),使得每个数据保留其父标题是什么以及父母的父母是什么,等等.我设想数据在elisp中以这样的形式出现:
(
("head"
("sub-head" ("word :: definition"))
("sub-head" ("word :: description" "some notes"))
)
("head2"
("sub-head2" ("some more notes"))
)
)
Run Code Online (Sandbox Code Playgroud)
我猜有一个使用递归的优雅解决方案.如果有更好的方法,我愿意以不同的方式构建elisp中的数据.