Skip to content

Commit

Permalink
Item1174: Rename GenPDFPlugin to GenPDFAddOnPlugin - so it doesn't co…
Browse files Browse the repository at this point in the history
…nflict with any future GenPDFPlugin.

The Plugin is a small helper plugin shipped with GenPDFAddOn.   Also add the VarGENPDF and GenPDFAddOnPlugin topics



git-svn-id: http://svn.foswiki.org/trunk/GenPDFAddOn@6473 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
GeorgeClark authored and GeorgeClark committed Feb 22, 2010
1 parent 2838be2 commit 020869c
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 25 deletions.
14 changes: 1 addition & 13 deletions data/System/GenPDFAddOn.txt
Expand Up @@ -35,19 +35,7 @@ There are multiple ways to incorporate PDF rendering of your Foswiki topics or t

---+++ !GenPDFPlugin helper plugin

This version of the !AddOn also ships with a simple !GenPDFPlugin helper plugin. It will render the %<nop>GENPDF% macro as a clickable link to the pdf version of the topic.

*Write* %<nop>GENPDF%
* *Simulated:* %SCRIPTURL{"genpdf"}%/System/GenPDFAddOn
* *If Installed:* %GENPDF%

*Write* %<nop>GENPDF{"System.WebHome"}%
* *Simulated:* %SCRIPTURL{"genpdf"}%/System/WebHome
* *If Installed:* %GENPDF{"System.WebHome"}%

*Write* %<nop>GENPDF{"System.WebHome" link="WebHome"}%
* *Simulated*: [[%SCRIPTURL{"genpdf"}%/System/WebHome][WebHome]]
* *If Installed*: %GENPDF{"System.WebHome" link="WebHome"}%
%INCLUDE{"GenPDFAddOnPlugin"}%

---++ Configuring the Script

Expand Down
50 changes: 50 additions & 0 deletions data/System/GenPDFAddOnPlugin.txt
@@ -0,0 +1,50 @@
%META:TOPICINFO{author="ProjectContributor" date="1265477638" format="1.1" version="1.2"}%
%META:TOPICPARENT{name="Plugins"}%
---+ GenPDFAddOn Helper plugin

%SHORTDESCRIPTION%

%STARTINCLUDE%
This version of the GenPDFAddOn ships with a simple GenPDFAddOnPlugin helper
plugin. It will render the %<nop>GENPDF% macro as a clickable link to the PDF version of the topic.
%IF{ "'%BASETOPIC%' = 'GenPDFAddOnPlugin'" then="See GenPDFAddOn for details on generating a PDF from a topic or topic hierarchy"}%

*Write* %<nop>GENPDF%
* *Simulated:* %SCRIPTURL{"genpdf"}%/System/GenPDFAddOn
* *If Installed:* %GENPDF%

*Write* %<nop>GENPDF{"System.WebHome"}%
* *Simulated:* %SCRIPTURL{"genpdf"}%/System/WebHome
* *If Installed:* %GENPDF{"System.WebHome"}%

*Write* %<nop>GENPDF{"System.WebHome" link="WebHome"}%
* *Simulated*: [[%SCRIPTURL{"genpdf"}%/System/WebHome][WebHome]]
* *If Installed*: %GENPDF{"System.WebHome" link="WebHome"}%
%STOPINCLUDE%

---++ Plugin Preferences

There are no settings or preferences for this plugin.

<!--
One line description, required for extensions repository catalog.
* Set SHORTDESCRIPTION = %$SHORTDESCRIPTION%
-->

---++ Installation

This plugin is installed as part of GenPDFAddOn. Enable the GenPDFAddOnPlugin
in the =bin/configure= interface

---++ Plugin Info

| Author: | Foswiki:Main.GeorgeClark |
| Copyright: | &copy; 2009, Foswiki Contributors |
| License: | GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]]) |
| Release: | %$RELEASE% |
| Version: | %$VERSION% |
| Change&nbsp;History: | <!-- versions below in reverse order -->&nbsp; |
| 21 Feb 2010 (1.0) | Initial release. See GenPDFAddOn for further details |
| Home: | http://foswiki.org/Extensions/GenPDFAddOn |
| Support: | http://foswiki.org/Support/GenPDFAddOn |

