ojacques / mkdocs-git-committers-plugin-2

MkDocs plugin for displaying a list of GitHub (.com or Enterprise) contributors on each page. Encourages contributions to the documentation!
MIT License
60 stars 21 forks source link

Missing dependency: `lxml` #32

Closed squidfunk closed 1 year ago

squidfunk commented 1 year ago

We just removed lxml from our requirements.txt, because we could refactor all uses to the native HTML parser, which makes download and installation of Material for MkDocs much faster. However, now our builds started failing because this plugin uses BeautifulSoup, which relies on the presence of a parser library.

Possible solution: adding lxml to the list of dependencies.

squidfunk commented 1 year ago

On a more general note, I would recommend not using parsers like BeautifulSoup when building plugins, because they parse the entirety of the content you feed them and construct a tree representation for simple querying. The worst case is that multiple plugins parse the same HTMl over and over again.

In Material for MkDocs, we're always trying to make parsing as efficient as possible:

See our readtime computation implementation with its parser for reference.

ojacques commented 1 year ago

Thanks @squidfunk - indeed, I will be looking at removing / simplifying dependencies. There is nothing that simple request could not handle.