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

Show anchor links for each heading #433

Merged
merged 1 commit into from
Sep 28, 2018
Merged

Conversation

jamos-tay
Copy link
Contributor

@jamos-tay jamos-tay commented Sep 18, 2018

What is the purpose of this pull request? (put "X" next to an item, remove the rest)

• [X] New feature

Fixes #426

What is the rationale for this request?

Users may want to share a link to a specific heading with others.

What changes did you make? (Give an overview)

Allow users to automatically generate anchor links for each heading that direct the URL to that heading.

Provide some example code that this change will affect:

Users must include an anchors property in the frontmatter:

anchors: true

Functions similar to https://developers.timekit.io/v2/reference#section-root-endpoint-versions-and-protocol

  • Hovering over a header shows an anchor icon
  • Clicking on the icon links the URL to the header

out2

Is there anything you'd like reviewers to focus on?

Should we make the behavior different from the example site (e.g. change the icon)?

@jamos-tay jamos-tay changed the title [WIP] Show anchor links for each heading Show anchor links for each heading Sep 18, 2018
@yamgent
Copy link
Member

yamgent commented Sep 20, 2018

Users must include an anchors property in the frontmatter:

anchors: true

This seems kind of troublesome if there's a lot of such pages (if not all) in the website though (slightly similar to #389).

Was wondering whether we should add a default option in site.json, and explore a way to specify it for multiple pages at once...

@yamgent
Copy link
Member

yamgent commented Sep 20, 2018

Should we make the behavior different from the example site (e.g. change the icon)?

Design in the example gif looks fine actually. 👍

@damithc
Copy link
Contributor

damithc commented Sep 20, 2018

This seems kind of troublesome if there's a lot of such pages (if not all) in the website though (slightly similar to #389).

Maybe no need for this to be configurable? i.e., we do it by default for all headings

@yamgent
Copy link
Member

yamgent commented Sep 20, 2018

i.e., we do it by default for all headings

That sounds good too.

@jamos-tay
Copy link
Contributor Author

jamos-tay commented Sep 22, 2018

Updated to solve merge conflict and automatically add anchors

Copy link
Member

@yamgent yamgent left a comment

Choose a reason for hiding this comment

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

Tested the feature, works fine 👍.

asset/js/setup.js Show resolved Hide resolved
docs/userGuide/contentAuthoring.md Outdated Show resolved Hide resolved
docs/userGuide/contentAuthoring.md Outdated Show resolved Hide resolved
docs/userGuide/contentAuthoring.md Outdated Show resolved Hide resolved
docs/userGuide/contentAuthoring.md Outdated Show resolved Hide resolved
@jamos-tay
Copy link
Contributor Author

Updated

Copy link
Member

@yamgent yamgent left a comment

Choose a reason for hiding this comment

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

One minor nit

docs/userGuide/contentAuthoring.md Outdated Show resolved Hide resolved
@yamgent yamgent added this to the v1.12.1 milestone Sep 28, 2018
@yamgent yamgent merged commit e23d8c8 into MarkBind:master Sep 28, 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.

Show anchor links for each heading
4 participants