pcooksey/bibtex-js

Version using cdn link > 1 Jun not working

Closed this issue · 3 comments

I had a working bibliography, but after upgrading to a version with a link newer than 1 Jun, nothing is displayed.
If I look at the console in the web developer tools I see lot of:
Object { 0: span.author, length: 1, prevObject: {…} }

I had a look at the commits and there was a change in the style format: changing to the new one it kinda works, but I get the last <h1> displayed even for an empty section.

<div class="bibtex_structure">
	<div class="sections bibtextypekey">
		<div class="section @book">
			<h1><strong>B</strong>ooks</h1>
			<div class="sort year" extra="DESC date">
				<div class="templates"></div>
			</div>
		</div>
		<div class="section @article">
			<h1><strong>J</strong>ournal <strong>A</strong>rticles</h1>
			<div class="sort year" extra="DESC date">
				<div class="templates"></div>
			</div>
		</div>
		<div class="section @inproceedings">
			<h1><strong>C</strong>onference and <strong>W</strong>orkshop <strong>P</strong>apers</h1>
			<div class="sort year" extra="DESC date">
				<div class="templates"></div>
			</div>
		</div>
		<div class="section @misc|@phdthesis|@mastersthesis|@bachelorsthesis|@techreport">
			<h1><strong>O</strong>ther <strong>P</strong>ublications</h1>
			<div class="sort year" extra="DESC date">
				<div class="templates"></div>
			</div>
		</div>
	</div>
</div>

Yes in order to provide access to the headers I had to change the style format for academic style.

Do you have any reason for keeping the empty section? Why not just remove it? Or put hidden at the end in the <div class="..." hidden> if you want to keep it around for later.

Ok, I did not check the changelog then... :)
Anyway, why is <div class="section @book"> automatically removed when empty while <div class="section @misc|@phdthesis|@mastersthesis|@bachelorsthesis|@techreport"> is not?
I could remove it, but in this way it is automatic if one day I add an entry to the bib file, so it is easier.

If you need I have a live one here: http://alexpacini.gitlab.io/pubs.html

No worries.
Thank you for the live example that helped. There is a problem when removing the sections. After @book is removed the array index is shifted so my index for @misc... is incorrect and it doesn't get removed. I have a fix for it that I will push.