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

Auto generate page with a links, similar to table of contents #3308

Open
IslandRhythms opened this issue Feb 19, 2024 · 2 comments
Open

Auto generate page with a links, similar to table of contents #3308

IslandRhythms opened this issue Feb 19, 2024 · 2 comments
Labels
New Snippet Proposed new snippet, for any theme

Comments

@IslandRhythms
Copy link

Your idea:

Currently, If you link anything in homebrewery using markdown the link is masked by the text in the []. My request is that similar to the table of contents that auto generates links to all the headers, this feature would auto generate a page that contains the raw links so that if a user was to print out their doc, they would not lose access to the links. Either a generated page at the end of the document or perhaps an annotated footer with links would suffice.

@5e-Cleric
Copy link
Member

I don't know about processing it, but we could add a snippet that looked through all the code, got the links, then output them and their page of reference plus their name, so the output was something like this:

- page 4:
    - link name: url
    - link name: url

it will need some work, but we can make that work.

This is, until we get brew to pdf to work with links, if we can.

@ericscheid
Copy link
Collaborator

Consider also the reflink system, which is almost built for this purpose (coming at it from the other direction)

Visit [[The Homebrewery] to make your own brews.

\page
## Links in this Brew:
[The Homebrewery]: https://homebrewery.naturalcrit.com

Immediate problem is that Marked does not render the reflink definition as html (only uses of the reflink). We could change that to render an element with an extra class on it, a class we use to hide it by default.

Second problem is that this only works where it is used — that is, an author must use a reflink if they want that link to appear in this way. This might be too tedious.

Third problem is that this doesn't work if the author wants multiple links with the same text but different hrefs (e.g. "click here" [a bad eample]).


So .. a snippet that inserts calculated text would be better.

The snippet code should

  • also be aware of reflinks and their usage
  • avoid duplicate/redundant entries (especially on same page)
  • not list interpage links (e.g. [Click Here](#thing))
  • not list links to pages (e.g. [thing](#p2)) (?)
  • not list the links in the TOC (of course)
  • not list the links in the link index (of course)

@5e-Cleric 5e-Cleric added the New Snippet Proposed new snippet, for any theme label Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New Snippet Proposed new snippet, for any theme
Projects
None yet
Development

No branches or pull requests

3 participants