[pmwiki-users] Subpages

Joachim Durchholz jo at durchholz.org
Tue May 30 05:46:20 CDT 2006


Dr Fred C schrieb:
> Subpages might work fine for many applications with some savings in code 
> and parsing.  Perhaps it's a good place to start.

I'd second that.

> That being said, I'm not entirely sure from an enduser perspective how 
> subpages differs from having a hierarchy. 
> 
> For example, would StudentBobby's subpage be able to have its own set of 
> private subsubpages that might comprise Bobby's various projects, 
> quizes, and homework over the year? 
> 
> LocalElementary.TeacherJones,StudentBobbySmith,ReportCard
> LocalElementary.TeacherJones,StudentBobbySmith,Homework,Widgets 
> LocalElementary.TeacherJones,StudentBobbySmith,Homework,DoFunnys 
> LocalElementary.TeacherJones,StudentBobbySmith,Quiz,Widgets 

I'd want something different.

Assume I have a blob of text. With sections and subsections (and 
subsubsections etc.), so that the final sections are manageable chunks 
of text.

Sections can be of wildly varying size.
E.g. I'm currently writing up installation instructions for a Linux 
distribution; some sections consist of a single sentence like: "Run 
'aptitude --install less'." Others do lots and lots of explaining 
alternatives, evaluating mechanisms, and giving general background 
information.
Sections can change in size. In several cases, I started out with a 
wildly complicated way of doing things, only to realize later that 
there's a ready-made package that just needs to be installed. Usually 
it's the reverse case: I start with a page that just says "Install 
package such-and-so", only to discover that this package has many, many 
options and needs cooperation with other software, so I start adding an 
explanatory section here, an alternate configuration there, and in the 
end, the page goes beyond 20K raw text.

So what I need is a simple way to split a sectioned page into a group 
with subpages. And, vice versa, to join the pages of a group into a 
single sectioned page. (I just noted that the term "subpage" is 
ambiguous in a context with hierarchical groups - it could mean sections 
of a page that are separately editable, or it could mean pages of a group.)

So the first thing I'd suggest is to use URLs like

   LocalElementary.TeacherJones.StudentBobbySmith.Quiz.Widgets

and let the wiki look which of these pages are really subsections of a 
single page.

Hmm... or yet another option: store every single of these pages in their 
own files. Most edits will be on sections instead of whole pages anyway, 
yes?
Instead, introduce a "section" attribute for pages. If a page is marked 
as section, displaying it causes PmWiki to go up one level in the group 
hierarchy, collect any other child pages that are sections, and display 
*that*. (Possibly make the browser scroll to the requested section. And 
bump the titles - what's ! in a subpage would be !! if displayed as a 
subpage.)
This would take care of keeping the version history of a page even if it 
goes through several cycles of existence as a subpage or subsection.

(The downside of that approach is that it makes PmWiki process more on 
reads and less on writes. Usually one would want it the other way round.)

Regards,
Jo




More information about the pmwiki-users mailing list