Koozali.org: home of the SME Server

Perldoc output for qpsmtpd plugins

Offline mmccarn

  • *
  • 2,627
  • +10/-0
Perldoc output for qpsmtpd plugins
« 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.

Steps to re-create:
* Install 'pandoc' from the epel repository
* 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

Offline Jean-Philippe Pialasse

  • *
  • 2,763
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Perldoc output for qpsmtpd plugins
« Reply #1 on: July 16, 2017, 05:24:53 PM »
Thank you for this great work and for sharing the procedure !

Offline ReetP

  • *
  • 3,736
  • +5/-0
Re: Perldoc output for qpsmtpd plugins
« Reply #2 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.


Deserves a page in its own right !

Nice job.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation