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
61 stars 21 forks source link

Remove dependencies like BeautifulSoup #36

Closed ojacques closed 1 year ago

ojacques commented 1 year ago

From @squidfunk:

              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:

- Find relevant segments in the HTML with regular expressions
- Extract those segments and parse them as fragments by using a streaming parser

See our [readtime computation](https://github.com/squidfunk/mkdocs-material/blob/master/src/plugins/blog/readtime/__init__.py) implementation with its [parser](https://github.com/squidfunk/mkdocs-material/blob/master/src/plugins/blog/readtime/parser.py) for reference.

_Originally posted by @squidfunk in https://github.com/ojacques/mkdocs-git-committers-plugin-2/issues/32#issuecomment-1700948859_
ojacques commented 1 year ago

As committers is coming now to the free version, there is an higher urgency to address this.