Git Product home page Git Product logo

Comments (4)

jdillard avatar jdillard commented on June 30, 2024

This is how jekyll does it: https://github.com/jekyll/jekyll-sitemap#lastmod-tag

from sphinx-sitemap.

mgeier avatar mgeier commented on June 30, 2024

I happen to have recently created a Sphinx extension that does basically just that: https://github.com/mgeier/sphinx-last-updated-by-git

It's somewhat similar to your own https://github.com/jdillard/sphinx-gitstamp.

Included files may have a later updated date than the parent page.

That's taken care of.

Files included for substitution purposes won't take into account if only a substitution on that page changed, making it hard to determine if the change date on the included files are accurate for that page.

I guess that's still a problem.

Another question is: what happens with auto-generated source files?

Note that index.html will only be updated when index.rst changes, not when any of the section titles happen to change. I'm not sure whether that's a problem.

For more caveats see the README.

from sphinx-sitemap.

jdillard avatar jdillard commented on June 30, 2024

I've been following along, nice work! I plan on incorporating the relevant bits into my extensions as a learning exercise (part of the reason I made these is to help me get better at Python).

I guess that's still a problem.

As a sub-point to the includes, I need to test if rst_prolog reacts differently, although I suspect it doesn't. This is how I typically include "global" substitution files:

rst_prolog = """
.. include:: /substitutions.rsti
"""

Another question is: what happens with auto-generated source files?

Note that index.html will only be updated when index.rst changes, not when any of the section titles happen to change. I'm not sure whether that's a problem.

That's a good point as well. While I understand the importance of the accuracy, I wonder if one could argue it is outside the scope of "git timestamps". Ideally, that type of change would be reflected though.

from sphinx-sitemap.

mgeier avatar mgeier commented on June 30, 2024

This is an interesting case!
I've just checked, and the included file (in your example substitutions.rsti) is listed as dependency for each page.

When you update your substitutions.rsti file, this will be reflected in the dates of each page (if you check for dependencies by default, as I do).

This is what you want, right?

There will always be cases where this is strictly speaking wrong (e.g. if you update your substitutions but a certain page doesn't actually use those changes), but Sphinx simply doesn't provide such fine-grained information about dependencies. But it's good to be aware of the behavior.

I wonder if one could argue it is outside the scope of "git timestamps". Ideally, that type of change would be reflected though.

For now I'm only interested in using the information about dependencies as provided by Sphinx and consider everything else out of scope.

Now that I think about it, one could probably use the source information stored in the "doctree" to have more fine-grained (and/or additional) information. But I'm not sure that would work at all, and I don't want to go down this path right now.

from sphinx-sitemap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.