DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:autotooltip

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:autotooltip [2018-12-25 22:59] ziothplugin:autotooltip [2024-02-11 03:39] (current) zioth
Line 5: Line 5:
 author     : Eli Fenton author     : Eli Fenton
 email      : elifenton@this_is_not_a_real_email.fake email      : elifenton@this_is_not_a_real_email.fake
-type       : syntax, helper, renderer +type       : syntax, helper, action, renderer 
-lastupdate : 2018-12-25 +lastupdate : 2024-02-10 
-compatible : greebo+compatible : Greebo, Hogfather, Igor, Jack Jackrum, Kaos
 depends    :  depends    : 
 conflicts  conflicts 
Line 13: Line 13:
 tags       : tooltip, abstract tags       : tooltip, abstract
  
-downloadurl: http://github.com/zioth/dokuwiki-autotooltip/zipball/master +downloadurl: https://github.com/zioth/dokuwiki-autotooltip/zipball/master 
-bugtracker : http://github.com/zioth/dokuwiki-autotooltip/issues +bugtracker : https://github.com/zioth/dokuwiki-autotooltip/issues 
-sourcerepo : http://github.com/zioth/dokuwiki-autotooltip/+sourcerepo : https://github.com/zioth/dokuwiki-autotooltip
 donationurl:  donationurl: 
  
Line 21: Line 21:
 ---- ----
  
-This syntax/helper plugin allows you to construct tooltips for text on the page, or to automatically generate tooltips based on a wikilink's title and abstract. If you enable the renderer plugin, it can even add a tooltip to every internal wikilink on your site!+This plugin allows you to construct tooltips for text and links on the page, or to automatically generate tooltips based on a wikilink's title and abstract. If you enable the renderer plugin or install [[plugin:actionrenderer|ActionRenderer]], it can even add a tooltip to every internal wikilink on your site!
  
  
Line 27: Line 27:
  
 Install the plugin using the [[plugin:plugin|Plugin Manager]] and the download URL above, which points to latest version of the plugin. Refer to [[:Plugins]] on how to install plugins manually. Install the plugin using the [[plugin:plugin|Plugin Manager]] and the download URL above, which points to latest version of the plugin. Refer to [[:Plugins]] on how to install plugins manually.
 +
 +
 +==== Automatically turning plain text into links with tooltips ====
 +
 +Install both this plugin and [[plugin:autolink4|Autolink 4]]. The configuration options for Autolink 4 allow you to specify text or regular expressions, and automatically turn those into links with tooltips.
 +
 +
 +==== Adding tooltips to every link on your site, or specific namespaces ====
 +
 +If you're already using [[plugin:actionrenderer|ActionRenderer]] as your renderer, this will happen automatically. Otherwise, Go to //Admin// -> //Configuration// -> //Advanced// -> //renderer_xhtml//, and select "Auto-Tooltip." Note that you can only have one custom renderer, so this is not compatible with other renderer plugins.
 +
 +You can limit this to specific namespaces or pages using the configuration options.
 +
 +You won't see tooltips on self-referential links. In other words, a link to //wiki:whatever// on //wiki:whatever// will not have a tooltip.
 +
  
 ===== Examples/Usage ===== ===== Examples/Usage =====
  
