Comments (5)
Thanks @pawamoy for the explanation. Unfortunately, i'm already maintaining this plugin on fumes, so I don't have the time to make a markdown extension. Happy to deprecate this if someone does and it works as an effective replacement.
from mkdocs-bibtex.
There possibly is another way: if you look at this comment, you'll see that there's a way to allow the mkdocs-macros-plugin to work on docstrings. There might be similar hacks possible for other plugins 😄
from mkdocs-bibtex.
mkdocstrings maintainer here 👋
The short explanation is that MkDocs plugins never get to see (and work on) docstrings. Everything happens in the Markdown to HTML process. Plugins that define the on_page_markdown
only get to see the mkdocstrings instructions (::: stuff
).
To make this work, one solution, if feasible, is to rewrite the plugin as a Markdown extension. mkdocstrings reuses all configured Markdown extensions when converting docstrings.
from mkdocs-bibtex.
Thanks for the explanation, good to know!
from mkdocs-bibtex.
Here is indeed a use case similar to the question asked about the Mkdocs-Macros plugin (I am the author of that plugin).
Perhaps it's best that I quote directly @pawamoy's relevant passage about this in mkdocstrings/mkdocstrings#615:
This has been discussed several times already (...): it's not possible without hacks. mkdocs-macros and mkdocstrings work at different levels: mkdocs-macros at the plugin level (in something like the on_page_markdown hook) while mkdocstrings renders docstrings at the Markdown conversion level, so in-between on_page_markdown and on_page_content. That means mkdocs-macros never sees the docstrings.
This explains accurately the phenomenon that happens to mkdocs-bibtex. Adapting snippet to your needs should do it.
If my understanding is correct you might have to refactor your on_page_markdown()
method, so as to put together the 5 calls in a separate render()
method, which you could then reference?
mkdocs-bibtex/src/mkdocs_bibtex/plugin.py
Lines 121 to 177 in 728a65a
from mkdocs-bibtex.
Related Issues (20)
- Error occurs when "journal" is empty HOT 7
- Extra regex artefact in formatted output HOT 2
- Several issues with Citavi HOT 3
- Missing dependency `pkg_resources` HOT 8
- mkdocs-bibtex does not render citations where a period (.) exists in the key HOT 2
- Add an option for loading an api key HOT 4
- bug: refactor tests
- Default footnotes ignore/overwrite existing footnotes HOT 3
- bug: brittle tests due to Pandoc
- bug: Not compliant with full list of characters allowed in cite key
- Feature: adding a recursive option to fetch `.bib` files ? HOT 2
- Possibility to add render all references in bib file in first page HOT 6
- UTF-8 Encoding errors with pandoc due to temporary files being written in ASCII encoding
- Adding some logging for better debugging
- Possibility to insert a bibliography item inline, with footnote reference disabled (=manual bibliography with generated style) HOT 1
- `pybtex` fails on Python 3.12 HOT 1
- Citing @software entry with mkdocs ? HOT 1
- Escape problem with python 3.10 and material theme (insiders version) HOT 2
- Make the logging less verbose
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mkdocs-bibtex.