20 Commits
Author SHA1 Message Date
Frederik Möllers 5b755a7e82 Fix notes for @misc items
Note was shown twice
2026-03-27 00:19:19 +01:00
Frederik Möllers 295a6afe72 Fix missing braces in if-statements
For notes and comments in JanosBibliographyStyle
2026-03-27 00:15:30 +01:00
Frederik Möllers d51bd29402 Add notes to entries (in addition to comments) 2026-03-27 00:09:32 +01:00
Frederik Möllers c7abb01eae Merge remote-tracking branch 'upstream/master' into staging 2026-02-10 00:56:03 +01:00
Martin Monperrus 6d0b3c8493 fix: improve caching feature usability 2026-01-24 06:33:48 +01:00
Martin Monperrus d15355b65c fix syntactic bug 2025-11-12 22:09:08 +01:00
Frederik Möllers 05fe036ba6 Don't fail makehtml.sh if no *.dat file exists 2025-10-24 02:36:14 +02:00
Frederik Möllers f4298cf171 Add comment field to JanosBibliographyStyle
Print the content of "Comment" fields in JanosBibliographyStyle, similar
to how it is done in VancouverBibliographyStyle.
2025-10-24 02:26:57 +02:00
Frederik Möllers d714808318 Merge branch 'master' into staging
Pull latest upstream changes
2025-10-24 02:24:48 +02:00
Frederik Möllers c0912e172c Merge branch 'github'
Pull latest upstream changes
2025-10-24 02:23:58 +02:00
Frederik Möllers ef723ef291 Merge branch 'monperrus:master' into master 2025-10-24 00:13:16 +00:00
Martin Monperrus 95fe893121 Update README.wiki 2025-10-01 14:04:59 +02:00
Hans-Nikolai Viessmann 2381e7c412 add DokuWiki bb2dw plugin reference to readme file (#138) 2025-10-01 14:00:10 +02:00
Martin Monperrus 2867059f68 fix https://github.com/monperrus/bibtexbrowser/issues/136 2025-09-09 07:13:11 +02:00
Frederik Möllers a8c24dab18 Add internationalization for third-party styles (#137) 2025-09-08 06:59:13 +02:00
Frederik Möllers e2154ea9b0 Translate remaining english strings to german
"vol.", "no.", "pp."
2025-09-08 00:19:35 +02:00
Frederik Möllers 24689aceb4 Add internationalization for third-party styles
Added proper internationalization for JanosBibliographyStyle and
VancouverBibliographyStyle. Translation of strings like "in", "Master's
Thesis" etc. was missing.
2025-09-08 00:18:51 +02:00
Frederik Möllers 0bd87f51fd Improve use of CSS font-weight 2025-09-08 00:18:51 +02:00
Frederik Möllers 8a4122d049 Add internationalization for third-party styles
Added proper internationalization for JanosBibliographyStyle and
VancouverBibliographyStyle. Translation of strings like "in", "Master's
Thesis" etc. was missing.
2025-09-08 00:03:34 +02:00
Frederik Möllers 0f3216a056 Use staging URL 2025-09-07 23:12:16 +02:00
5 changed files with 140 additions and 8 deletions
+121
View File
@@ -1455,6 +1455,72 @@ class BibtexbrowserTest extends PHPUnit_Framework_TestCase {
$this->assertEquals(0, count($results));
}
function test_tags_pagination() {
// Define the page size for pagination
bibtexbrowser_configure('TAGS_SIZE', 2);
// Create a test BibTeX database with multiple entries and keywords
$bibtex = "@article{paper1,title={Paper One},keywords={tagA, tagB},year=2020}
@article{paper2,title={Paper Two},keywords={tagC},year=2020}
@article{paper3,title={Paper Three},keywords={tagD},year=2020}
@article{paper4,title={Paper Four},keywords={tagE},year=2020}";
$test_data = fopen('php://memory','r+');
fwrite($test_data, $bibtex);
fseek($test_data, 0);
$db = new BibDataBase();
$db->update_internal("inline", $test_data);
// Create MenuManager display
$display = new MenuManager();
$display->setDB($db);
// Test the first page
$_GET["tags_page"] = '1';
ob_start();
$display->display();
$output1 = ob_get_clean();
// Tags are sorted alphabetically.
$this->assertStringContainsString('tagA', $output1);
$this->assertStringContainsString('tagB', $output1);
$this->assertStringNotContainsString('tagC', $output1);
// Verify pagination link to the next page
$this->assertStringContainsString('keywords_page=2', $output1);
// Test the second page
$_GET["keywords_page"] = '2';
ob_start();
$display->display();
$output2 = ob_get_clean();
$this->assertStringContainsString('tagC', $output2);
$this->assertStringContainsString('tagD', $output2);
$this->assertStringNotContainsString('tagA', $output2);
$this->assertStringNotContainsString('tagE', $output2);
// Verify navigation links to previous and next pages
$this->assertStringContainsString('keywords_page=1', $output2);
$this->assertStringContainsString('keywords_page=3', $output2);
// Test the third page
$_GET["keywords_page"] = '3';
ob_start();
$display->display();
$output3 = ob_get_clean();
$this->assertStringContainsString('tagE', $output3);
$this->assertStringNotContainsString('tagD', $output3);
// Verify navigation link to the previous page
$this->assertStringContainsString('keywords_page=2', $output3);
$this->assertStringNotContainsString('keywords_page=4', $output3); // No next page
// Clean up
unset($_GET["keywords_page"]);
}
function test_venuevc_pagination() {
// Define the page size for pagination
bibtexbrowser_configure('VENUE_SIZE', 2);
@@ -1520,6 +1586,61 @@ class BibtexbrowserTest extends PHPUnit_Framework_TestCase {
// Clean up
unset($_GET["venue_page"]);
}
function test_AcademicDisplay() {
// Create test BibTeX database with entries from different categories
$bibtex = "@article{journal1,title={Journal Article},author={John Doe},journal={Nature},year=2023,type={Journal Articles}}
@inproceedings{conf1,title={Conference Paper},author={Jane Smith},booktitle={ICSE},year=2023,type={Refereed Conference Papers}}
@book{book1,title={A Book},author={Bob Johnson},publisher={Springer},year=2022,type={Books}}
@techreport{tech1,title={Technical Report},author={Alice Brown},institution={MIT},year=2023,type={Technical Reports}}";
$test_data = fopen('php://memory','x+');
fwrite($test_data, $bibtex);
fseek($test_data,0);
$db = new BibDataBase();
$db->update_internal("inline", $test_data);
// Test with BIBTEXBROWSER_ACADEMIC_TOC = true
bibtexbrowser_configure('BIBTEXBROWSER_ACADEMIC_TOC', true);
$display = new AcademicDisplay();
$display->setDB($db);
ob_start();
$display->display();
$output_with_toc = ob_get_clean();
// Verify TOC is present
// $this->assertStringContainsString('class="btb-menu-toc"', $output_with_toc);
$this->assertStringContainsString('Refereed Articles', $output_with_toc);
// Verify HTML structure for both cases
$xml1 = new SimpleXMLElement("<doc>".$output_with_toc."</doc>");
$headers1 = $xml1->xpath('//div[@class="sheader"]');
$this->assertEquals(0, count($headers1));
$anchors = $xml1->xpath('//h2');
$this->assertGreaterThan(3, count($anchors));
// Test with BIBTEXBROWSER_ACADEMIC_TOC = false
bibtexbrowser_configure('BIBTEXBROWSER_ACADEMIC_TOC', false);
$display2 = new AcademicDisplay();
$display2->setDB($db);
ob_start();
$display2->display();
$output_without_toc = ob_get_clean();
// Verify TOC is not present
$this->assertStringNotContainsString('class="btb-menu-toc"', $output_without_toc);
// But category headers should still be present
$this->assertStringContainsString('Refereed Articles', $output_without_toc);
$xml2 = new SimpleXMLElement("<doc>".$output_without_toc."</doc>");
$headers2 = $xml2->xpath('//div[@class="sheader"]');
$this->assertGreaterThan(0, count($headers2));
}
} // end class
// Test implementation that records events
+2 -1
View File
@@ -60,10 +60,11 @@ The following uses bibtexbrowser under the hood:
* [[http://www.monperrus.net/martin/feeding-mysql-database-with-bibtexbrowser|Feeding a MySQL database from the content of a bibtex file]]
* Publication lists in Wordpress with [[http://www.monperrus.net/martin/wp-publications|wp-publications]]
* [[http://www.monperrus.net/martin/publication-lists-with-hal-and-bibtexbrowser|Publication lists with HAL and bibtexbrowser]]
* Generating publication lists in DokuWiki using the [[https://www.dokuwiki.org/plugin:bb4dw|bb4dw plugin]]
=====Demo and screenshot=====
Demo: [[http://bibtexbrowser.sourceforge.net/bibtexbrowser.php?bib=metrics.bib|Here, you can browse a bibtex file dedicated to software metrics]]
Demo: [[https://www.monperrus.net/martin/bibtexbrowser.php|Here, you can browse a bibtex file of Martin's papers.]]
<img height="500" src="https://www.monperrus.net/martin/bibtexbrowser/bibtexbrowser-screenshot.png" alt="bibtexbrowser screenshot"/>
+1 -1
View File
@@ -3,7 +3,7 @@ bibtexbrowser_configure('ABBRV_TYPE','key');
// use tabular layout (HTML tables)
bibtexbrowser_configure('BIBTEXBROWSER_LAYOUT','table');
// URL to individual files
bibtexbrowser_configure('BIBTEXBROWSER_URL',"https://publications.zrd-saar.de/");
bibtexbrowser_configure('BIBTEXBROWSER_URL',"https://publications-staging.zrd-saar.de/");
// URL to jQuery
bibtexbrowser_configure('JQUERY_URI', '/static/jquery-3.6.4.min.js');
// URL to MathJax
+15 -5
View File
@@ -236,7 +236,7 @@ if (defined('ENCODING')) {
@define('BIBTEXBROWSER_URL',basename(__FILE__));
// Specify the location of the cache file for servers that need temporary files written in a specific location
@define('CACHE_DIR','');
@define('CACHE_DIR','.');
// Specify the location of the bib file for servers that need do not allow slashes in URLs,
// where the bib file and bibtexbrowser.php are in different directories.
@@ -368,7 +368,7 @@ function _zetDB($bibtex_filenames) {
// ---------------------------- HANDLING caching of compiled bibtex files
// for sake of performance, once the bibtex file is parsed
// we try to save a "compiled" in a txt file
$compiledbib = CACHE_DIR.'bibtexbrowser_'.md5($bibtex_filenames).'.dat';
$compiledbib = c("CACHE_DIR").'/bibtexbrowser_'.md5($bibtex_filenames).'.dat';
$parse=filemtime(__FILE__)>@filemtime($compiledbib);
@@ -2584,6 +2584,16 @@ function JanosBibliographyStyle($bibentry) {
$result = implode(", ",$entry).'.';
// some comments (e.g. acceptance rate)?
if ($bibentry->hasField('comment')) {
$result .= " (".$bibentry->getField("comment").")";
}
// some notes (e.g. "accepted for publishing")?
if (($type!="misc") && $bibentry->hasField('note')) {
$result .= " (".$bibentry->getField("note").")";
}
// add the Coin URL
$result .= "\n".$bibentry->toCoins();
@@ -2994,7 +3004,7 @@ class MenuManager {
} else $page = 1;
if (count($tags)>0) $this->displayMenu('Keywords', $tags, $page, bibtexbrowser_configuration("MENU_SIZE"), Q_TAG_PAGE,
if (count($tags)>0) $this->displayMenu('Keywords', $tags, $page, bibtexbrowser_configuration("TAGS_SIZE"), Q_TAG_PAGE,
Q_TAG);
}
@@ -3477,7 +3487,7 @@ class AcademicDisplay {
$this->db = createBibDataBase();
$this->db->bibdb = $this->entries;
if (BIBTEXBROWSER_ACADEMIC_TOC != true) {
if (c("BIBTEXBROWSER_ACADEMIC_TOC") == false) {
foreach (_DefaultBibliographySections() as $section) {
$this->search2html($section['query'],$section['title']);
}
@@ -3511,7 +3521,7 @@ class AcademicDisplay {
echo "\n<a name=\"".$section['anchor']."\"></a>";
echo "<h".BIBTEXBROWSER_HTMLHEADINGLEVEL.">";
echo $section['title']." (".$section['count'].")";
echo "</h".BIBTEXBROWSER_HTMLHEADINGLEVEL.">\n",
echo "</h".BIBTEXBROWSER_HTMLHEADINGLEVEL.">\n";
$section['display']->display();
}
}
+1 -1
View File
@@ -54,4 +54,4 @@ done
# Clean up
rm -rf "temp"
rm bibtexbrowser_*.dat
rm -f bibtexbrowser_*.dat