[pmwiki-users] Nested includes and IncludeWithEdit

Bellave Jayaram bellavejayaram at cox.net
Wed Feb 15 14:44:21 CST 2006


I am referring to field as in a wikifarm.

OK, here is the use case in Pmwiki terminology (hopefully, it is clearer
this time) and here is the structure:

Farm	 | Fields	 | Pages in Field
-------------------------------------------
myFarm | Database  | RecoverDBPassword
	 |-----------|-----------------------
	 | System	 | RecoverSystemPassword
		 

 Group	    | Pages in Group
----------------------------------------
Task		    | RecoverLostPasswordTasks
------------------------------------------
Administration  | RecoverLostPassword
------------------------------------------

I may not be using the right markup nor syntax but here is the general
content of each page:

RecoverDBPassword contents:
-------------------------------
If you have lost your database password, follow these steps:

 (:includePage field='Database' RecoverLostPassword:)

RecoverSystemPassword contents:
-------------------------------
If you have lost your system password, follow these steps:

 (:includePage field='System' RecoverLostPassword:)
--------------------------------

RecoverLostPassword contents:
-------------------------------

(:if field='Database':)
(:includePage field='Database' RecoverLostPasswordTasks:)
(:if site='Tempe':)
The Database Administrator for the Tempe site is Perry Mason. You can reach
him by phone at x4455 or at email:perry at pmwikirules.com 
(:ifend:) 
(:ifend:)

(:if field='System':)
(:includePage field='System' RecoverLostPasswordTasks:)
(:if site='Tempe':)
The System Administrator for the Tempe site is Della Street. You can reach
her by phone at x4456 or at email:della at pmwikirules.com 
(:ifend:)
(:ifend:)
--------------------------------

RecoverLostPasswordTasks contents:
-------------------------------

[[#start_Database]]
* Log into your Unix account
* Run the dbpasswd utility
* Enter your Employee ID
* You will be given a temporary password if you are authorized.
* Use the temporary password to access the database administration page.

If you have difficulty, please contact the Database Administrator for your
site.
[[#end_Database]]

[[#start_System]]
Contact the System Administrator for your site. 
[[#end_System]]
---------------------------------


Please help me understand the proper markup and how to do the above so that
RecoverDBPassword ends up as follows:
-----------------------------------------------------------------
If you have lost your database password, follow these steps:

* Log into your Unix account
* Run the dbpasswd utility
* Enter your Employee ID
* You will be given a temporary password if you are authorized.
* Use the temporary password to access the database administration page.

If you have difficulty, please contact the Database Administrator for your
site.

The Database Administrator for the Tempe site is Perry Mason. You can reach
him by phone at x4455 or at email:perry at pmwikirules.com
-----------------------------------------------------------------

Thanks,
Jayaram


-----Original Message-----
From: Patrick R. Michaud [mailto:pmichaud at pobox.com] 
Sent: Wednesday, February 15, 2006 12:47 PM
To: Bellave Jayaram
Cc: pmwiki-users at pmichaud.com
Subject: Re: [pmwiki-users] Nested includes and IncludeWithEdit

On Wed, Feb 15, 2006 at 12:33:45PM -0700, Bellave Jayaram wrote:
> Could you confirm that the processing for Page1 runs before that for Page2
> and finally Page3 is processed and put together? Basically, the more
> specific page, Page3, picks out content from Page2 which is more specific
> than Page1 which is the leaf level page.

Nope, that's not what happens.  Essentially what happens is that
PmWiki starts with the full text of Page3, processes any conditional
(:if:)...(:ifend:) markups, and then processes any (:include:)
directives.  If there are any (:include:) directives, it then restarts
processing from the beginning.

So, assuming that we have:

   Page3:   (:include Page2:)
            (:include Page0:)

   Page2:   This is page 2
            (:include Page1:)

   Page1:   This is page 1

   Page0:   This is page 0

then the processing steps for Page3 are

   (:include Page2:)
   (:include Page0:)

which then becomes (first pass)

   This is page 2
   (:include Page1:)
   This is page 0

which then becomes (second pass)

   This is page 2
   This is page 1
   This is page 0

> The way I am thinking of configuring is to have Page3, say
> RecoverDBPassword, in a Pmwiki field that contains information specific to
a
> certain Domain, say Databases. 

Do you mean "field" in the "wikifarm" sense here, or do you mean it
as a "wikigroup"?

I'm not terribly familiar with DITA, so I'm having a little bit
of trouble following the use case you gave.  My suggestion is to
rephrase the usecase without the use of "Page1", "Page2", "Page3", etc.,
and just stick to the actual names they would have in reality.
That would make it easier to follow.

> The CookBook is a great way for people to discover the various recipes
> within Pmwiki but unfortunately, it is daunting for newbies to wade
through
> it all and to persevere and succeed by trial and error. I believe what we
> need is more of methodology or best practices type of documents that can
> then be used as "Cookie Cutters" to create many useful Pmwiki sites. Maybe
> some documents exist here and there in bits and pieces but I think it
would
> be nice to compile them all in one place.

Yes, it would.  But while lots of people are saying "we should have 
best practices of documents", very few people are saying "here's the 
best practice document I've written, what do you think?" (although 
there are some people who are doing this!).

We have *plenty* of organizational tools at our disposal on pmwiki.org
to build this sort of thing (groups, trails, categories, cookbook
sections, etc.), propose something specific and we can start from 
there.  :-)

> I am hoping in the not too distant future that there would be install
> wizards that go through some of the questions and preconfigure Pmwiki for
a
> particular purpose.   

"Wizards" are very difficult to do cross-platform and in a web
environment, but we might be able to do it.  More likely is to 
have recipe bundles that one simply "drops in" to a standard 
PmWiki installation that causes it to be preconfigured in a 
certain way.

Pm





More information about the pmwiki-users mailing list