Automatically referencing to hot spots

176 views
Skip to first unread message

blackHole

unread,
Apr 22, 2017, 9:14:18 AM4/22/17
to TiddlyWiki

Hi !

 

Recently I have learned about TiddlyWiki ( I'm using TiddlyWiki Classic; version 2.8.1 I presume ), but I have tried to learn as much as I could, and now I'm using it to develop a quite long tutorial about programming.

 

My problem is that I need to "automatize" the creation of inner references, it's to say I would like to insert inside the text something  looking like "some text ... (HowTo: Define a class) ... some more text" and "magically" find in the tiddler "HowTo" a link "Define a class" pointing to the pertinent, tiddle.

 

Is it practicable ??

 

Thanks for your replies !!

c pa

unread,
Apr 24, 2017, 3:08:51 PM4/24/17
to TiddlyWiki
Dear Mr. Hole,

Yes this is practical. You need to decide how you want it to work, based on your needs

Easiest way: [[HowTo:Define a class]] creates a link in this tiddler to a tiddler named "HowTo:Define a class"

Then in a different tiddler you can create a list that returns all internal links in all tiddlers, from that filter, filter for the prefix "How To:", that returns all tiddlers with an internal link to a How To tiddler.

Is that what you're looking for?

blackHole

unread,
Apr 24, 2017, 4:17:59 PM4/24/17
to TiddlyWiki

Hi ! Thank you so much for the reply !

( 1 )
How can I create the list of all internal links in all tiddlers ? Does exist a specific macro or a plugin ?

( 2 )
Let's say, as example, that we are talking about HTML. The above mentioned list should contain all 
<a name="foo">bar</A> tags.
A link pointing to an anchor could be added in a text written many time after the anchor creation.
Therefore the point is how to keep an automatically updated list of all available anchors.
Anyway a even a list of all <A href="#foo">bar</A> tags will be very useful.

Bye!

Mark S.

unread,
Apr 24, 2017, 7:21:37 PM4/24/17
to TiddlyWiki
I don't understand your question. If you create a link inside your text (e.g. [[Define a Class]]) it will automatically create a link. If you click on the link it will take you to the tiddler. If the tiddler doesn't exist, you will be taken to a blank tiddler which you can begin editing to create the tiddler.

I believe that it worked this way both in TWC and TW5.

If you want something more advanced than that type of auto-creation, you will probably need to give more details.

Also, if you want your answer for TW Classic you should probably change your question or start a new question with the term [TWC] in the title. This will alert people that you need help regarding TWC. I think the answer C Pa was suggesting applied to TW5. TWC is getting old now, and there's going to be fewer people and resources that can help you with issues. You might consider TW5 instead.

Good luck!
Mark

Eric Shulman

unread,
Apr 24, 2017, 8:35:46 PM4/24/17
to TiddlyWiki
On Monday, April 24, 2017 at 4:21:37 PM UTC-7, Mark S. wrote:
I don't understand your question. If you create a link inside your text (e.g. [[Define a Class]]) it will automatically create a link. If you click on the link it will take you to the tiddler. If the tiddler doesn't exist, you will be taken to a blank tiddler which you can begin editing to create the tiddler.
I believe that it worked this way both in TWC and TW5.
If you want something more advanced than that type of auto-creation, you will probably need to give more details.

As you noted, the standard core behavior (for both TWC and TW5) provides syntax for links to tiddler titles (even if they don't exist).  However, the OP question was about links that work as "inner refererences" to specific places within a tiddler, similar to the HTML-standard <a name="foo"> syntax for creating "anchor links" within a web page.

For TWC, I created this plugin:

Note: there is no equivalent plugin for TW5... in part, because tiddler "sections" are no longer a TiddlyWiki construct.  Instead, the TW5 philosophy is to create separate tiddlers that define the smallest units of "semantic content", and then use standard TW5 navigation, widgets, and macros to aggregate and interact with the content in the larger context of the entire document.

Also, if you want your answer for TW Classic you should probably change your question or start a new question with the term [TWC] in the title. This will alert people that you need help regarding TWC. I think the answer C Pa was suggesting applied to TW5. TWC is getting old now, and there's going to be fewer people and resources that can help you with issues. You might consider TW5 instead.

I agree.  Even though there is no equivalent SectionLinksPlugin for TW5, it is a good idea to start all *new* projects using TW5 rather than TWC, since TWC'scode base (v2.8.1), though still functional, is VERY old and is no longer being actively developed, and the architecture provided by TW5 is *much* more powerful and flexible than TWC.

enjoy,
-e
Eric Shulman
TiddlyTools.com: "Small Tools for Big Ideas" (tm)
InsideTiddlyWiki: The Missing Manuals

Mat

unread,
Apr 25, 2017, 7:27:28 AM4/25/17
to TiddlyWiki
blackHole wrote:

Recently I have learned about TiddlyWiki ( I'm using TiddlyWiki Classic; version 2.8.1 I presume ),

Welcome blackHole! May I just ask, how come you choose TW Classic rather than TW5? You're of course free to do so but I'm really curious why some people do so. Particularly, I'm wondering if it might have something to do with the name or if there are missing features in TW5?

If I understand your question you are looking for something like Tobias Beer's Linkify. That is a very, very cool plugin. Only for TW Classic so you're in luck. I wish it was available for TW5... but don't let this affect your answer to my question above, because you didn't know this, hehe.

<:-)

blackHole

unread,
Apr 26, 2017, 3:56:00 PM4/26/17
to TiddlyWiki

Hi !

 

( 1 )

I'm sorry for my carelessness. I will use [TWC] when appropriate.


( 2 )

I have seen SectionLinksPlugin and I find it extremely useful ! Its <<sectionTOC>> macro stands very close to what I'm looking for.


( 3 )

No doubt it's my fault, but I can't make appear an anchor like

<html><a name="sectionname" />Anchor</a></html>

in the table of contents generated by <<sectionTOC>>. Am I leaving out some syntax ?


( 4 )

Now, perhaps, I can rephrase my first question in a more comprehensible form. I would like to have the possibility to place a macro, let's say <<myMagicMacro>>, in the tiddler MyToc and get the linkified list of all

<html><a name="sectionname" />Anchor</a></html>

anchors, wherever appear in the whole document (it's to say in all Tiddlers).


( 5 )

I'm examining carefully Tobias Beer's Linkify. Great plugin also !


( 6 )

Regarding the choice of classic TiddlyWiki. I'm using it because I have been asked to do so; probably my teacher is simply not still aware of the existence of the newer version. I will inform him.


I thank you all for the replies !

Eric Shulman

unread,
Apr 26, 2017, 4:19:12 PM4/26/17
to TiddlyWiki
On Wednesday, April 26, 2017 at 12:56:00 PM UTC-7, blackHole wrote:

( 3 ) 

No doubt it's my fault, but I can't make appear an anchor like

<html><a name="sectionname" />Anchor</a></html>

in the table of contents generated by <<sectionTOC>>. Am I leaving out some syntax ?


You have an EXTRA "/" at the end of the <a> (after the quoted sectionname).

Change it to:
<html><a name="sectionname">Anchor</a></html>

Let me know how it goes...

enjoy,
-e


Mat

unread,
Apr 26, 2017, 4:19:28 PM4/26/17
to TiddlyWiki
blackHole wrote:
 

Regarding the choice of classic TiddlyWiki. I'm using it because I have been asked to do so; probably my teacher is simply not still aware of the existence of the newer version. I will inform him.


Interesting. In what context is it that you are asked to use TW? What educational-level? Is every student asked to use TW? What's the course and what task?
If you don't mind me asking :-)

<:-)

blackHole

unread,
Apr 27, 2017, 3:47:21 PM4/27/17
to TiddlyWiki
Hi !
( 1 )
The couple
[[Target##sectionname]]

<html><a name="sectionname">Anchor</a></html>
works fine. Still "Anchor" is absent in the menu generated by <<sectionTOC>>.
Tested in Firefox 43.0.1 and Opera 36.0
( 2 )
I'm very glad to answer Mat's question ! At the present moment, I'm not studying programming in an Academic environment. I'm member of an informal group of persons taking private lessons from a graduate student in IT. Tiddlywiki cames in when we got as homework the realization of individual course notes and
I asked for a way smarter than a static html page. Some are using Ms Word, some a CMS, some a pencil.
I choose Tiddlywiki option because: (1) an human readable file makes me feel more confidend than a murky one from a word processor, (2) learning to employ a CMS as well would result, in this situation, excessively demanding.

PJO

unread,
Apr 27, 2017, 4:40:41 PM4/27/17
to TiddlyWiki
Eric,

I just saw the reference to InsideTiddlyWiki and then found the unfunded project. Had I known I'd have contributed. What's the status of this? This is badly needed! Have you considered an epublication on Kindle?
Reply all
Reply to author
Forward
0 new messages