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

New ToC and Footnotes data structures #5087

Closed
bep opened this issue Aug 16, 2018 · 6 comments
Closed

New ToC and Footnotes data structures #5087

bep opened this issue Aug 16, 2018 · 6 comments

Comments

@bep
Copy link
Member

bep commented Aug 16, 2018

Go 1.11 is right around the corner. With that comes Go modules, which should solve the versioning issues we currently have with an upgrade to Blackfriday v2. I have started some investigations in another project.

The goal of this first "sprint" is to

  1. Upgrade to BF2 in a way that makes it easy to plug in some hooks that we have described in other issues (URL rewriter etc.), allow for renderer per output format etc (HTML, LatEx ...).
  2. Add some proper data structures for table of contents and foot notes

This issue discusses 2) Above.

For ToC we currently have this HTML .TableOfContents blob. We cannot remove that over night so I suggest we add a new "container" in Page that contains Markdown-related metadata.

  • Name? .MD.TableOfContents?

That object will in the first go contain two data structures:

  • .TableOfContents
  • .Footnotes

For TableOfContents, I suggest a list of:

Title
Children
Parent

For Footnotes I suggest a list of:

ID
Link

Instead of Link maybe we should just reuse the term RelPermalink etc.

Note that the Footnotes list is meant to be used to render "somewhere else" in a template, so we also need a way to not render it in the main content.

@bep bep added the Proposal label Aug 16, 2018
@bep bep added this to the v0.48 milestone Aug 16, 2018
@rdwatters
Copy link
Contributor

Is it unrealistic to keep .TableOfContents with your default behavior above but instead add arguments for start/stop based on h element?

{{ .TableOfContents 2 3 }}

Or the same as your comment above by adding the .MD to my example?

@bep bep modified the milestones: v0.48, v0.49 Aug 28, 2018
@rdwatters
Copy link
Contributor

I know you mentioned in the forums you're already thinking of even cooler ways to implement this, but piggybacking on my comment above, the ability to set this globally would be pretty slick too. Something to the effect of tocHeadingLevels (name could be much more clever, clearer). The idea being that a global config change affects all previously used instances of .TableOfContents. Just a thought....

@bep bep modified the milestones: v0.49, v0.50 Sep 24, 2018
@bep bep modified the milestones: v0.50, v0.51 Oct 6, 2018
@bep bep modified the milestones: v0.51, v0.53 Nov 8, 2018
@bep bep modified the milestones: v0.53, v0.54 Dec 6, 2018
@bep bep modified the milestones: v0.54, v0.55 Dec 26, 2018
@bep bep modified the milestones: v0.55, v0.56 Feb 1, 2019
@stale
Copy link

stale bot commented Jun 1, 2019

This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

@stale stale bot added the Stale label Jun 1, 2019
@bep bep added the Keep label Jun 1, 2019
@stale stale bot removed the Stale label Jun 1, 2019
@bep bep modified the milestones: v0.56, v0.57 Jun 14, 2019
@bep bep modified the milestones: v0.57, v0.58 Jul 31, 2019
@bep bep modified the milestones: v0.58, v0.59 Aug 13, 2019
@bep bep modified the milestones: v0.59, v0.60 Sep 6, 2019
@bep bep modified the milestones: v0.111.0, v0.112.0 Feb 15, 2023
@bep bep modified the milestones: v0.112.0, v0.113.0 Apr 15, 2023
@bep bep modified the milestones: v0.113.0, v0.114.0, v0.115.0 Jun 8, 2023
@bep bep modified the milestones: v0.115.0, v0.116.0 Jun 30, 2023
@bep bep modified the milestones: v0.116.0, v0.117.0 Aug 1, 2023
@bep bep modified the milestones: v0.117.0, v0.118.0 Aug 30, 2023
@bep bep modified the milestones: v0.118.0, v0.119.0 Sep 15, 2023
@bep bep modified the milestones: v0.119.0, v0.120.0 Oct 4, 2023
@bep bep modified the milestones: v0.120.0, v0.121.0 Oct 31, 2023
@bep bep modified the milestones: v0.121.0, v0.122.0 Dec 6, 2023
@bep bep modified the milestones: v0.122.0, v0.123.0, v0.124.0 Jan 27, 2024
@bep bep closed this as completed Jan 31, 2024
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants