Is there a way to create link link CamelCase but with dash in it?

180 views
Skip to first unread message

Zhe Lee

unread,
Feb 24, 2020, 3:47:03 AM2/24/20
to tiddl...@googlegroups.com
I know that if you type the word "CamelCase" TiddlyWiki will create a link automatically in TiddlyWiki. 

* But I really need "_" in the word. Like when I type in "Camel_Case" link can be auto created, too. Any way to make it?
* Is there a way to make it work also in Chinese? Since I use Chinese a lot.  

Luis Gonzalez

unread,
Feb 24, 2020, 5:03:33 AM2/24/20
to TiddlyWiki
Tiddlywiki creates automatic links only with CamelCase words but no with Camel_Case with dashes. You have to use the general way of creating links: 

[[CamelCase_WithDash]]


It is the title of the tiddler surrounded by square brackets.
I don't know about the Chinese.

Mat

unread,
Feb 24, 2020, 5:52:12 AM2/24/20
to TiddlyWiki
In addition to what Luis writes, you can - maybe (I didn't test it!) - use the FreeLinking plugins which is announced in the prerelease. Maybe this means that if you have a tiddler titled Camel_Case, then this might be recognized and automatically linked. Of course, every other title will also be autolinked.

<:-)

PMario

unread,
Feb 24, 2020, 12:27:00 PM2/24/20
to tiddl...@googlegroups.com


