gl-website-deployer/publi_bib.php

52 lines
1.1 KiB
PHP
Raw Normal View History

2024-11-23 20:45:29 +01:00
<?php
use RenanBr\BibTexParser\Listener;
use RenanBr\BibTexParser\Parser;
use RenanBr\BibTexParser\Processor;
require dirname(__FILE__).'/common.php';
$m = setup_mustache();
// Create and configure a Listener
$listener = new Listener();
$listener->addProcessor(new Processor\TagNameCaseProcessor(CASE_LOWER));
// Create a Parser and attach the listener
$parser = new Parser();
$parser->addListener($listener);
// Parse the content, then read processed data from the Listener
2024-11-23 20:55:19 +01:00
try {
$parser->parseFile('assets/bib/export-bibtex.bib');
$entries = $listener->export();
2024-11-23 21:01:37 +01:00
$tpl = $m->loadTemplate("publi_bib_html");
echo $tpl->render(
array(
'ROOT_URL' => $iap_root,
'title'=>'Guilhem Lavaux\'s publications',
'publi'=>$entries,
'configure_script'=>[
'MathJax = {
tex: {
inlineMath: [[\'$\', \'$\'], [\'\\\\(\', \'\\\\)\']]
}
};
'
],
'external_scripts'=>[
'src="https://polyfill.io/v3/polyfill.min.js?features=es6"',
'id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"'
],
'bar' => 'baz'));
2024-11-23 20:55:19 +01:00
} catch (Exception $e) {
2024-11-23 21:01:37 +01:00
echo $e->getMessage()) . "<br/>";
2024-11-23 20:55:19 +01:00
}
2024-11-23 20:45:29 +01:00