summaryrefslogtreecommitdiff
path: root/doc/todo/missingparents.pm.mdwn
blob: cecac7a94010dec37e9caf6b4eec4c414c426d4a (plain)

This is another blogging support thing, and it relies on [[pagespec_relative_to_a_target]] (but only to figure out whether a given page has a child). Basically, you give it a page called missingparents.mdwn, something like this:

And it scans the whole wiki for pages that match the pagespecs but are missing parents. If any are found, they are generated automatically using the text in the "generate" parameter (except $page is substituted for the page title). These generated pages aren't kept in version control, but of course they're ordinary wiki pages and can be edited by the web form or otherwise added, at which point the missingparents plugin lets go of them. (TODO: CGI.pm needs to know to rcs_add these pages if they are edited, and it doesn't.) If all of the children of a missingparent page goes away, the missingparent itself is unlinked automatically, and all missingparents are deleted on wiki rebuild.

To implement this, I needed to tell ikiwiki that pages were being added and removed in a non-standard way, and so created functions newpage and delpage in the IkiWiki namespace to do these things. delpage is modeled on the Render.pm code that deletes pages, so I re-used it in Render.pm. I also needed a way to add files to be deleted on a refresh(), so I added a needsdelete hook, parallel in form to needsbuild.

This patch, or one like it, would enable better blogging support, by adding the ability to hierarchically organize blog posts and automatically generate structural pages for year, month, or day. Please apply. --Ethan

[[!tag patch patch/core]]