SID-01886: Include Short description from each Plugin page
| Status: |
Answered |
TWiki version: |
6.0.0 |
Perl version: |
|
| Category: |
CategoryApplications |
Server OS: |
|
Last update: |
10 years ago |
I am writing a variant on the =%PLUGINDESCRIPTIONS%; variable results. (I don't want the rev. number, I want the results in a table, and I want to add addition information to the table).
Currently, I have this, and it's 90%; working:
%FOREACH{"Plugin" in="%ACTIVATEDPLUGINS%"}%
| $percntCALCULATE{$FILTER(TWiki., $Plugin)}$percnt | [[$Plugin][documentation]] | $percntINCLUDE{"$Plugin" pattern="^.*?\* Set SHORTDESCRIPTION = ([^\r\n].*?[^\r\n]*).*"}$percnt |
%NEXT{"Plugin"}%
What's not working: It's not getting the SHORTDESCRIPTION for FilterPlugin, GitPlugin, or SlideShowPlugin.
FilterPlugin and SlideShowPlugin do contain the desired line:
FilterPlugin.txt: * Set SHORTDESCRIPTION = Substitute and extract information from content by using regular expressions
SlideShowPlugin.txt: * Set SHORTDESCRIPTION = Create web based presentations based on topics with headings.
(GitPlugin does not, so a null return value is expected.)
--
Vicki Brown - 2014-03-10
Discussion and Answer
I am not familiar with the FOREACH. Also the multiple INCLUDE is likely slow. Here is a single SEARCH that does what you want:
%SEARCH{
"Plugin"
scope="topic"
web="%SYSTEMWEB%"
topic="%CALCULATE{$LISTEACH($FILTER(%SYSTEMWEB%., $item), %ACTIVATEDPLUGINS%)}%"
nonoise="on"
format="| $web.$topic | $pattern(.*?Set *SHORTDESCRIPTION *= *([^\n\r]*).*) |"
}%
Result:
| AutoSectionsPlugin |
Automatically make editable sections based on headings |
| BackupRestorePlugin |
Administrator utility to backup, restore and upgrade a TWiki site |
| BlackListPlugin |
Utility to keep malicious users away from a public TWiki site |
| CalendarPlugin |
Show a monthly calendar with highlighted events |
| ChartPlugin |
Visualize TWiki tables with area charts, bar charts, line graphs, scatter charts and sparklines |
| ColorPickerPlugin |
Color picker for use in TWiki forms and TWiki applications |
| CommentPlugin |
Quickly post comments to a page without an edit/preview/save cycle. |
| DatePickerPlugin |
Pop-up calendar with date picker, for use in TWiki forms, HTML forms and TWiki plugins |
| EditTablePlugin |
Edit TWiki tables using edit fields, date pickers and drop down boxes |
| GaugePlugin |
Create gauges (graphical or not), typically used for dashboards |
| GeoLookupPlugin |
Lookup geolocation by IP address or domain name |
| HeadlinesPlugin |
Show headline news in TWiki pages based on RSS and ATOM news feeds from external sites |
| IfThenActionPlugin |
Execute if-then actions on topic view, save, file upload, and user registration, with rules defined in a topic |
| InterwikiPlugin |
Write ExternalSite:Page to link to a page on an external site based on aliases defined in a rules topic |
| JQueryPlugin |
jQuery JavaScript library for TWiki |
| LocalCityTimePlugin |
Shows the local time of a city embedded in a TWiki topic |
| PercentCompletePlugin |
Percent complete selector, for use in TWiki forms and TWiki applications |
| PerlDocPlugin |
Extract the Perl documentation (POD) from a Perl module and display it in a topic |
| PreferencesPlugin |
Allows editing of preferences using fields predefined in a form |
| QRCodePlugin |
Create QR Code (a matrix barcode) in TWiki pages, useful for mobile applications |
| RecentVisitorPlugin |
Show statistics of recent visitors to the TWiki site |
| RenderListPlugin |
Render bullet lists in a variety of formats |
| SetGetPlugin |
Set and get variables and JSON objects in topics, optionally persistently across topic views |
| ShareMePlugin |
Icon bar to share TWiki pages on popular social media sites such as Facebook, StumbleUpon, Twitter |
| SlideShowPlugin |
Create web based presentations based on topics with headings. |
| SmiliesPlugin |
Render smilies as icons, like :-) as or :eek: as |
| SpreadSheetPlugin |
Add spreadsheet calculation like "$SUM( $ABOVE() )" to TWiki tables or anywhere in topic text |
| SyntaxHighlightingPlugin |
Highlight source code fragments for many languages |
| TWikiDrawPlugin |
Vector drawing editor and clickable maps for diagrams and workflows |
| TWikiOrgPlugin |
TWiki.org specific extensions |
| TWikiSheetPlugin |
Add TWiki Sheet spreadsheet functionality to TWiki tables |
| TablePlugin |
Control attributes of tables and sorting of table columns |
| TagMePlugin |
Tag wiki content collectively or authoritatively to find content by keywords |
| TinyMCEPlugin |
Integration of the TinyMCE WYSIWYG Editor |
| TwistyPlugin |
Twisty section JavaScript library to open/close content dynamically |
| VarCachePlugin |
Cache TWiki variables in selected topics for faster page rendering |
| WatchlistPlugin |
Watch topics of interest and get notified of changes by e-mail |
| WysiwygPlugin |
Translator framework for WYSIWYG editors |
--
Peter Thoeny - 2014-03-10
OK. I like the simplicity of the SEARCH, but I still don't understand why the INCLUDE pattern fails for two plugin pages.
I've cut the code way down to remove distractions. ALl that's left is the INCLUDE:
Code
TwistyPlugin
* %INCLUDE{"%SYSTEMWEB%.TwistyPlugin" pattern="^.*?Set *SHORTDESCRIPTION *= *(.*?)[\r\n].*" }%
TablePlugin
* %INCLUDE{"%SYSTEMWEB%.TablePlugin" pattern="^.*?Set *SHORTDESCRIPTION *= *(.*?)[\r\n].*" }%
FilterPlugin
* %INCLUDE{"Plugins.FilterPlugin" pattern="^.*?Set *SHORTDESCRIPTION *= *(.*?)[\r\n].*" }%
SlideShowPlugin
* %INCLUDE{"%SYSTEMWEB%.SlideShowPlugin" pattern="^.*?Set *SHORTDESCRIPTION *= *(.*?)[\r\n].*" }%
Results
TwistyPlugin
- Twisty section JavaScript library to open/close content dynamically
TablePlugin
- Control attributes of tables and sorting of table columns
FilterPlugin
SlideShowPlugin
I'm even more confused because the pattern code in SEARCH is working (for Slide Show) but the pattern code in INCLUDE is not.
--
Vicki Brown - 2014-03-18
Closing this question after more than 30 days of inactivity. Feel free to reopen if needed. Consider engaging one of the
TWiki consultants if you need timely help. We invite you to
get involved with the community, it is more likely you get community support if you support the open source project!
--
Peter Thoeny - 2015-12-03
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.