HashComments

Summary: Better way to comment page code
Version: 20260326
Prerequisites: Preferably PHP Version 8.5 but as low as 8.2, anything older has reached PHP "End of life" and might work, I do not support PHP version 5
Status: Ready
Maintainer: --gnuzoo
License: GNU General Public License as published by the Free Software Foundation http://www.fsf.org either version 2 of the License or (at your option) any later version
Categories: Uncategorized
Users: (view / edit)
Discussion: HashComments-Talk

Questions answered by this recipe

Comments are so frustrating - I hate the way PmWiki comments page code.
Who would want to use (:comment this is a comment about something :) ??
Who would want to use (:if false:) this is a comment and can be multiple lines (:ifend:) ???
Using if..ifend for comments does not work properly with pagetextvariables.

I use comments a LOT, way way WAY more than lists. I want to quickly add them.
A comment should be a comment and nothing else. I need better comments!!!

Description

New way to comment in PmWiki - put a '#' at the beginning of a line.

Switch modes:

Before installing locate all of your lists - lines that begin with '#'.
On the line above the list insert (:#Lists:). <--- note: the markup recognizes (:#Lists:), not (:#List:).
If there are no comments in the rest of the page, that is all that needs to be done.
If you have more comments after the list, then at the end of the list add (:#Comments:).
You can switch back and forth as much as needed.

Installation

Warning: if you do not switch to list mode you will not see your list when
you browse your page. Make sure to find all lines starting with '#' before installing
this recipe.

Add one line to you config.php file.

    require_once("hashcomments.php");

Usage

By default lines that start with '#' are now comments.
This is way better and easier than anything else for comments.

This is way way way way better if you install another plugin (yet for me
to release)that will auto comment selected lines in and out.

Change log / Release notes

Initial Release: Version 20260409

Comments

See discussion at HashComments-Talk

User notes : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.