Add startCount to unusedtitle macro, new tests, new docs (#7941)

* add startCount to unusedtitle macro, new tests, new docs

* rename test files

* update .from-version in docs
This commit is contained in:
Mario Pietsch
2024-09-10 11:49:41 +02:00
committed by GitHub
parent b12625c9f6
commit 8a8dcf8255
9 changed files with 81 additions and 18 deletions

View File

@@ -14,7 +14,15 @@ title: Output
<<unusedtitle baseName:"About" separator:"-">>
<!-- v5.3.6 startCount -->
<<unusedtitle startCount:"3">>
<<unusedtitle startCount:"-1" baseName:"invalid start">>
<<unusedtitle startCount:"aaa" baseName:"invalid count">>
+
title: ExpectedResult
<p>New Tiddler</p><p>New Tiddler</p><p>anotherBase</p><p>About</p>
<p>New Tiddler</p><p>New Tiddler</p><p>anotherBase</p><p>About</p><p>New Tiddler 3</p><p>invalid start</p><p>invalid count</p>

View File

@@ -0,0 +1,27 @@
title: Macros/unusedtitle/template-startCount
description: test <<unusedtitle>> with templates and startCount
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]
title: Output
<!-- test template basics -->
<<unusedtitle template:"$basename$$separator$$count$xx" >>
<<unusedtitle template:"$basename$$separator$$count$xx" startCount:"4" >>
<<unusedtitle template:"$basename$$separator$$count:1$xx" startCount:"11">>
<!-- test parameter edgecases -->
<<unusedtitle template:"$basename$$separator$$count:2$xx" startCount:"" baseName:"emptyCount">>
<<unusedtitle template:"$basename$$separator$$count$xx" startCount:"-1" separator:"" baseName:"invalid start" >>
<<unusedtitle template:"$basename$$separator$$count$xx" startCount:"bbb" separator:"" baseName:"invalid count" >>
+
title: ExpectedResult
<p>New Tiddler 0xx</p><p>New Tiddler 4xx</p><p>New Tiddler 11xx</p><p>emptyCount 00xx</p><p>invalid start 0xx</p><p>invalid count 0xx</p>

View File

@@ -25,4 +25,4 @@ title: Output
+
title: ExpectedResult
<p>New Tiddler</p><p>count-missing</p><p>00-new</p><p>00-base</p><p>00-New Tiddler</p><p>00-asdf</p><p>00 asdf</p>
<p>New Tiddler</p><p>count-missing0</p><p>00-new</p><p>00-base</p><p>00-New Tiddler</p><p>00-asdf</p><p>00 asdf</p>