[pmwiki-users] Stuck: using MarkupToHTML and $HTMLFooterFmt

John Rankin john.rankin at affinity.co.nz
Sun Oct 15 17:26:05 CDT 2006


I have a problem that has stumped me totally.

My question: what is the best way to tell pmwiki to output 
a block of page text after the (:closeall:) has closed all 
open tags at the end of a page?

In the easy citations recipe under development, an author 
writes cite(ref-id), clicks the resulting '?', enters the 
citation details, and the citation appears in the bibliography 
at the end of the page, with a link to it from the cite position.

I'm doing this by storing citations in a (:bib:) ... (:bibend:) 
block, which can be anywhere on the page.

The bibliography comes out after the final closing tag(s) 
generated from (:closeall:), in a 
<div id='references'> ... </div>.

I'm doing this as follows:
- process (:div:) ... (:divend:) blocks > include
- generate a list of referenced citations
- put these into $HTMLFooterFmt['bib'] = ... MarkupToHTML(...) ...;
- add <!--HTMLFooter--> to the template

The resulting output is 95% correct, but the broken 5% is a 
big problem:

- if an author writes &mdash; in the citation, this comes out
  as &amp;mdash; -- that one I can fix

- if the author includes a blank line as part of the citation,
  this comes out as &lt;:vspace&gt;

- if the author includes [@ ... @] in the citation, this comes
  out as &lt;pre ... &gt; ... &lt;/pre&gt;

- if the author includes \ line continuations or \\ line breaks,
  it dies completely and I have to remove them (this may be a
  different problem, but I can't be sure -- "fatal error" is
  not a helpful thing to see late at night)

- and so on

The problem with [@ ... @] goes away if I move the rule to run 
<[=, but that breaks [=(bib:) ... (:bibend:)=].

The only other thing I can think of is to let pmwiki process
the bibliography in place, then have a posteval rule that
moves the references div to the end of the page. As far as I
can tell, there isn't a way to change (:closeall:) to
(:closeall:)(:citations:) and add another markup rule to
stick the bibliography at the end before the page is split.

Any help and advice would be much appreciated.
-- 
JR
--
John Rankin







More information about the pmwiki-users mailing list