Skip to content

feat: add global bibliography support to pandoc-reader plugin#44

Open
filipaldi wants to merge 2 commits intopelican-plugins:mainfrom
filipaldi:main
Open

feat: add global bibliography support to pandoc-reader plugin#44
filipaldi wants to merge 2 commits intopelican-plugins:mainfrom
filipaldi:main

Conversation

@filipaldi
Copy link

  • Add support for global bibliography files with configurable names
  • Maintain backward compatibility with individual bibliography files
  • Add PANDOC_GLOBAL_BIB_FILES setting
  • Add comprehensive tests for all scenarios
  • Update documentation and provide example configuration
  • Add .venv and pycache to .gitignore

@nandac
Copy link
Collaborator

nandac commented Jul 8, 2025

@filipaldi Thank you for your pull request. I will need to set aside some time to review it.

From what I understand, the feature allows you to add a common bibliography to all your blogs or posts, which is a useful feature to have. However, how would you switch the feature off for specific blogs or posts where you do not want to add the common bibliography?

Copy link
Contributor

@justinmayer justinmayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the submission, @filipaldi. In addition to what @nandac said, I made a comment requesting that the .gitignore additions be removed. Also, CI is reporting test/linter failures, but that appears to be due to outdated GitHub Actions that I have since updated via ddfb7e8. If you rebase your branch on current main, those CI-related issues should hopefully be resolved.

.gitignore Outdated
*.pyc
*.pyo
*.pyd
.Python
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert these .gitignore changes, for two reasons.

(1) These changes are not directly related to the feature being proposed, and thus in general such changes should be submitted in separate pull requests.

(2) The entries in this project’s .gitignore file should remain specific to this project, whereas entries that apply to general Python development (such as the entries added here), should be placed in your global ignore file on your local workstation. (So therefore what I said in (1) above notwithstanding, in this case please do not submit these changes in a separate pull request.)

@filipaldi
Copy link
Author

filipaldi commented Jul 8, 2025 via email

@nandac
Copy link
Collaborator

nandac commented Jul 8, 2025

@filipaldi kindly rebase your branch and make the changes requested by @justinmayer. We will then discuss any changes or improvements before we merge this feature in.

- Add support for global bibliography files with configurable names
- Maintain backward compatibility with individual bibliography files
- Add PANDOC_GLOBAL_BIB_FILES setting
- Add comprehensive tests for all scenarios
- Update documentation and provide example configuration
@justinmayer
Copy link
Contributor

@filipaldi: It seems the code style linters did not pass in CI. Have you followed the Plugin Development Docs to ensure that the linters pass locally?

@nandac
Copy link
Collaborator

nandac commented Jul 9, 2025

@filipaldi, I have added some preliminary review comments. Kindly also fix the linting issues when you get a chance.

I like the addition of the pelicanconf_example.py file, but as it does not apply directly to the plugin, I am not sure if this is exactly the right place for it.

@nandac nandac self-requested a review July 10, 2025 07:09
* `bibliography.bib`, `bibliography.json`, `bibliography.yaml`, `bibliography.bibtex`
* `references.bib`, `references.json`, `references.yaml`, `references.bibtex`

To customize the global bibliography file names, set the `PANDOC_GLOBAL_BIB_FILES` setting in your Pelican settings file:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer that this variable be named PANDOC_GLOBAL_BIBLIOGRAPHIES

To customize the global bibliography file names, set the `PANDOC_GLOBAL_BIB_FILES` setting in your Pelican settings file:

```python
PANDOC_GLOBAL_BIB_FILES = ["my_bib", "global_refs", "shared_bibliography"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please format this like this so that it follows the standard used in the rest of the README:

PANDOC_GLOBAL_BIBLIOGRAPHIES = [
    "my_bib",
    "global_refs",
    "shared_bibliography"
]

bib_name = ".".join([filename, extension])
if bib_name in files:
bib_files.append(os.path.join(root, bib_name))
for global_name in global_bib_names:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am confused with this code. Could you tell me what the path to the default bibliographies is?

A centralized path for all default bibliographies would make more sense to me.

author = {Charlie Wood},
date = {2019-07-11},
urldate = {2020-11-12}
} No newline at end of file
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the new line.

author = {Rafael Alves Batista and Joel Primack},
date = {circa 2017},
urldate = {2020-11-12}
} No newline at end of file
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the new line.

author = {Andrew Zimmerman Jones},
date = {2019-03-02},
urldate = {2020-11-12}
} No newline at end of file
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the new line.

author = {Davide Castelvecchi},
date = {2016-01-05},
urldate = {2020-11-12}
} No newline at end of file
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the new line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants