This repository contains a JavaScript module that simplifies the integration of an author's HAL bibliography into a website. The code uses the HAL API to retrieve data and displays it in a style similar to the HAL CV. The package also provides several plugins to enhance the displayed information.
To integrate a HAL bibliography into a website, you will need the researcher's HAL unique identifier: idHal.
-
Download the latest release and extract the hal-bibliography-integrator.min.es.js and hal-bibliography-integrator.css files from the "dist.zip" archive.
-
Insert the following HTML node where you want to display the bibliography:
<div id="hal-bibliography-integrator"></div>
-
In the
<head>of your page, add the following code to load the CSS resources:<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css" integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ==" crossorigin="anonymous" referrerpolicy="no-referrer" /> <link rel="stylesheet" href="./path/to/hal-bibliography-integrator.css">
-
(Optional) If some article titles contain mathematical expressions, you can ensure proper rendering by adding the following code to the
<head>of your page:<script> MathJax = { tex: { inlineMath: [['$', '$'], ['\\(', '\\)']], processEscapes: true, tags: "all" }, svg: { fontCache: 'global' }, loader: { load: ['[tex]/html'] } }; </script> <script defer src="https://cdn.jsdelivr.net/npm/mathjax@4/tex-svg.js"></script>
-
At the end of the
<head>section of your HTML page, add the following code and configure the target idHal and the list of desired publication types (see the supported types list in the documentation).<script type="text/javascript"> const hal_bibliography_integrator_conf = { "id": "idHal", // enter HAL identifier "typeList": [ // Configure documents to fetch "THESE", "ART", "PROCEEDINGS", "UNDEFINED", "COMM" ], "doit": true, // trigger "debug": false, // disable logs "onLoad": "expanded", // section default behavior (expanded || collapsed) } </script>
Note: The different publication sections are displayed in the order defined in the typeList array.
-
At the end of the
<body> of your HTML page, add the following code to load and start the module:<script type="module"> import { hbi_start } from './path/to/hal-bibliography-integrator.min.es.js' hbi_start(hal_bibliography_integrator_conf); </script>
The module includes several plugins that display additional informations. See the documentation for their individual configuration.
This module is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License v3.0 or later.



