Temporarily getting rid of camel case

153 views
Skip to first unread message

Werner

unread,
Aug 14, 2020, 11:40:02 AM8/14/20
to TiddlyWiki
Camel case is sort of an annoyance for me. I don't want to switch it off completely, but sometimes I don't want it while transcluding. Here's an example: I run a company database, and companies sometimes have camel case names.

I dynamically create reports for companies which I have stored in a JSON tiddler. The currently active company is kept in a tiddler named activeDossier, its text field looks like {{companyRegister##0/name}}. I can transclude it into my dynamically created report, but when the company name is in camel case it gets auto-converted to a link. How do I get rid of this (without the global switch)? 

Apart from that, an additional parameter for the <$transclude> widget eliminating camel case would be great.

Thanks
Werner

Eric Shulman

unread,
Aug 14, 2020, 1:43:33 PM8/14/20
to TiddlyWiki
On Friday, August 14, 2020 at 8:40:02 AM UTC-7, Werner wrote:
Camel case is sort of an annoyance for me. I don't want to switch it off completely, but sometimes I don't want it while transcluding. Here's an example: I run a company database, and companies sometimes have camel case names.
...when the company name is in camel case it gets auto-converted to a link. How do I get rid of this (without the global switch)? 

Add this "pragma" to the top of a tiddler:
\rules except wikilink
This will disable automatic CamelCase links only for content in that tiddler.

Notes:
* There is also a "\rules only ..." pragma
* To see the full list of rules that can be referenced, enter this in the $:/AdvancedSearch, filter input:
[[wikiparserrules[]]

enjoy,
-e

Werner

unread,
Aug 14, 2020, 4:16:59 PM8/14/20
to TiddlyWiki
Eric, you’re awesome. Thanks so much

Werner

TW Tones

unread,
Aug 14, 2020, 8:50:48 PM8/14/20
to TiddlyWiki
Werner

In some cases using the text widget will help produce a result which is not evaluated as camelCase. The simple version of the link widget does this to. So if a multiword title where one word is camel case that will not become a link.

Regards
Tones

Werner

unread,
Aug 15, 2020, 4:16:22 PM8/15/20
to tiddl...@googlegroups.com
Hi Tones,

thanks. The text widget is usually the first thing I resort to. In this case, I was not able getting transclusion to work, though.

Best, Werner

Werner

unread,
Aug 17, 2020, 9:45:32 AM8/17/20
to TiddlyWiki
Eric, your solution only seems to work with static text, like

\rules except wikilink
CamelCaseText

and not in a situation when the camel case text is generated programatically like transclusion.

as I wrote to TW Tones, normally I would resort to the text widget, but, so far, I haven't managed to properly assign the text parameter based on my dynamic content.

Any clue would be greatly appreciated
Werner

Eric Shulman

unread,
Aug 17, 2020, 10:43:57 AM8/17/20
to tiddl...@googlegroups.com
On Monday, August 17, 2020 at 6:45:32 AM UTC-7, Werner wrote:
Eric, your solution only seems to work with static text, like
\rules except wikilink
CamelCaseText

and not in a situation when the camel case text is generated programatically like transclusion.
Any clue would be greatly appreciated

ok... try this instead of the \rules
\define tv-wikilinks() no
This will suppress *all* links, even from transclusions (note: except for external links, i.e., "http://...")

Alternatively, you can write it this way:
<$vars tv-wikilinks=no><$transclude tiddler="SomeTiddler" mode="block" /></$vars>
This will only suppress the links for that specific transclusion, but render all other links as usual

-e





 

Werner

unread,
Aug 17, 2020, 12:11:19 PM8/17/20
to TiddlyWiki
Tried the latter option. Works. Many thanks.
Reply all
Reply to author
Forward
0 new messages