Rules Pragma? and documentation

77 views
Skip to first unread message

TW Tones

unread,
Aug 1, 2021, 10:01:17 PM8/1/21
to TiddlyWiki
Folks,

TiddlyWiki has a rich set of parsing features and rules that apply. See this page 
Here you can switch on or off any rule in the whole wiki.

There is also the \rules pragma which is only mentioned not documented sufficiently.

When searching tiddlywiki.com the rules pragma can only be found in the following forms
  • \rules  (which presumably means none)
  • \rules only list of rules (as named meaning rule in particular rules)
However I do not want to name every rule but the one I do not want wikilinks in a given tiddler.

I would have hopped there were a \rules not rulesnames

Is there missing documentation or missing features?

Regards
Tones

Eric Shulman

unread,
Aug 1, 2021, 10:21:06 PM8/1/21
to TiddlyWiki
On Sunday, August 1, 2021 at 7:01:17 PM UTC-7 TW Tones wrote:
There is also the \rules pragma which is only mentioned not documented sufficiently.
When searching tiddlywiki.com the rules pragma can only be found in the following forms
  • \rules  (which presumably means none)
  • \rules only list of rules (as named meaning rule in particular rules)
However I do not want to name every rule but the one I do not want wikilinks in a given tiddler.
I would have hoped there were a \rules not rulesnames

in $:/core/modules/parsers/wikiparser/wikiparser.js, there's this code:
WikiParser.prototype.amendRules = function(type,names) {
names = names || [];
// Define the filter function
var target;
if(type === "only") {
target = true;
} else if(type === "except") {
target = false;
} else {
return;
}
... 

Thus, you can use "\rules only ..." AND "\rules except ..."
So, for your goal, use "\rules except wikilinks"

Also, your link to the list of parse rules didn't work.  Here's the correct ControlPanel link:
You can find the TWCore code for each rule by searching from $:/AdvancedSearch, Shadows tab for:
$:/core/modules/parsers/wikiparser/rules/

enjoy,
-e

Eric Shulman

unread,
Aug 1, 2021, 10:23:12 PM8/1/21
to TiddlyWiki
So, for your goal, use "\rules except wikilinks"

Errata: that should be "\rules except wikilink"

-e

TW Tones

unread,
Aug 1, 2021, 11:22:17 PM8/1/21
to TiddlyWiki
Eric,

thanks. I tried to determine it by searching the core.

Do you confidently understand what \rules  without a parametter does?

I will do a little doco

Tones

PMario

unread,
Aug 2, 2021, 1:46:53 AM8/2/21
to TiddlyWiki
Hi,

As Eric mentioned. Some of your links are broken.

\rules alone does nothing.

-m

PMario

unread,
Aug 2, 2021, 1:50:35 AM8/2/21
to TiddlyWiki
Hi,

Have a look at the ControlPanel : Settings tab. The first option lets you disable CamelCase wikilinks globally.

-m

TW Tones

unread,
Aug 2, 2021, 7:03:29 PM8/2/21
to TiddlyWiki
Mario,

Yes I was aware of that, I was just trying in a single tiddler and the documentation falls short, not mentioning the "\rules except".

Thanks
Tones
Reply all
Reply to author
Forward
0 new messages