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

[Feature Request] Automatically fill in internal reference link text #2870

Closed
KurtPfeifle opened this issue Apr 22, 2016 · 1 comment
Closed

Comments

@KurtPfeifle
Copy link

Assume I have this in my Markdown:

# Excursion: What is this all about? {#excurs}

Currently I can refer to this from another spot in my text by writing.

You can read more about this problem in section *[What is this all about?](#excurs}*.

I would like to know if it could be made easier to write, so I do not have to remember the exact wording of that title when writing the text -- and more importantly, after editing the heading, to also update my references to this section.

Something similar to how it works with citations, bibliographies and --filter pandoc-citeproc, but very short to type. What if I just typed

You can read more about this problem in section *[](#excurs}*.

So if I do not fill in the [] brackets, Pandoc looks it up for me (it has to do that anyway, in order to create the link), and also fill bracket space with the original text of the heading as it currently stands? So Pandoc would just create the same output as if it had seen:

... section *[What is this all about?](#excurs}*.

Of course, if I typed...

You can read more about this problem *[another part of the book](#excurs}*.

...current behavior should remain unchanged.

Another, easy-to-use syntax for the same purpose would also be welcome.

I have not thought through this idea completely, so I'm not sure if it would break any existing functionality. And of course, I have no idea how much work such a feature would need.


(This is not urgent for me; I can work around this -- it's just not as comfortable.)

@jgm
Copy link
Owner

jgm commented Apr 22, 2016

I'm not sure whether this should be a standard part of
pandoc, but for now it would be fairly easy to write a
filter that accomplishes this.

@jgm jgm closed this as completed Dec 7, 2016
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

No branches or pull requests

2 participants