HtmlizeBibtex is made up of the following scripts:
- bibtex2html.py: Formats Bibtex content into HTML (avoiding tables).
- htmlizeBibtex.js: Generates labels for inline citations. When those labels are clicked a dialog appears/disappears. This dialog contains the referred citation in a readable format .
These are generic instructions to use citations inside your html file. You can find an example in the index.html file.
Add the CSS in the <head> tag.
<link rel="stylesheet" href="css/htmlizeBibtex.css" />
<link rel="stylesheet" href="css/ui-lightness/jquery-ui-1.9.2.custom.min.css" />
Add the JavaScript files in the <head> tag.
<script type="text/javascript" src="js/htmlizeBibtex.js"></script>
<script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.9.2.custom.min.js"></script>
Wherever you want to cite in your html file, use the citation id as it appears in the bibtex file.
... and here it comes a citation <span class="cite">{citation_id}</span>. Blah blah...
Finally, add this once as a child of the <body> tag.
<div id="citations">
</div>
To customize the behavior of htmlizeBibtex redefine htmlizeBibtex.config at the end of the body. HtmlizeBibtex.config contains the following attributes:
- inline_citation: Used to customize the inline elements inserted in the HTML. You can redefine a string where a simple replacement is performed for the variable $citeid.
For example, to insert an icon for each citation insert the following HTML snippet:
<script type="text/javascript">
htmlizeBibtex.config.inline_citation = '<img src="css/images/papers.png" alt="$citeid" />'
</script>
To populate #citations tag of an HTML file, execute the following command:
python bibtex2html.py -f [path/to/target-html-with-citations] [path/to/bibtex-file]
If you prefer to just generate the HTML snippet and manually insert it later on, simply run:
python bibtex2html.py [path/to/bibtex-file]