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 10:49:41 +01:00
committed by GitHub
parent b12625c9f6
commit 8a8dcf8255
9 changed files with 81 additions and 18 deletions
+6 -4
View File
@@ -16,20 +16,22 @@ exports.name = "unusedtitle";
exports.params = [
{name: "baseName"},
{name: "separator"},
{name: "template"}
{name: "template"},
{name: "startCount"}
];
/*
Run the macro
*/
exports.run = function(baseName,separator,template) {
exports.run = function(baseName,separator,template,startCount) {
separator = separator || " ";
startCount = startCount || 0;
if(!baseName) {
baseName = $tw.language.getString("DefaultNewTiddlerTitle");
}
// $tw.wiki.generateNewTitle = function(baseTitle,options)
// options.prefix must be a string!
return this.wiki.generateNewTitle(baseName, {"prefix": separator, "template": template});
// options.prefix must be a string!
return this.wiki.generateNewTitle(baseName, {"prefix": separator, "template": template, "startCount": startCount});
};
})();