Update website
This commit is contained in:
parent
266051acd2
commit
508406d89c
@ -6,12 +6,41 @@ use RenanBr\BibTexParser\Processor;
|
||||
|
||||
require dirname(__FILE__).'/common.php';
|
||||
|
||||
function removeBoundingBraces($str) {
|
||||
// Trim whitespace first
|
||||
$str = trim($str);
|
||||
|
||||
// Check if string starts with { and ends with }
|
||||
if (strlen($str) >= 2) {
|
||||
// Remove opening brace if it exists
|
||||
if ($str[0] === '{') {
|
||||
$str = substr($str, 1);
|
||||
}
|
||||
|
||||
// After removing first brace, get new length
|
||||
$length = strlen($str);
|
||||
|
||||
// Remove closing brace if it exists
|
||||
if ($length > 0 && $str[$length - 1] === '}') {
|
||||
$str = substr($str, 0, -1);
|
||||
}
|
||||
}
|
||||
|
||||
return $str;
|
||||
}
|
||||
|
||||
$m = setup_mustache();
|
||||
|
||||
|
||||
|
||||
// Create and configure a Listener
|
||||
$listener = new Listener();
|
||||
$listener->addProcessor(new Processor\TagNameCaseProcessor(CASE_LOWER));
|
||||
$listener->addProcessor(new NamesProcessor());
|
||||
$listener->addProcessor(static function (array $entry) {
|
||||
$entry['title'] = removeBoundingBraces($entry['title']);
|
||||
return $entry;
|
||||
});
|
||||
|
||||
// Create a Parser and attach the listener
|
||||
$parser = new Parser();
|
||||
|
@ -48,9 +48,9 @@ span.author:last-child::after {
|
||||
<td>
|
||||
<b>{{{ title }}}</b><br/>
|
||||
<div class='authors'>
|
||||
{{# authors }}
|
||||
<span class="author">{{ . }}</span>
|
||||
{{/ authors }}
|
||||
{{# author }}
|
||||
<span class="author">{{ first }} {{ last }}</span>
|
||||
{{/ author }}
|
||||
</div>
|
||||
<div class='doi'><a href='https://dx.doi.org/{{doi}}' target="_blank">DOI: {{ doi }}</a></div>
|
||||
{{#doi}}<div class='pubdetail'>{{journal}} ({{year}}) {{#volume}}<span class="publi-volume">{{.}}</span>{{/volume}}{{#page}}, {{.}}{{/page}}</div>{{/doi}}
|
||||
|
Loading…
Reference in New Issue
Block a user