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

Relative sections #75

Closed
wants to merge 7 commits into from
Closed

Conversation

NQNStudios
Copy link
Collaborator

@NQNStudios NQNStudios commented Jan 4, 2018

Redux of PR #50.

Changes proposed by this pull request:

  • A new class of link can be generated with data-goto-relative-section set to either "up" or "down"
  • Links like these are created by making a section link with the destination {@^up} or {@^down}
  • A new example is written to demonstrate the usefulness of this.

Along the way I uncovered some other pre-existing bugs which I'll also be writing up.

@invicticide to review

@NQNStudios
Copy link
Collaborator Author

I've realized a major flaw in the way I've implemented this: relative section is meant to always refer to what is relative to the original section's position in Markdown files. With sections sometimes being embedded in other sections in Fractive, there's no easy way to figure out the original section's position in Markdown if it's embedded in another one. It would probably be better to handle all relative section macros by replacing them at compile-time with the name of the proper section, so that at runtime it still refers to the expected section no matter what. Also, it would be useful to be able to reference relative sections in simple macros that aren't links, which I haven't implemented here. Lots to think about, but probably this isn't the PR we're looking for.

@NQNStudios NQNStudios closed this Feb 14, 2018
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