Tags:
create new tag
view all tags

Question

I'd like to turn off all linking of wiki words for a printable skin I made, or at least turn off linking of our product name without having to type nop every time. The idea is to export individual html pages as portable documentation, say, to email to clients or for posting on a public web site.

I'm pretty sure that it can't be done from my template, but I was wondering whether there's an easier way to get the same result without hacking the view script.

  • TWiki version: Dec2001
  • Web server: IIS5
  • Server OS: W2K
  • Web browser: IE5.5
  • Client OS: W2KPro

-- MaryDeMarco - 11 Apr 2002

Answer

You could create a plugin or add a line to the existing DefaultPlugin, sub startRenderingHandler to filter your product name, e.g.

    $_[0] =~ s/(MyProductA|MyProductB)/<nop>$1/gos;

This could be done conditionally, e.g. only if a certain template variable is defined by a skin:

    if( TWiki::Func::expandCommonVariables( '%TMPL:P{"disableWikiLinks"}%' ) ) {
        $_[0] =~ s/(MyProductA|MyProductB)/<nop>$1/gos;
    }

The MySkin could define this in twiki.myskin.tmpl:

%TMPL:DEF{"disableWikiLinks"}% yes %TMPL:END%

-- PeterThoeny - 12 Apr 2002

If you want to send 1 page in email without hyperlinks, removing hyperlinks is maybe fine. But if you want to post page to public web site, IMHO you are much better off keeping the links. Just create another TWiki, with mirrored webs, copy pages there, and you are all set. You can set default skin in mirrored web differently - use plain skin, or customize it with your logo. You have different authorisation there, too.

And even for emails, I as customer might prefer link to exact page, hyperlinked to other pages. Only in case users are without internet access, plain page is better than hyperlinked.

I did not asked this question, but now I am intrigued. smile PeterThoeny's proposed code changes to make certain WikiWords be rendered without link. But what I want all WikiWords in the page without link? What will be the correct regex?

-- PeterMasiar - 12 Apr 2002

The easiest way to turn off all linking is to have a skin that does <noautolink> at the top of page, and </noautolink> at the bottom.

-- RichardDonkin - 12 Apr 2002

noautolink tags worked in an individual page, but not in the template I was using.

-- MaryDeMarco - 14 Apr 2002

As I have the same requirement and can't find any way to do this I'm reopening the question....

To explain the motivation a bit more: We're using TWiki on the intranet to manage a lot of internal project documents but from time to time we need to communicate a certain document to the clients. The client should not have access to anything other than the document so the "mirror-public-twiki" does not make sense.

The normal way of doing this is to use the print skin and send the HTML file. Thus the customer ends up with a document with a lot of useless links.

One approach that kind of work is to produce a pdf file from the HTML using html2ps and ps2pdf. The links are still underlined but at least they do not work (given some options to html2ps)

Using <noautolink> at the top of page, and </noautolink> at the bottom in a skin would be great, but it does not work as the %TEXT% obviously returns everything linked already.

Any other ideas of things to try?

-- OleCMeldahl - 23 Feb 2005

PublishAddOn

-- CrawfordCurrie - 01 Mar 2005

PublishAddOn has it uses (and we are using it alot,... thanks for fixing it for Cairo) but it will still generate links to topics that are not part of the exported output AFAIK and is more tailored for transporting a whole web around? Is it possible to start the publish with all settings set up for one topic and a setting ithat defines that no links should be created in the output?

-- OleCMeldahl - 11 Mar 2005

TWiki has now a StopWikiWordLinkPlugin where you can prevent links for a set of WikiWords.

-- PeterThoeny - 09 Aug 2006

Edit | Attach | Watch | Print version | History: r12 < r11 < r10 < r9 < r8 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r12 - 2006-08-09 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.