Skip to content

papis-html: fixup and modernize code #60

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

alexfikl
Copy link

@alexfikl alexfikl commented Jul 22, 2023

This modernizes the papis-html plugin a bit to use the latest things and work with flake8.
The commits are fairly self-contained, but generally this

  • Adds and fixes all flake8 errors
  • Updates jQuery, Bootstrap, bibtex-js
  • Updates the index.html to work with Bootstrap 5 and some cleanup.

NOTE: This does not touch the Vue application in there!

return moment(x["DATE"]).format("YYYY");
}
return "";
}

Check notice

Code scanning / CodeQL

Semicolon insertion

Avoid automated semicolon insertion (95% of all statements in [the enclosing function](1) have an explicit semicolon).
// Check if authors are formatted

// Get conjunction if set in author
conjunction = format.attr('conjunction') ? format.attr('conjunction') : ', and';

Check warning

Code scanning / CodeQL

Missing variable declaration

Variable conjunction is used like a local variable, but is missing a declaration.
// Check if value is empty
if (name[index] != "") {
$(this).html($(this).html() + name[index]);
for (i = 0; i < searchLength; i++) {

Check warning

Code scanning / CodeQL

Missing variable declaration

Variable i is used like a local variable, but is missing a declaration.
var fullName = $.grep(name.slice(0, 4), Boolean).join(" ");
author.attr('class', fullName);
var textBefore = false;
for (j = 0, ele = author.find("span:not(a)"), len = ele.length; j < len; ++j) {

Check warning

Code scanning / CodeQL

Missing variable declaration

Variable j is used like a local variable, but is missing a declaration.
var fullName = $.grep(name.slice(0, 4), Boolean).join(" ");
author.attr('class', fullName);
var textBefore = false;
for (j = 0, ele = author.find("span:not(a)"), len = ele.length; j < len; ++j) {

Check warning

Code scanning / CodeQL

Missing variable declaration

Variable ele is used like a local variable, but is missing a declaration.
var fullName = $.grep(name.slice(0, 4), Boolean).join(" ");
author.attr('class', fullName);
var textBefore = false;
for (j = 0, ele = author.find("span:not(a)"), len = ele.length; j < len; ++j) {

Check warning

Code scanning / CodeQL

Missing variable declaration

Variable len is used like a local variable, but is missing a declaration.
var displayTuples = [];
if (bibtexField == "author") {
$(".bibtexentry span.author").each(function(i, obj) {
authors = $(this).children("span:not(.bibtex_js_conjunction)");

Check warning

Code scanning / CodeQL

Missing variable declaration

Variable authors is used like a local variable, but is missing a declaration.
if (bibtexField == "author") {
$(".bibtexentry span.author").each(function(i, obj) {
authors = $(this).children("span:not(.bibtex_js_conjunction)");
authorLength = authors.length;

Check warning

Code scanning / CodeQL

Missing variable declaration

Variable authorLength is used like a local variable, but is missing a declaration.
}
} else {
$(".bibtexentry span." + bibtexField).each(function(i, obj) {
arrayString = [$(this).text()];

Check warning

Code scanning / CodeQL

Missing variable declaration

Variable arrayString is used like a local variable, but is missing a declaration.
@alexfikl alexfikl force-pushed the papis-html-modernize branch from 5670bdd to 2194962 Compare July 22, 2023 17:12
@alexfikl
Copy link
Author

This is how the generated page looks now:

Screenshot_20230722_201520

Comment on lines 36 to 37
"papis", "html", "bibtex", "javascript"
"management", "cli", "biliography"

Check warning

Code scanning / CodeQL

Implicit string concatenation in a list

Implicit string concatenation. Maybe missing a comma?
@alexfikl
Copy link
Author

@alejandrogallo What do you think about updating this? It's very very simple compared to papis serve, but it's a nice example plugin if nothing else 😁

@alexfikl alexfikl force-pushed the papis-html-modernize branch 3 times, most recently from 2658c6d to 6622972 Compare May 2, 2025 09:08
@alexfikl alexfikl force-pushed the papis-html-modernize branch 3 times, most recently from 101c15e to 47f6734 Compare May 2, 2025 09:10
@alexfikl alexfikl force-pushed the papis-html-modernize branch from 47f6734 to 85e2560 Compare May 2, 2025 17:38
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant