Just an idea of mine that makes me afraid I just
reimplemented the wheel:
I sometimes write texts that use a lot of words that look like
WikiNames but are not (like database table names). I didn't like
the idea of adding lots and lots of nop tags to the text, so
I added a small feature to my
DefaultPlugin that allows me to list
all the
WikiName-like words in one place.
The idea is to add a %NOPLIST:"SomeWord,SomeOtherWord"% variable
and some code that:
- adds a nop tag before any occurence of any word listed in NOPLIST,
- removes the NOPLISTS.
The code is:
# in commonTagsHandler
while ( $_[0] =~ s/%NOPLIST:"([^%\"]*?)"%// ) {
$_[0] =~ s/\b\Q$_\E\b/<nop>$_/g
foreach split ',', $1;
}
Was there an easier/elegant way of achieving this?
--
MarcinKaszynski - 06 Feb 2003
You can use
noautolink :
<noautolink>
NoneOf these WikiWords will BeLinks
</noautolink>
NoneOf these WikiWords will BeLinks
Documented in
TextFormattingRules, scan for the heading
Disable Links (second row from the bottom). Note: the
noautolink tags can't be used inline, but must be on a line by themself.
--
MattWilkie - 06 Feb 2003
I didn't know about this tag, must have missed it in TWiki
documentation. But it does not do what I had in mind.
The idea was to selectively turn off linking of
some words without having to do it explicitly in every
place they show up. My solution is much less intrusive
to the text and easier on eyes. To me, at least
--
MarcinKaszynski - 07 Feb 2003
As I understand it, your solution requires placing a NOPLIST on every topic that requires it. Would it not be better to have a central topic that lists
WikiWords that should not be converted throughout the site?
--
SamHasler - 07 Feb 2003
To disable linking, I've seen on some wiki syntax like this:
]]...[[ . Maybe nice/smart thing to will be to build list of un-linked words dynamically, as ]]...[[ words are encountered. Because chances are, if I do not want to link one instance of
WikiWord, do not want to link all others, too. Twiki is supposed
do the Right Thing, as unobtrusively as possible, right? And then get out of the way...
--
PeterMasiar - 07 Feb 2003
Sam: the idea of putting a NOPLIST in a separate topic is a nice one,
but having a single topic for the whole site might lead to a somewhat
chaotic global "dictionary". I believe (haven't tested it though) that
moving my code just below the lines that handle INCLUDEs would make it
possible to INCLUDE topics containing just NOPLISTs; whether they would
be global or project-local is a matter of choice of convention.
Peter: I think that marking words right in the text should be reserved
for special cases -- like disabling linking of
WikiWords that usually
would and should be auto-linked.
--
MarcinKaszynski - 10 Feb 2003