-
Notifications
You must be signed in to change notification settings - Fork 25
Fixed the generation of the "prev" option in JSON generator #76
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
Conversation
Thanks for this Javier! I'm currently looking deeper into the toc tree handling in general - it was (I admit) once place I didn't give any serious attention to until now. |
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 can't see any case where having 'index' === $parentFile
would result into "prev" being null...
I've hijacked this PR! Description updated :) |
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.
Ryan, thanks for this great contribution!
I love how you fixed everything, while simplifying and improving everything at the same time. Stellar work! 🙇♂️
src/Generator/JsonGenerator.php
Outdated
'next' => $this->guessNext($parserFilename), | ||
'prev' => $this->guessPrev($parserFilename), | ||
'next' => $next, | ||
'prev' => $prev, | ||
'rellinks' => [ |
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.
This is the official Sphinx explanation of rellinks
: https://www.sphinx-doc.org/en/master/templating.html#rellinks
I'd leave this as it is because I think we don't use this option anywhere.
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.
As we already have changed the format of the file anyway, we could remove rellinks support as we don't use it anywhere AFAIK.
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 have removed it. If there is other information that would be useful, let me know and we an add it :)
|
||
CRUD stands for: "create, read, update, delete". | ||
|
||
Or it might be: "Crazy runner's utter delight" (which would |
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.
😂
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.
Some random comments
src/Generator/JsonGenerator.php
Outdated
'next' => $this->guessNext($parserFilename), | ||
'prev' => $this->guessPrev($parserFilename), | ||
'next' => $next, | ||
'prev' => $prev, | ||
'rellinks' => [ |
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.
As we already have changed the format of the file anyway, we could remove rellinks support as we don't use it anywhere AFAIK.
This was researched specifically using Sphinx behavior
Fixes #75.
Fixes #74
This fixed the problem for me ... but I don't know the internals well enough, so I don't know the full implications of this change. Thanks for reviewing this proposal!
UPDATE FROM @weaverryan
I hijacked this PR and completely revamped the next/prev/parents functionality. It's now based exactly on how Sphinx works and it "should" be working identically.