-
Notifications
You must be signed in to change notification settings - Fork 13
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
ENH: tags stashed on env #89
Conversation
I agree, I don't think that's very important since Markdown already collapses consecutive spaces.
I know I've seen that before. It might be something along the lines of "something was interpreted as a Either way, not a very helpful error message. I'd rate it 2/10. |
Only in the test_badges |
I'm not sure what's happening. Locally, I am seeing the "any" error on the regular docs build, and the tags are collected but the links are not actually generated. I'll try debugging some more if I find the time today or tomorrow but I'm going to be out all next week on vacation. If you folks find a fix please just merge and move forward with it, the general idea is good on my side 😄 |
|
To make this even more confusing, the nodes are completely identical https://gist.github.com/story645/d6a4698ff8d743a937fc77716573a218/revisions?diff=split&w= on main and this branch |
And the difference in build is that on a working build, myst sees the files as changed
while for badges it's not updating the environment:
Basically, the env dictionary is only populated after |
and using arguments, which normalizes spaces
Ok, what fixed it was adding a second build in an isolated test (which I think test_general also doesn't work w/o the test_build test). Don't love this but am also so confused. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These look like some nice improvements. Thanks for putting this together and fighting through all those testing issues!
|
||
for path in doc_paths: | ||
entry = Entry(Path(app.srcdir) / path) | ||
for docname in app.env.found_docs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had no idea this was a thing! Good find. I was looking for something like that for #58 but somehow missed it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks! found it when trying to figure out the environment variable https://www.sphinx-doc.org/en/master/extdev/envapi.html
@story645 Okay, I think I see what's going on. Those errors ( rm -rf docs/{_tags,_build}
make -C docs html
ls docs/_tags At the point where we're checking One possible fix may be to connect |
I figured it'd be something like that, but I wasn't sure how to do it. |
Looks like I can't maybe get this working w/ |
So been trying stuff and nothings been working so I think these two PRs will need to be reverted until I can figure out what went wrong (cause I remember it working at some point 😓 ) |
I also looked into this a bit and haven't quite figured it out yet, but I do feel somewhat closer to understanding how the build events work. Honestly I wish Sphinx's docs on the topic were better! We probably wouldn't need to revert all of your changes, but maybe we could add the parsing back to the |
Either that or a non env global variable maybe? |
Another option is refactoring all the things into the kinds domain/index/directive model here https://www.sphinx-doc.org/en/master/development/tutorials/recipe.html b/c I think the objects are more or less aligned w/ that. |
The order of operations is still the tricky part there: we need
That looks promising! So would that look something like this?
|
Yeah, I tried using doctree-read and where it'd keep getting stuck was that index is looking for the tagindex page so I tried writing tagindex in parts (empty header than the rest) and it crashed but I'm realizing now I might be able to swing something with includes 🤔
I think so? or something like the Index holding the tags<->pages look up. Forgot the formal name, but it's a bidirectional graph of the form:
Where a 1 in the matrix means that that tag is on that page. |
Scratch, you were correct about two indices, with a mapping like: recipie->page |
Pulled out of #84 for easier review, this PR:
app.env.metadata[docname]['tags']
dictionary, which makes the list globalQuestions:
block_text
, my preference would be to just use the argument, but then it won't preserve the full white space -> is it very important thattag 4
get rendered astag 4
and nottag 4
-> this is now the 2nd commit for comparison