Guts / mkdocs-rss-plugin

MkDocs plugin to generate a RSS feeds for created and updated pages, using git log and YAML frontmatter (page.meta).
https://guts.github.io/mkdocs-rss-plugin/
MIT License
84 stars 27 forks source link

Incompatibility with submodules (using mkdocs-monorepo-plugin) #23

Open prcr opened 3 years ago

prcr commented 3 years ago

Hello,

I started using mkdocs-rss-plugin but noticed that at the moment it's not compatible with mkdocs-monorepo-plugin. When I run mkdocs build I get the following output letting me know that the plugin couldn't find the dates for files in the submodules (in this case, the ones inside submodules/chart/):

$ mkdocs build
INFO    -  Cleaning site directory 
INFO    -  Building documentation to directory: /home/paulo/docs/site 
WARNING -  Dates could not be retrieved for page: /home/paulo/docs/submodules/chart/docs/index.md.
WARNING -  Dates could not be retrieved for page: /home/paulo/docs/submodules/chart/docs/requirements.md.
WARNING -  Dates could not be retrieved for page: /home/paulo/docs/submodules/chart/docs/configuration/monitoring.md.
WARNING -  Dates could not be retrieved for page: /home/paulo/docs/submodules/chart/docs/configuration/integrations/bitbucket-cloud.md.
WARNING -  Dates could not be retrieved for page: /home/paulo/docs/submodules/chart/docs/configuration/integrations/bitbucket-server.md.
[...]

Since this plugin is based on the plugins by Tim Vink (which I'm also using), I checked how those plugins work and they determine the local Git repository for each file before using Git to obtain the metadata on the file, as seen here:

https://github.com/timvink/mkdocs-git-revision-date-localized-plugin/blob/d4303ad2efd4d4cda49116d8e8bdb0aa5012d4d3/mkdocs_git_revision_date_localized_plugin/util.py#L91

Would you be willing to implement the same mechanism on mkdocs-rss-plugin to make it compatible with submodules?

Guts commented 3 years ago

Right, I'll have a closer look and try to implement a similar mechanism.

prcr commented 3 years ago

Thank you!

I started thinking if in the future it would make sense to have a shared util.py module that would gather the functionality needed by all these MkDocs plugins that retrieve data from Git. Perhaps this could be easier to maintain going forwards. But I totally understand that for now, it's probably much simpler to just replicate the logic on your own plugin. :+1:

Guts commented 3 years ago

@timvink has already imagined this scenario for his plugins and I've proposed to integrate the RSS plugin along the others. See: https://github.com/timvink/mkdocs-git-authors-plugin/issues/16#issuecomment-655507835

timvink commented 3 years ago

Yup, common utils for accessing git for mkdocs files would be better. Very low on my priority list though and needs to be well designed.. feel free to pick it up!