Hi Jesse
The other problem with using bibtexref is that it would need to output
citations and references in the correct wikibook xml when producing a
pdf version of the document. I don't know how easy or hard this would
be, but it's probably hard.
So let's think aloud about how practical it would be to extend the
citations recipe in wikipublisher to provide a field-oriented
interface. We don't want to re-write the citations recipe, but can we
extend it to provide different reference styles, without breaking
existing installations? First, let's agree on what we mean by
"citation" and "reference".
A citation is the bit in the body text, such as cite(Joe:2010), and a
reference is the description in the footer that describes Joe:2010 in
full. I think the cite(key) markup is already sufficiently flexible
and the focus for extension is the formatting of the references.
Suppose we adopt a syntax like key1="value1" key2="value2" ... -- this
will let us use the existing pmwiki "ParseArgs" function to take apart
the string.
Next, suppose we make a small change to cookbook/wikipublisher/
citations.php that does something like:
global $ReferenceFormatFunction;
...
if (@$ReferenceFormatFunction)
$citetext = $ReferenceFormatFunction($citetext);
Now you can provide your own formatting function using wiki markup;
for example:
function MyReferenceFormat($citetext) {
$opt = ParseArgs($citetext);
$layoutFmt = array('author' => array('o' => '', 'c' => ', '),
'title' => array('o' => "'/", 'c' => "/'"));
$out = array();
foreach($layoutFmt as $k => $v)
if ($opt[$k]) $out[] = $v['o]'.$opt[$k].$v[c'];
return count($out) ? implode($out) : $citetext;
}
You define the $layoutFmt array in the order you want the fields to
display, with markup to wrap around each field. If no fields are
defined, it returns the input string. The code could also treat
$layoutFmt as a global variable (so it can be set in local config.php
or Group.php files and be generalised to support different reference
types (books, journal articles, conference proceedings, etc). In
principle, it should be possible to provide a recipe for each desired
layout format -- you install the one you need, or write a new one.
What do you think? Is this what you had in mind?
JR
> > There is a sample page showing a formatted bibliography athttp://
www.wikipublisher.org/wiki/Bibliographies/Advocacy--hope this