1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-29 11:30:28 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers/macros/UnusedTitleMacro.tid
Mario Pietsch 8a8dcf8255
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
2024-09-10 10:49:41 +01:00

44 lines
1.6 KiB
Plaintext

caption: unusedtitle
created: 20210104143546885
modified: 20240119224103283
tags: Macros [[Core Macros]]
title: unusedtitle Macro
type: text/vnd.tiddlywiki
The <<.def unusedtitle>> [[macro|Macros]] returns an unused title. Optionally you can provide a base title to generate the new title.
It uses the same method as the create new tiddler button, a number is appended to the end of the base name.
!! Parameters
; baseName
: A string specifying the desired base name, defaulting to `New Tiddler`. <br>The default setting can be adjusted in the $:/ControlPanel '': Info : Basics - tab.''
; separator
: <<.from-version "5.2.0">> An ''optional'' string specifying the separator between baseName and the unique number. eg: `separator:"-"`. Defaults to a space: `" "`. If you need an empty separator use the ''template''!
; template
: <<.from-version "5.2.0">> An ''optional'' template string can be used to allow you maximum flexibility. If the template string is used, there will always be a counter value.
; startCount
: <<.from-version "5.3.6">> An ''optional'' parameter, that sets the initial value for the new tiddler counter.
!! Template String
; `$basename$`
: This variable will be replaced by the content of the ''baseName'' parameter
; `$separator$`
: This variable will be replaced by the ''separator'' parameter
;`$count$`
: This variable will be created automatically and is a counter starting with 0
;`$count:4$`
: This variable will be created automatically and starts at 0000
: `:4` represents the number of digits
!! Examples
<<list-links "[prefix[unusedtitle Macro (E]!sort[]]">>