On Monday, February 24, 2020 at 11:52:12 AM UTC+1, Mat wrote:
In addition to what Luis writes, you can - maybe (I didn't test it!) - use the FreeLinking plugins which is announced in the prerelease.

You probably shouldn't to that. CamelCase linking is a relatively simple and lightweight parsing function. FreeLinking is a heavy weight widget (runtime) function.

I'll create a plugin, that lets you add this function back. It will be a new parsing rule eg: speciallink, which can be enabled and disabled in the ControlPanel.

I'll post a link soon.
 
Maybe this means that if you have a tiddler titled Camel_Case, then this might be recognized and automatically linked.

Early TW versions did Camel-Case linking which caused a lot of problems in various languages. So the functionality was changed.


On Monday, February 24, 2020 at 9:47:03 AM UTC+1, Zhe Lee wrote:

* Is there a way to make it work also in Chinese? Since I use Chinese a lot. 


Can you post a Chinese text, that should be Camel_Case linked? ... I'm not able to produce one. ... But if you post one, It may be possible to test it.

have fun!
mario

PMario

unread,
Feb 25, 2020, 12:52:36 PM2/25/20
to TiddlyWiki
Hi Zhe Lee,

PLEASE BACKUP FIRST!!

I did create a little plugin https://wikilabs.github.io/editions/speciallinks/ that you can drag and drop install to your TW.

It will add a new wiki-parser that will allow Camel_Case links.


Have fun!
mario

TonyM

unread,
Feb 25, 2020, 5:13:54 PM2/25/20
to TiddlyWiki
Mario,

You are a wizard with this kind of thing, I hope you could assist me. I ask now because your above solution is slow close to what I have asked for for some time.
  • Is there a possibility you could generalise this so others could modify it to produce their own parser/pragma?
  • If you see in the core where * # ; : are defined it seems to me it should be trivial to add another special character and set html tags but it is not.
  • could you make a standard plugin template we can modify to set the lead character and the html tags to apply?
  • I really want the leading period "." to trigger a html paragraph around multiple sentences until we get to end of line (line break)
  • However I see value if I could build others 
Thanks if this is possible
Tony

Jeremy Ruston

unread,
Feb 26, 2020, 11:22:03 AM2/26/20
to tiddl...@googlegroups.com
Hi Mario

I haven't been able to test it, but you should be able to accomplish this with a simple module that overrides $tw.config.textPrimitives.wikiLink (see $:/core/modules/config.js)

Best wishes

Jeremy


On 25 Feb 2020, at 17:52, PMario <pmar...@gmail.com> wrote:


Hi Zhe Lee,

PLEASE BACKUP FIRST!!

I did create a little plugin https://wikilabs.github.io/editions/speciallinks/ that you can drag and drop install to your TW.

It will add a new wiki-parser that will allow Camel_Case links.

<Auto Generated Inline Image 1>

Have fun!
mario

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/79f67e6b-f23e-4d8f-81da-859ea2abdf6e%40googlegroups.com.
<Auto Generated Inline Image 1>

PMario

unread,
Feb 26, 2020, 11:44:39 AM2/26/20
to TiddlyWiki
On Wednesday, February 26, 2020 at 5:22:03 PM UTC+1, Jeremy Ruston wrote:
I haven't been able to test it, but you should be able to accomplish this with a simple module that overrides $tw.config.textPrimitives.wikiLink (see $:/core/modules/config.js)

I have checked that route, but I wanted to be able to configure it with ControlPanel settings and the \rules pragma for fine grained control.

-m

PMario

unread,
Feb 26, 2020, 12:37:01 PM2/26/20
to TiddlyWiki
On Tuesday, February 25, 2020 at 11:13:54 PM UTC+1, TonyM wrote:
..
You are a wizard with this kind of thing, I hope you could assist me. I ask now because your above solution is slow close to what I have asked for for some time.
...
  • I really want the leading period "." to trigger a html paragraph around multiple sentences until we get to end of line (line break)
I have seen this request, but I don't understand it. I think the first time it came up with the "single linebreak" - "hard linebreak" in paragraphs discussion.

In my thinking having a dot at the start of the wikitext line is annoying. I'd rather go with some spaces, which you can sometimes see.

Also inserting a dot at the beginning of a line is the same manual work as hitting [Enter] or even 2 times Enter, to create a real wikitext paragraph.

The second problem I have is, that a "hard paragraph" will create HTML code like this:

<p>
<p>This text is wrapped because there was a "dot" at the beginning of the line</p>
</p>

Which is ugly, since TW already suffers from "divitis". So imo we shouldn't add "paragraphitis" if we can avoid it ;)

Mario

TonyM

unread,
Feb 26, 2020, 6:27:36 PM2/26/20
to TiddlyWiki
Mario,

I would expect a dot at the beginning to simply do this.

<p>This text is wrapped because there was a "dot" at the beginning of the line</p>

To me this is a very valuable tool for use in my own wikis, not only for massaging imported content but helping me structure notes as I compose them. It would be easy to remove all leading periods if required and if we copy the resultant html for reuse it is good for sharing.

I want a bespoke setting here, not a change to the fundamental markup standards, and if possible offer the option for other bespoke leading charater markup. eg someone may like to indicate sections or chapters etc... with their own markup, basically allowing a markup character to be defined use standard html tags, tags not already catered for in wikitext or widgets.

Perhaps you are not interested but It would help me (and I believe others would like it) a lot. But the question is why is the addition of such bespoke markup not possible?, from what I can see programmatically it should be trivial, perhaps even entries in a data tiddler to define them. 

With an Editor toolbar  button I can turn all lines into paragraphs buy, select all, click, prepending the lines with a period.

One way to test the value is to copy a big block of multi paragraph lorum ipsum then use a editor toolbar item to select all lines and prepend with ";"

Empty `<P>` tags collapse to one blank line between paragraphs and indicating the "pre-wrapped" line starts helps and editor review the layout, especially for content sourced elsewhere. Which often contains multiple blank lines, using this they all collapse to a single blank line when rendered.

In rapid note taking I use ";" and ":" a lot, and this would complement these by providing automatically managed paragraphs. There is no non-bold equivalent to ";". 

If you have another character or markup pattern in mind happy to consider. But I realy, realy, want this, given my personal organiser, my data imports, note taking in courses etc.. Material I add tends to go nowhere but in my own personal wikis.

And yes, for some people this will satisfy there frustration with the line breaks.

Regards
Tony

PMario

unread,
Feb 26, 2020, 8:52:36 PM2/26/20
to TiddlyWiki
On Thursday, February 27, 2020 at 12:27:36 AM UTC+1, TonyM wrote:

Perhaps you are not interested but It would help me (and I believe others would like it) a lot.

I wouldn't discuss it, if I wouldn't be interested. I just need to understand it in a broader context.
 
But the question is why is the addition of such bespoke markup not possible?

It is possible -- and it should create html markup that is in line with the html spec. The spec is important for eg: accessibility tools like screen readers. So our wikitext should produce output, that doesn't confuse those tools.
 
, from what I can see programmatically it should be trivial, perhaps even entries in a data tiddler to define them. 

Not really trivial. ... The elements you pointed out, are all part of the list-parser. So they create 2 elements.
eg:
* test ... creates an <ul> wrapper and <li> elements.
; test ... creates a <dl> wrapper and <dt> elements.

So if the leading-dot is added, in a naive way it creates nested paragraphs, which is outside the html specs.
I did test it with a <section> wrapper and <p> elements which seems to be OK.

eg:

.test 1
.test 2

will give us

<section>
<p>test 1</p>
<p>test 2</p>
</section>

There may be other possibilities, to add this behaviour, but I didn't think about that ... yet.

-mario

TonyM

unread,
Feb 27, 2020, 2:55:43 AM2/27/20
to TiddlyWiki
Mario

Thanks. That explains a lot more. Would it be ok to nest it in a div, perhaps the div could have a class so styles could be applied e.g. the paragraph style, thus the transition to multiple paragraphs could be changed e.g. 1.5 line space between paragraphs.

Regards
Tony

TiddlyTweeter

unread,
Feb 27, 2020, 3:14:50 AM2/27/20
to TiddlyWiki
Ciao TonyM

Here is my naive comment. I'm still not fully clear what the outcome you looking for is meant to "look like".

But I think CSS might be a workable solution. Either in a div container or a CSS rule that detects markup?

Best wishes
TT

PMario

unread,
Feb 27, 2020, 3:39:48 AM2/27/20
to tiddl...@googlegroups.com
@Tony
@TiddlyTweeter

We hijacked this thread, which shouldn't happen. ... Sorry @ Zhe Lee

I did create a new thread (new parser rule proposed: dot-paragraph) , where we should go on with brainstorming.

have fun!
mario

PMario

unread,
Feb 27, 2020, 3:41:25 AM2/27/20
to TiddlyWiki
@Zhe Lee

Are you still with us?

-m

On Monday, February 24, 2020 at 9:47:03 AM UTC+1, Zhe Lee wrote:

TiddlyTweeter

unread,
Feb 27, 2020, 4:02:27 AM2/27/20
to TiddlyWiki
Whoops! Sorry.
Reply all
Reply to author
Forward
0 new messages