Browse Source

improves the configurability of the output through CSS classes (adds .bibmenu and .bibanchor)

pull/20/head
Martin Monperrus 11 years ago
parent
commit
bf91b17fe3
  1. 12
      bibtexbrowser-documentation.wiki
  2. 10
      bibtexbrowser.php

12
bibtexbrowser-documentation.wiki

@ -88,8 +88,6 @@ Create a bib file with the publication records (e.g. csgroup2008.bib) and upload
'''Handling mutliple bibtex files''': If you want to include several bibtex files, just give bibtexbrowser the files separated by semi-columns e.g:
''bibtexbrowser.php?bib=strings.bib;csgroup2008.bib''
</div>
=====FAQ=====
====How to embed a publication list in an home page?====
@ -131,7 +129,6 @@ include( 'bibtexbrowser.php' );
</td>
</tr><!-- end individual -->
</table>
</div>
====How to change the reference style?====
@ -147,9 +144,16 @@ If bibtexbrowser.css exists, it is used, otherwise bibtexbrowser uses its own em
.bibtitle { font-weight:bold; }
.bibbooktitle { font-style:italic; }
</pre>
</div>
&nbsp;
For instance, one can tweak the output by disabling the display of some headers and pieces of information.
<pre>
.bibmenu {display:none} /* disables the [bibtex] and the like */
.bibanchor {display:none} /* disables the index [1] or [Name2010], etc. depending on the value of the configuration value ABBRV_TYPE and BIBTEXBROWSER_LAYOUT
.theader {display:none}
.sheader {display:none} /* disables the year header e.g., 2001 */
</pre>
&nbsp;
'''By setting your own style function'''
The bibliography style is encapsulated in a function. If you want to modify the bibliography style, you can copy the default style in a new file, say ''bibtexbrowser-yourstyle.php'', and rename the function ''DefaultBibliographyStyle'' in say ''MyFancyBibliographyStyle''.

10
bibtexbrowser.php

@ -1392,7 +1392,7 @@ class BibEntry {
break;
}
$result .= bib2html($this);
$result .= $this->bib2links();
$result .= ' '.$this->bib2links();
switch(BIBTEXBROWSER_LAYOUT) { // close row
case 'list':
$result .= '</li>'."\n";
@ -1474,7 +1474,7 @@ class BibEntry {
/** Returns an anchor for this entry. */
function anchor() {
return '<a name="'.$this->getRawAbbrv().'"></a>';
return '<a class="bibanchor" name="'.$this->getRawAbbrv().'"></a>';
}
/** returns a collection of links for the given bibtex entry
@ -1483,12 +1483,12 @@ class BibEntry {
function bib2links() {
$href = 'href="'.$this->getURL().'"';
$str = '';
$str = '<span class="bibmenu">';
if (BIBTEXBROWSER_BIBTEX_LINKS) {
// we add biburl and title to be able to retrieve this important information
// using Xpath expressions on the XHTML source
$str .= " <a".(BIBTEXBROWSER_BIB_IN_NEW_WINDOW?' target="_blank" ':'')." class=\"biburl\" title=\"".$this->getKey()."\" {$href}>[bibtex]</a>";
$str .= "<a".(BIBTEXBROWSER_BIB_IN_NEW_WINDOW?' target="_blank" ':'')." class=\"biburl\" title=\"".$this->getKey()."\" {$href}>[bibtex]</a>";
}
if (BIBTEXBROWSER_PDF_LINKS) {
@ -1505,7 +1505,7 @@ class BibEntry {
$str .= ' <a href="http://scholar.google.com/scholar?cites='.$this->getField("gsid").'">[cites]</a>';
}
return $str;
return $str.'</span>';
}

Loading…
Cancel
Save