WikiWords in code
flag
Messages 1 - 10 of 16 - Collapse all
/groups/adfetch?adid=0MryZxEAAABLs0hmEJQzcpQtPEMjUXAhFSRgCP-avRN4YT0eROC0jw
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
1.  Henrik Jernevad  
View profile  
 More options Jun 2 2006, 10:27 pm
From: "Henrik Jernevad" <henrik.jerne...@gmail.com>
Date: Fri, 02 Jun 2006 19:27:11 -0700
Local: Fri, Jun 2 2006 10:27 pm
Subject: WikiWords in code
Is it possible to make TW *not* recognize a WikiWord in a {{{ code }}}
block? Adding ~ before the word obviously gets shown in the code
instead.

While a WikiWord in a code block doesn't get a link, it does get listed
in the Missing tab. This is a pain when you list a lot of source code
and don't want your Missing tab to be filled up with e.g. names in
CamelCase.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
2.  DaveG  
View profile  
 More options Jun 6 2006, 10:42 am
From: "DaveG" <da...@i.am>
Date: Tue, 06 Jun 2006 07:42:09 -0700
Local: Tues, Jun 6 2006 10:42 am
Subject: Re: WikiWords in code
hi,

there is a similar problem with [[ test ]] used by Korn shells for
testing in if ... then.
Missing tiddlers popup with horrible names.

Problem: I like being able to link from that place sometimes.

How about {{{{ to }}}} means no auto linking?
Or perhaps \\\ to \\\
dave


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
3.  Eric Shulman  
View profile  
 More options Jun 6 2006, 12:15 pm
From: "Eric Shulman" <elsdes...@gmail.com>
Date: Tue, 06 Jun 2006 09:15:02 -0700
Local: Tues, Jun 6 2006 12:15 pm
Subject: Re: WikiWords in code

> How about {{{{ to }}}} means no auto linking?
> Or perhaps \\\ to \\\

http://www.tiddlytools.com/#UnformattedTextPlugin
adds wiki-syntax to prevent wikify() processing of content by enclosing
it inside a pair of matching "superquotes" (THREE double-quotes in a
row)

Example:

"""These are unformatted: WikiLink, //italics//, <<macro>>, and so are
these...
----
*not a bullet
**not another bullet
"""

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
4.  Florian Cauvin  
View profile  
 More options Jun 6 2006, 12:04 pm
From: "Florian Cauvin" <florian.cau...@gmail.com>
Date: Tue, 06 Jun 2006 16:04:49 -0000
Local: Tues, Jun 6 2006 12:04 pm
Subject: Re: WikiWords in code
Yeah!!! That seems a good idea that wikiword in {{{ }}} would not be
added in the Missing Tab. That's sad that the MissingTab becomes
unusable when you install plugins.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
5.  Udo Borkowski  
View profile  
 More options Jun 15 2006, 6:57 pm
From: Udo Borkowski <Udo.Borkow...@gmx.de>
Date: Fri, 16 Jun 2006 00:57:52 +0200
Local: Thurs, Jun 15 2006 6:57 pm
Subject: Re: WikiWords in code
No solution but just some background information:

In the current implementation the Tiddler text is checked for WikiWords
and "pretty links" after every change (pressing "done" in the tiddler
menu), without looking for any context (e.g. if a word is in a code
block, or a comment etc). This makes it very fast to determine the
links, but also somehow inexact. A more precise solution would required
a more detailed analysis, taking care of the various formatters and
marcos and whether text they contain is wikified or not. This is even
complicated by the fact that new formatters may be added by plugins: it
would be fine if text controlled by these formatter would create the
correct "links".

This issue was already discussed some time ago but no nice solution was
yet found/implemented. I guess Jeremy will welcome any nice
suggestion/implementation.

Udo

----------
Udo Borkowski
http://www.abego-software.de


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
6.  Jeremy Ruston  
View profile  
 More options Jun 16 2006, 3:10 am
From: "Jeremy Ruston" <jeremy.rus...@gmail.com>
Date: Fri, 16 Jun 2006 08:10:15 +0100
Local: Fri, Jun 16 2006 3:10 am
Subject: Re: WikiWords in code
The idea that runs through my head with this is to introduce the idea
of wikifier "modes". There could be four:

normal - wikify text into an HTML DOM element as usual
html - wikify text into an HTML string (for use in RSS feeds and
statically rendered tiddlers)
plain - wikify text into a plain string (for use in site titles and subtitles)
link - wikify text but throw away the result apart from a list of the
links in the text

(You can imagine simplying it further, for instance by combining link+normal)

The trouble, of course, is that such a change would dribble down to
require every formatter and every macro to be changed, I think.

Cheers

Jeremy

On 15/06/06, Udo Borkowski <Udo.Borkow...@gmx.de> wrote:

--
Jeremy Ruston
mailto:jer...@osmosoft.com
http://www.tiddlywiki.com

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
7.  Udo Borkowski  
View profile  
 More options Jun 16 2006, 4:13 am
From: Udo Borkowski <Udo.Borkow...@gmx.de>
Date: Fri, 16 Jun 2006 10:13:04 +0200
Local: Fri, Jun 16 2006 4:13 am
Subject: Re: WikiWords in code

I had a slightly different idea that only requires some local changes.

Here the idea:

