Koozali.org: home of the SME Server

Contribs.org Forums => General Discussion => Topic started by: mmccarn on July 16, 2017, 03:31:41 PM

Title: Perldoc output for qpsmtpd plugins
Post by: mmccarn on July 16, 2017, 03:31:41 PM
I've finally figured out a way to convert perldoc output into mediawiki format so that I could easily add it to the wiki for the Qpsmtpd Plugins (https://wiki.contribs.org/Qpsmtpd#Plugins).

Steps to re-create:
* Install 'pandoc' from the epel repository (https://wiki.contribs.org/Epel)
* Use perldoc to generate html, then pipe that through pandoc to create mediawiki format
* clean up the output:
  * add an anchor at the top so that heading links work
  * add a link back to Qpsmtpd#Plugins
  * remove the closing </dd>, </dl> and </dt> tags that mediawiki does not handle properly

The resulting command looks like this:
Code: [Select]
perldoc -T -ohtml /usr/share/qpsmtpd/plugins/naughty |pandoc -f html -t mediawiki |sed 1 i\\n\n\n<span id="_top">[[Qpsmtpd#Plugins]]</span> |sed -e s#</d.>##

So far I've only done 3 plugins in case the format can be improved.  Suggestions welcome.

https://wiki.contribs.org/Qpsmtpd:naughty
https://wiki.contribs.org/Qpsmtpd:auth
https://wiki.contribs.org/Qpsmtpd:helo
Title: Re: Perldoc output for qpsmtpd plugins
Post by: Jean-Philippe Pialasse on July 16, 2017, 05:24:53 PM
Thank you for this great work and for sharing the procedure !
Title: Re: Perldoc output for qpsmtpd plugins
Post by: ReetP on July 17, 2017, 10:32:53 AM
I've finally figured out a way to convert perldoc output into mediawiki format so that I could easily add it to the wiki for the Qpsmtpd Plugins (https://wiki.contribs.org/Qpsmtpd#Plugins).


Deserves a page in its own right !

Nice job.