8 changes: 8 additions & 0 deletions data/System/VarGENPDF.txt
@@ -0,0 +1,8 @@
%META:TOPICINFO{author="ProjectContributor" date="1231502400" format="1.1" version="1"}%
%META:TOPICPARENT{name="Macros"}%
#VarGENPDF
---+++ GENPDF -- Insert a link that generated a PDF for the current or identified topic
* Syntax: =%<nop>GENPDF%=
* Expands to: =%GENPDF%=
* Example: To link to an alternate topic, write %<nop>GENPDF{"AnotherTopic"}% or write %<nop>GENPDF{"AnotherTopic" link="pdf version"}% to override the link text.
* Related: Installed as part of GenPDFAddOn
4 changes: 3 additions & 1 deletion lib/Foswiki/Contrib/GenPDFAddOn/MANIFEST
@@ -1,5 +1,7 @@
bin/genpdf 0755
data/System/GenPDFAddOn.txt 644 Add-on topic
data/System/GenPDFAddOnPlugin.txt 644 Helper plugin topic
data/System/VarGENPDF.txt 644 Defines GENPDF macro
data/Sandbox/GenPDFAddOnDemo.txt 0644 Demonstration topic
data/Sandbox/GenPDFAddOnDemoChild.txt 0644 Demo child for recursive rendering
data/Sandbox/GenPDFAddOnDemoChild2.txt 0644 Demo child for recursive rendering
Expand All @@ -14,5 +16,5 @@ htmldoc_force_header.patch 0644
lib/Foswiki/Contrib/GenPDF.pm 0644 Shim module to avoid breaking old installations
lib/Foswiki/Contrib/GenPDFAddOn.pm 0644 Renamed GenPDF.pm to packaging standards
lib/Foswiki/Contrib/GenPDFAddOn/Config.spec 0755
lib/Foswiki/Plugins/GenPDFPlugin.pm 0644
lib/Foswiki/Plugins/GenPDFAddOnPlugin.pm 0644
templates/view.genpdf.tmpl 0644
Expand Up @@ -2,7 +2,7 @@

=begin TML
---+ package GenPDFPlugin
---+ package GenPDFAddOnPlugin
Foswiki plugins 'listen' to events happening in the core by registering an
interest in those events. They do this by declaring 'plugin handlers'. These
Expand Down Expand Up @@ -47,7 +47,7 @@ the text had been included from another topic.
=cut

# change the package name!!!
package Foswiki::Plugins::GenPDFPlugin;
package Foswiki::Plugins::GenPDFAddOnPlugin;

# Always use strict to enforce variable scoping
use strict;
Expand All @@ -70,7 +70,7 @@ our $RELEASE = '1.1-rc2';
# Short description of this plugin
# One line description, is shown in the %SYSTEMWEB%.TextFormattingRules topic:
our $SHORTDESCRIPTION =
'<nop>GenPDFPlugin helper plugin for GenPDFAddOn renders the %<nop>GENPDF% tag';
'<nop>GenPDFAddOnPlugin helper plugin for GenPDFAddOn renders the %<nop>GENPDF% tag';

# You must set $NO_PREFS_IN_TOPIC to 0 if you want your plugin to use
# preferences set in the plugin topic. This is required for compatibility
Expand Down Expand Up @@ -123,14 +123,14 @@ sub initPlugin {

# Set your per-installation plugin configuration in LocalSite.cfg,
# like this:
# $Foswiki::cfg{Plugins}{GenPDFPlugin}{ExampleSetting} = 1;
# $Foswiki::cfg{Plugins}{GenPDFAddOnPlugin}{ExampleSetting} = 1;
# Optional: See %SYSTEMWEB%.DevelopingPlugins#ConfigSpec for information
# on integrating your plugin configuration with =configure=.

# Always provide a default in case the setting is not defined in
# LocalSite.cfg. See %SYSTEMWEB%.Plugins for help in adding your plugin
# configuration to the =configure= interface.
# my $setting = $Foswiki::cfg{Plugins}{GenPDFPlugin}{ExampleSetting} || 0;
# Always provide a default in case the setting is not defined in
# LocalSite.cfg. See %SYSTEMWEB%.Plugins for help in adding your plugin
# configuration to the =configure= interface.
# my $setting = $Foswiki::cfg{Plugins}{GenPDFAddOnPlugin}{ExampleSetting} || 0;

# Register the _EXAMPLETAG function to handle %EXAMPLETAG{...}%
# This will be called whenever %EXAMPLETAG% or %EXAMPLETAG{...}% is
Expand Down Expand Up @@ -191,11 +191,11 @@ sub _GENPDF {

1;
__END__
This copyright information applies to the GenPDFPlugin:
This copyright information applies to the GenPDFAddOnPlugin:
# Plugin for Foswiki - The Free and Open Source Wiki, http://foswiki.org/
#
# GenPDFPlugin is Copyright (C) 2008 Foswiki Contributors. Foswiki Contributors
# GenPDFAddOnPlugin is Copyright (C) 2008 Foswiki Contributors. Foswiki Contributors
# are listed in the AUTHORS file in the root of this distribution.
# NOTE: Please extend that file, not this notice.
# Additional copyrights apply to some or all of the code as follows:
Expand All @@ -204,7 +204,7 @@ This copyright information applies to the GenPDFPlugin:
# and TWiki Contributors. All Rights Reserved. Foswiki Contributors
# are listed in the AUTHORS file in the root of this distribution.
#
# This license applies to GenPDFPlugin *and also to any derivatives*
# This license applies to GenPDFAddOnPlugin *and also to any derivatives*
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
Expand Down

0 comments on commit 020869c

Please sign in to comment.