-[[http://zioth.com/dev/dokuwiki/autotooltip|See these examples live.]]+[[http://zioth.com/dev/dokuwiki/autotooltip|See these examples live]]
 + 
 +=== Generating tooltip content automatically === 
 + 
 +  <autott>wiki:syntax</autott> 
 + 
 +This will generate a link to wiki:syntax, using the page's title as the link text. The tooltip will include the page's title and abstract. 
 + 
 +  <autott>wiki:syntax|Custom Title</autott> 
 + 
 +Same as above, but the link text will be "Custom Title."
  
 === Manual tooltips === === Manual tooltips ===
Line 41: Line 66:
 This creates a simple tooltip for text on the page. This creates a simple tooltip for text on the page.
  
-=== Customizing a tooltip ===+=== Customizing appearance ===
   <autott style1 style2>...</autott>   <autott style1 style2>...</autott>
  
Line 60: Line 85:
  
   <autott picture>...</autott>   <autott picture>...</autott>
- 
- 
- 
-=== Generating a tooltip === 
- 
-  <autott>wiki:syntax</autott> 
- 
-This will generate a link to wiki:syntax, using the page's title as the link text. The tooltip will include the page's title and abstract. 
- 
-  <autott>wiki:syntax|Custom Title</autott> 
- 
-Same as above, but the link text will be "Custom Title." 
- 
- 
-===== Adding tooltips to every link ===== 
- 
-Using the syntax above, you can add tooltips to any wikilink, but what if you want a tooltip on //every// wikilink? 
- 
-To enable this feature, go to //Admin// -> //Configuration// -> //Advanced// -> //renderer_xhtml//, and select "Auto-Tooltip." Unfortunately, DokuWiki only allows you to use one renderer plugin at a time, so this won't work with any other renderer plugin. If you can't use this renderer plugin, consider [[plugin:autolink4|Auto-link 4]], which can add tooltips to links that it generates. 
- 
-You won't see tooltips on self-referential links. In other words, a link to //wiki:whatever// on //wiki:whatever// will not have a tooltip. 
  
  
 ===== Configuration ===== ===== Configuration =====
  
-  * style: A space-delimited set of default classes. This can include the built-in styles, or any CSS class you create that starts with "plugin-autotooltip__."+  * style: A space-delimited set of default classes. This can include the built-in styles, or any CSS class you create that starts with %%"plugin-autotooltip__."%%
   * delay: The time in miliseconds to wait before showing a tooltip.   * delay: The time in miliseconds to wait before showing a tooltip.
-  * linkall_exclusions: When using the renderer plugin to add tooltips to all links, this is a regular expression for pages or namespaces to exclude. For example, /^wiki:|^stuff:/ excludes from the wiki and stuff namespaces. This works well with [[plugin:include|Include]] and similar plugins, allowing you to, for example, exclude tooltips on all sidebars, but keep them on the page.+  * linkall_inclusions: When using the renderer plugin to add tooltips to all links, this is a regular expression for pages or namespaces to include. For example, "^wiki:|^stuff:" inludes only links from the wiki and stuff namespaces. Leave blank to include all pages. 
 +  * linkall_exclusions: A regular expression for pages or namespaces to exclude. When combined with linkall_inclusions, this means "Include these pages, except those pages." This works well with [[plugin:include|Include]] and similar plugins, allowing you to, for example, exclude tooltips on all sidebars, but keep them on the page.
  
  
Line 95: Line 100:
  
 === forText === === forText ===
-Create a manual tooltip.+Create a manual tooltip on arbitrary text.
   $tooltip->forText($content, $tooltip, $title='', $preTitle='', $classes='', $textStyle='');   $tooltip->forText($content, $tooltip, $title='', $preTitle='', $classes='', $textStyle='');
  
Line 102: Line 107:
   * $title: The title inside the tooltip.   * $title: The title inside the tooltip.
   * $preTitle: Text to display before the title. Newlines will be rendered as line breaks.   * $preTitle: Text to display before the title. Newlines will be rendered as line breaks.
-  * $classes: CSS classes to add to this tooltip. "dokuwiki-plugin__" will be prepended to each class.+  * $classes: CSS classes to add to this tooltip. %%"dokuwiki-plugin__"%% will be prepended to each class.
   * $textStyle - CSS styles for the linked content.   * $textStyle - CSS styles for the linked content.
  
 === forWikilink === === forWikilink ===
-Create a wikilink.+Create a wikilink with a tooltip.
   $tooltip->forWikilink($id, $content=null, $classes='', $linkStyle='');   $tooltip->forWikilink($id, $content=null, $classes='', $linkStyle='');
  
Line 112: Line 117:
   * $content - The on-page content. Newlines will be rendered as line breaks. Omit to use the page's title.   * $content - The on-page content. Newlines will be rendered as line breaks. Omit to use the page's title.
   * $preTitle - Text to display before the title in the tooltip. Newlines will be rendered as line breaks.   * $preTitle - Text to display before the title in the tooltip. Newlines will be rendered as line breaks.
-  * $classes - CSS classes to add to this tooltip. "dokuwiki-plugin__" will be prepended to each class.+  * $classes - CSS classes to add to this tooltip. %%"dokuwiki-plugin__"%% will be prepended to each class.
   * $linkStyle - Style attribute for the link.   * $linkStyle - Style attribute for the link.
  
plugin/autotooltip.1545775176.txt.gz · Last modified: 2018-12-25 22:59 by zioth

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki