[pmwiki-users] Data Lookups - was: Great pagelist question...
Martin Fick
mogulguy at yahoo.com
Wed Aug 30 20:11:48 CDT 2006
--- "Patrick R. Michaud" <pmichaud at pobox.com> wrote:
> At least my current vision of things, having colons
> in the markup text (as above) doesn't cause anything
> different to happen to the page it's written in.
> Everything remains exactly as before.
>
> Instead, it's when the page variable is used (as in
> {$:XYZ}) that the magic happens -- at *that* point
> a page's markup is scanned looking for an
> XYZ: field to fill it. But the page itself is
> unchanged.
Right, this is genius, it's not actually markup
that you are defining but rather a way to search
and lookup data out of text; which could lead to
many more ideas... (see below)
> In many cases, the best markups are those that are
> common in normal text and don't require any special
> handling. For example, see the properties at the
> top of each Cookbook page; a person simply writes
> what is natural to write and the right thing
> happens automatically.
Yes, yes. This is probably a little far out, but
maybe a general lookup framework could be devised
to allow even common pmwiki markup to be looked up
also?
(I am sure this is FULL of holes, I'm just trying
to illustrate a concept)
To steal some thoughts fom Xpath, building
a lookup grammar of items:
:: - definition list item
: - the current suggested colon field
* - bulleted item
# - numbered item
! - heading item
[ - link (weak, I know)
;; - Paragraph starting with Hello
; - First line
. - Fifth word
, - comma separated word
|| - wiki table cell
-Any of the following followd by text will define
the term:
::Name - wiki definition list item 'Name'
;;Hello* - Paragraph starting with Hello
-Any of the following followd by an index will
define its postition:
*[1] - first bulleted item (maybe parens is
better?)
#[4-6] - numbered item 4 though 6
||[1,2] - row 1, col2 in a wiki table
-Build up a path by combining items
-Prefix a path with * to indicate that does not have
to be absolute. (we could go the other way,
prefixing with \ for absolute, but I think that
the more common case should be simpler)
-Surrond the whole thing with something so that
it can be identified as a path: {{}}
Examples:
Employee: John Doe
Phone #: (777)999-2222
Employee: Jane Doe
Phone #: (555)333-1212
{{:John Doe:'Phone #'}} - would give (777)999-2222
(quotes used to suppress #
interpretation)
{{#[3]*[2]}} - second item in the third numbered
list
{{*Phone#[2]}} - second numbered item in under the
item
phone in the top level list
{{!Summary||[2,3]}} - Cell 2,3 under the Summary
heading
{{;6.2}} - Sixed line second word
I know, I know, not simple enough... might make a nice
recipe though? :)
-Martin
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
More information about the pmwiki-users
mailing list