- pretty and consistent cross-references in HTML documents
- customizations possible upon script loading
- clone this git-repo into your project
- copy the
- first code-snippet to your html
<head></head>- needs to be pasted before any other
<link>for firefox compatibility
- needs to be pasted before any other
- second code-snippet below to the bottom of your html
<body></body>
- first code-snippet to your html
- replace
<path/to/repo/>with the path pointing to the cloned repo - customize the appearance using the fields in
Xrefs.initialize()
<!-- `importmap` to load local scripts -->
<!-- before any other imports/links (firefox compatibility) -->
<script type="importmap">
{
"imports": {
"xrefs": "<path/to/repo>/src/index.js"
}
}
</script>
<!-- Xrefs setup -->
<script type="module">
import { Xrefs } from "xrefs";
Xrefs.initialize({
"bibPaths": [
"./bib-refs.bib",
],
"bibEntryFormat": [
"long",
"short",
][0],
"citeStyle": [
"authoryear",
"ieee",
][0],
"maxAuthors": 5,
"glsPaths": [
"../glossary.json",
],
});
Xrefs.render();
console.log(Xrefs)
</script>Note
you can check test.html for an example html file