Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include Titles in FileItems #88

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

bame-da
Copy link

@bame-da bame-da commented Jan 25, 2023

This fixes an issue where sphinx-autoupdate does not pick up changes to titles in the _toc.yaml file.

To reproduce, use the example project,

  1. build using sphinx-autobuild --port 8001 . _build/
  2. add a title attributes to one of the files, eg api.md
  3. change the title int he title attribute

You'll see that the change does not get picked up. The reason is that line 251 of api.py does an equality check on the items in the sitemap: prev_doc = previous[name].
Since the title is included in the Document class, the changes in 2. and 3. above trigger a rebuild of the api.md. But the ToC is injected into the intro.md file, which is unchanged both as a file and from the point of view of the get_changed function.

By including the titles on FileItems, such changes get picked up by get_changed and the ToC updates correctly.

@welcome
Copy link

welcome bot commented Jan 25, 2023

Thanks for submitting your first pull request! You are awesome! 🤗

If you haven't done so already, check out EBP's Code of Conduct and our Contributing Guide, as this will greatly help the review process.

Welcome to the EBP community! 🎉

@codecov
Copy link

codecov bot commented Jan 25, 2023

Codecov Report

Base: 91.06% // Head: 91.14% // Increases project coverage by +0.07% 🎉

Coverage data is based on head (176d6d4) compared to base (4e83bb6).
Patch coverage: 92.30% of modified lines in pull request are covered.

❗ Current head 176d6d4 differs from pull request most recent head 8a33082. Consider uploading reports for the commit 8a33082 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #88      +/-   ##
==========================================
+ Coverage   91.06%   91.14%   +0.07%     
==========================================
  Files           7        7              
  Lines         739      745       +6     
==========================================
+ Hits          673      679       +6     
  Misses         66       66              
Flag Coverage Δ
pytests 91.14% <92.30%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
sphinx_external_toc/parsing.py 92.17% <75.00%> (+0.04%) ⬆️
sphinx_external_toc/api.py 94.33% <100.00%> (+0.28%) ⬆️
sphinx_external_toc/events.py 90.41% <100.00%> (-0.06%) ⬇️
sphinx_external_toc/tools.py 90.24% <100.00%> (+0.05%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant