Tags:
create new tag
, view all tags

Question

How can I implore my TWiki site to use the "publish" script (PublishContrib) to automatically publish a topic to static HTML when someone edits and saves a topic?

More details in this thread: AddPublishButtonToTWikiButtons

Environment

TWiki version: TWikiRelease04x00x05
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: RHEL4
Web server: apache2
Perl version: 5.8.5
Client OS: RHEL4
Web Browser: Firefox
Categories: Plugins

-- JohnDeStefano - 04 Dec 2006

Answer

ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.

PublishWebPlugin can do this for you. I am not sure if it can do this by default, as I was doing some modifications to the script, but I do remember that it would create a html page on save.

I removed everything inside of the...
use vars qw();

-- SteveStark - 04 Dec 2006

Thanks Steve. Yes, but if I understand correctly, at the moment, PublishWebPlugin has a few restrictions that I can't work with, like converting topic names to all-lowercase URLs and working on only a single web. I'm publishing multiple webs within a single TWiki site, and I need to maintain the casing of the TWiki topics in order to map between TWiki pages and their corresponding HTML versions.

-- JohnDeStefano - 04 Dec 2006

Someone had changed the status of this question to "AnsweredQuestions," but I don't think an answer was given. Can someone please help? Thanks.

-- JohnDeStefano - 05 Dec 2006

John, there's no way to do this in the PublishContrib at the moment, it would need to be extended. However I'm not sure what you are trying to do. It sounds suspiciously like you might by trying to use the PublishContrib as a rendering cache, which is really not what it is intended for. Can you describe your use case a bit more?

-- CrawfordCurrie - 14 Dec 2006

Sure: I have a TWiki site that needs to be secured via local authentication, but its users want a "transparent" mirror of the TWiki content on an unauthenticated site for public consumption. I'm using a cron job to publish the TWiki site, and all its webs, to the unauthenticated site twice daily. In theory, this is fine. However, the users are complaining that their TWiki edits aren't showing up on the other side immediately (which is true, by design but true).

So, in a nutshell: users would like publish to be run on the topic they're editing immediately upon save.

-- JohnDeStefano - 14 Dec 2006

Is running publish on save equivalent to using publish as a rendering cache?

-- JohnDeStefano - 22 Jan 2007

John, with a small bit of modification, the PublishWebPlugin should be able to do what you want. (In fact, I may be implementing these changes for my own wiki.) By default, the plugin copies data to the cache dir on each save. To work across multiple webs and mirror the TWiki ordering, the changes to make are:

  • hard-code a cache directory path for each web, and then switch based on the web name.
  • remove the 'make-lower-case' lc commands
  • make a separate sub-directory for each topic to store attachments.

That should be enough. These changes may eventually make it into the published plugin, if time allows and they are approved by the original author.

-- ScottHoge - 23 Jan 2007

Closing after more than 30 days. Please reopen with more details if needed...

-- PeterThoeny - 02 Mar 2007

Change status to:
Edit | Attach | Watch | Print version | History: r11 < r10 < r9 < r8 < r7 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r11 - 2007-03-02 - 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-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.