Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 3a5f5cf
Showing
15 changed files
with
1,553 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
%META:TOPICPARENT{name="AutoSubPlugin"}% | ||
---+!! Auto Sub Plugin Examples | ||
|
||
%TOC% | ||
|
||
---++ Tests | ||
|
||
* Set AUTOSUBPLUGIN_DEBUG = 1 | ||
|
||
Links that shouldn't be corrupted: | ||
* [[WebHome][no foo corruption]] | ||
* http://www.google.com/foo/bar | ||
* mailto:foo@bar.com | ||
|
||
---++ Formatting Macros | ||
Examples of how AutoSubPlugin might be used. First, a series of formatting macros that are not directly associated with the plugin. | ||
|
||
* Set ASPEXAPPFMT = <code><b>%DEFAULT%</b></code> | ||
* Set ASPEXDATAFMT = <i><b>%DEFAULT%</b></i> | ||
* Set ASPEXAPP = <code><b>[[Main.ASPEXApp%DEFAULT%][%DEFAULT%]]</b></code> | ||
* Set AUTOSUBPLUGIN_DEBUG = 0 | ||
|
||
---++ Plugin Macro Usage | ||
|
||
Note that in the following table, the rendered macros will be blanks. Only in the example usage of substitutions after the table should any obvious effects be present. | ||
|
||
| *You Type* | *You Get* | | ||
| <verbatim>%ASPEXAPPFMT{helloWorld}%</verbatim> <br/>(non-plugin example) | %ASPEXAPPFMT{helloWorld}% | | ||
| <verbatim>%AUTOSUB{"foo" repl="%ASPEXAPP{foo}%"}%</verbatim> | %AUTOSUB{"foo" repl="%ASPEXAPP{foo}%"}% | | ||
| <verbatim>%AUTOSUB{name="bar" repl="%ASPEXDATAFMT{bar}%"}%</verbatim> | %AUTOSUB{name="bar" repl="%ASPEXDATAFMT{bar}%"}% | | ||
| <verbatim>%AUTOSUB{"sampapp2" repl="%ASPEXAPP{sampapp2}%"}%</verbatim> | %AUTOSUB{"sampapp2" repl="%ASPEXAPP{sampapp2}%"}% | | ||
|
||
---++ Substitution Usage | ||
|
||
The following table is meant to show how text is automatically substituted, based on the macros used above. | ||
|
||
| *You Type* | *You Get* | | ||
| <verbatim>The application foo produces data type bar when it runs. So there.</verbatim> | The application foo produces data type bar when it runs. So there. | | ||
| <verbatim>But if this !foo is linked, there's a problem. Also if this <nop>bar is linked.</verbatim> | But if this !foo is linked, there's a problem. Also if this <nop>bar is linked. | | ||
| <verbatim><noautolink>None of this foo text should be bar linked.</noautolink></verbatim> | <noautolink>None of this foo text should be bar linked.</noautolink> | | ||
| <verbatim>sampapp2 should be linked but probably will not link to an existing topic.</verbatim> | sampapp2 should be linked but probably will not link to an existing topic. | | ||
|
||
---++ Substitution Table | ||
|
||
The following table is the list of substitutions known in this topic, as produced by <verbatim>%AUTOSUBS%</verbatim>. | ||
%AUTOSUBS% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
%META:TOPICINFO{author="ProjectContributor" date="1297286796" format="1.1" version="1"}% | ||
%META:TOPICPARENT{name="AutoSubPlugin"}% | ||
---+!! Testing !AutoSubPlugin | ||
|
||
SOME EXAMPLES OF THE PLUGIN | ||
|
||
__Related:__ %SYSTEMWEB%.AutoSubPlugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
%META:TOPICPARENT{name="Plugins"}% | ||
---+ Auto Sub Plugin | ||
<!-- | ||
One line description, required for extensions repository catalog. | ||
* Set SHORTDESCRIPTION = Plugin designed to substitute links (or any other formatting) for wiki-words and non-wiki-words alike. | ||
--> | ||
|
||
%SHORTDESCRIPTION% | ||
|
||
%TOC% | ||
|
||
---++ Macros | ||
|
||
Gives the ability to do substitution of text in a wiki document, which may include things like: | ||
1 Automatic formatting of keywords | ||
1 Automatic linking of keywords | ||
1 Translation of keywords | ||
|
||
%INCLUDE{VarAUTOSUB}% | ||
|
||
%INCLUDE{VarAUTOSUBS}% | ||
|
||
%INCLUDE{VarNOAUTOSUB}% | ||
|
||
---++ <nop>%TOPIC% Settings | ||
|
||
You can override the default settings as documented in [[%SYSTEMWEB%.PreferenceSettings][preferences]]. These preferences can be set in your %USERSWEB%.SitePreferences, or in !WebPreferences, or in individual topics. | ||
|
||
| *Preference* | *Use to* | *Default* | | ||
| =AUTOSUBPLUGIN_DEBUG= | Enable debugging output, which is stored in files in the plug-in's work area on the server and is not accessible via the web | 0 | | ||
| =AUTOSUBPLUGIN_PROTECTED= | Specify HTML or HTML-style tags to be protected from substitutions by this plug-in | "pre noautolink dot verbatim plantuml" | | ||
|
||
If the protected tags value is changed, it is *strongly* recommended that ==pre== and ==noautolink== remain in the list, at the beginning and in that order. | ||
|
||
---++ Examples | ||
Examples can be found in Sandbox.AutoSubPluginExamples. | ||
|
||
---++ Plugin Installation Instructions | ||
You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server. | ||
|
||
---+++ Installation | ||
Open configure, and open the "Extensions" section. Use "Find More Extensions" to get a list of available extensions. Select "Install". | ||
|
||
If you have any problems, or if the extension isn't available in =configure=, then you can still install manually from the command-line. See http://foswiki.org/Support/ManuallyInstallingExtensions for more help. | ||
|
||
---+++ Dependencies | ||
No dependencies. | ||
|
||
---++ Known Bugs | ||
None. | ||
|
||
---++ TODO | ||
|
||
---++ Plugin Info | ||
|
||
| Change History: | <!-- versions below in reverse order --> | | ||
| 13 Aug 2015 | 1.0.0 Initial release. | | ||
|
||
|
||
|
||
%META:FORM{name="PackageForm"}% | ||
%META:FIELD{name="Author" title="Author" value="Foswiki:Main.JohnKnutson"}% | ||
%META:FIELD{name="Version" title="Version" value="v1.0.0"}% | ||
%META:FIELD{name="Release" title="Release" value="1.0.0"}% | ||
%META:FIELD{name="Repository" title="Repository" value="https://github.com/foswiki/AutoSubPlugin"}% | ||
%META:FIELD{name="Copyright" title="Copyright" value="© 2015, Applied Research Laboratories, the University of Texas at Austin"}% | ||
%META:FIELD{name="License" title="License" value="[[%25ATTACHURLPATH%25/COPYING.txt][GPLv3]]"}% | ||
%META:FIELD{name="Home" title="Home" value="http://foswiki.org/Extensions/AutoSubPlugin"}% | ||
%META:FIELD{name="Support" title="Support" value="http://foswiki.org/Support/AutoSubPlugin"}% | ||
%META:FILEATTACHMENT{name="COPYING.txt" attachment="COPYING.txt" attr="" comment="GNU General Public License v3" date="1417819886" path="COPYING.txt" size="35147" user="ProjectContributor" version="1"}% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
%META:TOPICPARENT{name="AutoSubPlugin"}% | ||
#VarAUTOSUB | ||
---+++ AUTOSUB{...} -- define text substitutions for wiki pages | ||
* Parameters: | ||
| *Parameter* | *Description* | *Default* | | ||
| name | Text to auto-replace | none, required parameter | | ||
| fmtMacro | Replacement text. May be a wiki macro, however, the wiki macro being substituted may not encorporate other macros. If this is done, the wiki will complain to the administrator. | none - no substitution | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
%META:TOPICPARENT{name="AutoSubPlugin"}% | ||
#VarAUTOSUBS | ||
---+++ AUTOSUBS -- Generate a table of all known links/substitutions | ||
* Syntax: =%<nop>AUTOSUBS%= | ||
* =%<nop>AUTOSUBS%= generates a table in place containing all links/substitutions known to this plug-in, which are only those in the topic page in which this macro appears and any included topics. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
%META:TOPICPARENT{name="AutoSubPlugin"}% | ||
#VarNOAUTOSUB | ||
---+++ NOAUTOSUB{...} -- disable a text substitution for a wiki page | ||
* Parameters: | ||
| *Parameter* | *Description* | *Default* | | ||
| name | Text to auto-replace | none, required parameter | | ||
|
||
If a link/substitution has been defined for the text specified by the "name" parameter, this will prevent that text from being substituted in the page on which this macro is used. | ||
|
||
This may be useful if, for example, a list of AUTOSUB macros is used on a topic being included on a page where the including topic does not want the substitution to be made. | ||
|
Oops, something went wrong.