添加歌曲索引最简单的方法是,使用如下 Changes.txt 规则来复制 \s 歌曲标题的内容:
'(\\s )([^\\]+)( ?\r?\n)' > '\\toc1 \2\3\1\2\3'
这意味着,查找 \s 章节标题,并将该匹配组称为组 1。
然后获取该标题的内容/文本,并将该匹配组称为组 2。
获取行尾(至少需要一个 \n,但在最终的 \n 之前可能有一个空格和/或 \r),并将该匹配组称为组 3。
然后,在替换侧,放入新的标记 \toc1,后接组 2 的内容和行尾部分。然后将其他所有内容按原样放回(1, 2, 3)。
这些 \toc1 字段现在应该会被拾取并用于目录中。
请注意,您还可以从这些相同的 \toc1 标记生成一个排序后的(目录),用于诗歌书末尾的索引。只需使用 \ztoc|sorta\* 代替 \ztoc|main\*
The easiest way to add an index of songs is to duplicate the contents of the \s Song Titles using a Changes.txt rule like this:
'(\\s )([^\\]+)( ?\r?\n)' > '\\toc1 \2\3\1\2\3'
This says, look for a \s section heading and call that match-group 1.
Then grab the content/text of that heading, calling that match-group 2.
Grab the end of line (which needs at least an \n but might have a space and/or \r before the final \n) and call that match-group 3.
Then, on the replace-with side, put in the new marker \toc1 followed by the contents of 2 and the end of line piece. Then put everything else back as you found it (1,2,3).
These \toc1 fields should now get picked up and used in the Table of Contents.
Note that you can also generate a sorted (table of contents) from these same \toc1 markers for an index at the back of the song book. Just use \ztoc|sorta\* instead of \ztoc|main\*
机器翻译自 English