DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:xtern

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:xtern [2019-02-11 02:03] – [Utilities for checking and correcting broken links] turnermmplugin:xtern [2024-01-18 10:21] (current) Aleksandr
Line 2: Line 2:
    
 ---- plugin ---- ---- plugin ----
-description: Checks external links for connection errors+description: Checks external links for connection errors, with tools for fixing them
 author     : Myron Turner  author     : Myron Turner 
 email      : turnermm02@shaw.ca  email      : turnermm02@shaw.ca 
 type       : action type       : action
-lastupdate : 2019-02-04 +lastupdate : 2022-02-14 
-compatible : Detritus,"Elenor of Tsort","Frusterick Manners",Greebo+compatible : Detritus, Elenor of Tsort, Frusterick Manners, Greebo, Hogfather, Igor, Jack Jackrum
 depends    :  depends    : 
 conflicts  conflicts 
 similar    :  similar    : 
-tags       : links,icons+tags       : links
  
 downloadurl: https://github.com/turnermm/xtern/archive/master.zip downloadurl: https://github.com/turnermm/xtern/archive/master.zip
Line 40: Line 40:
 The plugin checks to see if an external url is accessible.  If it is, then it will replace the standard gray external link icon with a green globe.  If not, it will replace the gray icon with a red globe.  This is in keeping with DokuWiki's use of green for valid internal links and red for broken internal links.  The plugin checks to see if an external url is accessible.  If it is, then it will replace the standard gray external link icon with a green globe.  If not, it will replace the gray icon with a red globe.  This is in keeping with DokuWiki's use of green for valid internal links and red for broken internal links. 
 {{  https://i.imgur.com/iPsu6qZ.png?310 }} {{  https://i.imgur.com/iPsu6qZ.png?310 }}
-These changes do not apply to interwiki links. Interwiki links have the class ''interwiki'' and have icons specific to the wiki or else the Dokuwiki generic interwiki icon.  External links have the class ''urlextern'' and get the globe icon.+These changes do not apply to interwiki links. Interwiki links have the class ''interwiki'' and have icons specific to the wiki or else the DokuWiki generic interwiki icon.  External links have the class ''urlextern'' and get the globe icon.
  
 === HTTP Status codes 4xx === === HTTP Status codes 4xx ===
Line 51: Line 51:
 There is a script in the scripts directory which can be run from the lib/exe directory: There is a script in the scripts directory which can be run from the lib/exe directory:
     php chk_links.php     php chk_links.php
-This will list all  your broken links and the pages where they occur.  The command line script has no time limit, and processes the complete wiki.+This will list broken links and the pages where they occur.  The command line script has no time limit, and processes the complete wiki.
 === Admin Panel === === Admin Panel ===
-You can also run a check in the plugin's administration panel.  There you can do the check by namespace or for the entire wiki. The output in the admin panel creates links which open a new window ready for editing your broken links.  Not all errors show https status codes.  Some will show curl error codes with explanations. What shows up here as curl errors, in the normal page display will be marked with the red globe. +You can also run a check in the plugin's administration panel.  This is preferable to the script, giving more complete results. Here you can do the check by namespace or for the entire wiki. The output in the admin panel creates links which open a new window ready for editing your broken links.  Not all errors show https status codes.  Some will show curl error codes with explanations. What shows up here as curl errors, in the normal page display will be marked with the red globe. 
  
 Checking the entire wiki on large sites may need more than the ''max_execution_time'' set for php scripts on your system.  The plugin has a ''max_time'' configuration option. This defaults to 120 seconds and can be increased.   Checking the entire wiki on large sites may need more than the ''max_execution_time'' set for php scripts on your system.  The plugin has a ''max_time'' configuration option. This defaults to 120 seconds and can be increased.  
 +
 +The admin panel check saves the list of broken links and their pages.  There is a ''Review'' button which enables you to re-check your result at a later time using this saved list.  It is faster than the original check because it does not have to parse the wiki pages to search for external links. As with the original link check, here too you can open the wiki pages for editing.
  
 === Editing Broken Links === === Editing Broken Links ===
 +**Note:**  To use this feature, you must first run the ''xtern'' admin app from the Admin page.  It uses the database created by the app. This database should be kept current for this feature to work optimally.
 + 
 When the new window opens for editing, the broken links for this page will be displayed at the top of the page in yellow message banners.  In the file itself, the broken links will be marked as broken: When the new window opens for editing, the broken links for this page will be displayed at the top of the page in yellow message banners.  In the file itself, the broken links will be marked as broken:
   __ BROKEN-LINK: [[http://www.mturner.org/html/credits.tgz|mturner.org]] LINK-BROKEN __   __ BROKEN-LINK: [[http://www.mturner.org/html/credits.tgz|mturner.org]] LINK-BROKEN __
 When the ''Preview'' button is clicked these will show up as underlined.       When the ''Preview'' button is clicked these will show up as underlined.      
-{{  https://i.imgur.com/AqsjZ8e.png?272  }}     +{{  https://i.imgur.com/AqsjZ8e.png?272  }}   
-Keep in mind that this is a preview.  Anyting that is not saved will disappear from the page.+Keep in mind that this is a preview.  To keep the broken link markup in your page, click the ''Save'' button; to discard, click ''Cancel''
 + 
 +You can also open pages from the the links in the admin panel. The page will open in a new tab or window with the broken link markup in place.   
 + 
 +== Displaying Broken Link Markup == 
 + 
 +By default, the __BROKEN-LINK: . . . LINK-BROKEN__ markup will be hidden from general viewing if it has been saved to the file, and there will be no underlining. Though it is in the page text, it will be displayed in the browser only in the preview mode. This can be changed by setting the ''conceal'' configuration option to false, in which case the broken link markup will display whenever the page is loaded into the browser. The broken link icon is not affected by this setting; it will continue to display until the link is fixed. 
 + 
 +You can also use the ''skip_pages'' option to conceal the broken link icons on a per page basis 
 +==== No Icons ==== 
 +It is possible to use this plugin without displaying its icons for broken, valid, and status 400 links.  To do this, set the ''noicons'' option to ''true'' This does not affect the ''check link'' features of the Administration panel or the __BROKEN-LINK:. . .LINK-BROKEN__ markup. 
 + 
 ===== Configuration Options ===== ===== Configuration Options =====
  
Line 68: Line 83:
 |ca_required|This wiki uses a cacerts.pem file installed in the ''xtern/ca'' directory. See [[#external_requirements]]|''false''| |ca_required|This wiki uses a cacerts.pem file installed in the ''xtern/ca'' directory. See [[#external_requirements]]|''false''|
 |max_time|Time in seconds to allow for broken link checking in the admin panel. See [[#admin_panel]]|120| |max_time|Time in seconds to allow for broken link checking in the admin panel. See [[#admin_panel]]|120|
 +|[[#displaying_broken_link_markup|conceal]]|Display ''BROKEN-LINK'' markup in preview mode only; hide it for general viewing of pages.|''true''|
 +|[[#no_icons|noicons]]|Do not display the xtern plugin's link icons in the browser.  This does not affect the link checking features of the admin panel.|''false''|
 +|alt_div|Some templates do not use the default id to identify the div which holds the page content; if yours is one of these, enter the div id here| |
 +|alt_class|Some templates identify the div which holds the page content by a class name; if yours is one of these, enter the class name here| |
 +|skip_pages|A comma separated list of pages where you want the xtern link icons to be suppressed.  | |
 +
 +
 +
 ===== Discussion ===== ===== Discussion =====
 Please use the forum or the github issue tracker. Please use the forum or the github issue tracker.
  
  
plugin/xtern.1549847036.txt.gz · Last modified: 2019-02-11 02:03 by turnermm

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