mkdocs-rss-plugin icon indicating copy to clipboard operation
mkdocs-rss-plugin copied to clipboard

Incompatibility with submodules (using mkdocs-monorepo-plugin)

Open prcr opened this issue 5 years ago • 4 comments

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?

prcr avatar Nov 14 '20 17:11 prcr

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

Guts avatar Nov 15 '20 10:11 Guts

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:

prcr avatar Nov 15 '20 19:11 prcr

@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

Guts avatar Nov 16 '20 05:11 Guts

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!

timvink avatar Jan 26 '21 09:01 timvink