Skip to content

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

Merged
merged 8 commits into from
Mar 19, 2021

Conversation

javiereguiluz
Copy link
Collaborator

@javiereguiluz javiereguiluz commented Mar 17, 2021

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.

@weaverryan
Copy link
Contributor

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.

Copy link
Collaborator

@nikophil nikophil left a 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...

@weaverryan
Copy link
Contributor

weaverryan commented Mar 18, 2021

I've hijacked this PR! Description updated :)

Copy link
Collaborator Author

@javiereguiluz javiereguiluz left a 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! 🙇‍♂️

'next' => $this->guessNext($parserFilename),
'prev' => $this->guessPrev($parserFilename),
'next' => $next,
'prev' => $prev,
'rellinks' => [
Copy link
Collaborator Author

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.

Copy link
Contributor

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.

Copy link
Contributor

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
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😂

Copy link
Contributor

@fabpot fabpot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some random comments

'next' => $this->guessNext($parserFilename),
'prev' => $this->guessPrev($parserFilename),
'next' => $next,
'prev' => $prev,
'rellinks' => [
Copy link
Contributor

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.

@weaverryan weaverryan merged commit 2fa79f9 into symfony-tools:master Mar 19, 2021
@javiereguiluz javiereguiluz deleted the fix_75 branch March 19, 2021 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

The prev option in fjson files is always null The fjson file should keep the "parents" option
4 participants