every formatter may have the optional property "linkifier" that refers
to a function like this:

    function(links) {
        ...
    }

This function should add all links to the array "links" that are
contained in the text controlled by the formatter. It is up to the
formatter to determine what is a link and what not. When no "linkifier"
is defined for a formatter the old approach as implemented in
Tiddler.prototype.changed is used.

According to this a formatter like the comment formatter could be
changed to this:

    {
        name: "commentByBlock",
        match: "/%",
    *    linkifier: function(links) {},*
        lookahead: "/%((?:.|\\n)*?)%/",
        ...

I.e. this formatter will add no links.

I assume that very few formatters will require this special linkifier
function, for most ones the standard approach is sufficient, i.e. the
formatter don't need to be changed. (Macros are handled very similar,
i.e. the Macro formatter just propagates the linkifier call to the
macro, or calls the old linkifier code.)

Beside this formatter specific change the Tiddler.prototype.changed must
be changed to use a modified version of the Wikifier. My initial idea
was just to pass the links array to the Wikifier:

    function Wikifier(source,formatter,highlightRegExp,tiddler,links)

If links is defined the wikifier adds the links, otherwise it behaves as
before (i.e. normal wikification). I haven't analysed the solution
completely but I assume that only the Wikifier.prototype.subWikify needs
to be changed.

Jeremy's idea of introducing "modes" is an extension of this idea with
the extra "links" parameter. So maybe we can just add a "mode" and a
"data" parameter to Wikifier to cover this more general case. Or just
one single new "options" parameter that will contain all future options
for the Wikifier (e.g. "options.mode" and "options.links" etc.)

Just a note regarding the {{{ }}} case: This is a little special. It may
not be obvious if the text inside the braces should be considered as
links or not. For the pure "{{{ ... }}}" links should probably ignored,
but for the general "customClasses" case the {{...{ ... }}} may be just
used to put a certain style on a "normal" text that contains links. Any
idea?

In case this change is going to happen I'd like to remind of the
"replace the link array by a hashmap" idea
(http://groups.google.com/group/TiddlyWikiDev/browse_frm/thread/f2809b...).
I suggest to do that change at the same  time (or before) to make sure
we don't need to change the API for the linkifier function from an
"links array" to an "links object" later. A later change may lead to
difficulties if some plugin writer has already written his own
"linkifier" function for some external formatter/macro.

Udo


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
8.  Martin Budden  
View profile  
 More options Jun 18 2006, 3:26 pm
From: "Martin Budden" <mjbud...@gmail.com>
Date: Sun, 18 Jun 2006 19:26:14 -0000
Local: Sun, Jun 18 2006 3:26 pm
Subject: Re: WikiWords in code
Isn't this overkill? Here's my analysis:

Using plugins can cause your Missing tiddlers tag to fill up spurious
undefined tiddlers. This is because the Javascript used in plug-ins
often uses CamelCase for variable and functionnames etc. This is
clearly undesirable.

Solution: don't autolink wikiwords in tiddlers marked "systemConfig".
Simple and efficient to implement. Downside is that plug-in writers
need to use the [[ ]] format for their links. I think this is a
reasonable trade-off.

(Note also that it's not obligatory to put plug-ins in code blocks, so
there will be plug-ins that are not sorted by the formatter approach.
It is, of course, obligatory to tag plug-ins as "systemConfig".)

Martin


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
9.  Eric Shulman  
View profile  
 More options Jun 18 2006, 6:58 pm
From: "Eric Shulman" <elsdes...@gmail.com>
Date: Sun, 18 Jun 2006 15:58:27 -0700
Local: Sun, Jun 18 2006 6:58 pm
Subject: Re: WikiWords in code

> Solution: don't autolink wikiwords in tiddlers marked "systemConfig".
> Simple and efficient to implement. Downside is that plug-in writers
> need to use the [[ ]] format for their links. I think this is a
> reasonable trade-off.

Tiddlers tagged with 'systemConfig' are already excluded from being
included in the list of missing links (as are tiddlers tagged with
'excludeMissing')... this let's you still use use WikiWord autolinking
in plugins while avoiding listing the variable names, etc. as missing
links.

This is straight out of the TW core code:
-------------------------------------
// Return array of names of tiddlers that are referred to but not
defined
TiddlyWiki.prototype.getMissingLinks = function(sortField)
{
        var results = [];
        this.forEachTiddler(function (title,tiddler) {
                if(tiddler.tags.find("systemConfig") == null &&
tiddler.tags.find("excludeMissing") == null)
                        for(var n=0; n<tiddler.links.length;n++)
                                {
                                var link = tiddler.links[n];
                                if(this.fetchTiddler(link) == null && !this.isShadowTiddler(link))
                                        results.pushUnique(link);
                                }
                });
        results.sort();
        return results;

}

-e

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
10.  Martin Budden  
View profile  
 More options Jun 19 2006, 4:07 pm
From: "Martin Budden" <mjbud...@gmail.com>
Date: Mon, 19 Jun 2006 13:07:39 -0700
Local: Mon, Jun 19 2006 4:07 pm
Subject: Re: WikiWords in code
Thanks for pointing this out Eric. I had assumed that Tiddlers with
code mentioned by Henrik were plugins, but I guess I was incorrect in
this assumption.

Martin


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google