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

Expand Section Links documentation and add a section for Custom Anchors #33531

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

dodexahedron
Copy link

@dodexahedron dodexahedron commented Jun 17, 2024

Why:

The information on section links and how they work doesn't really explain how to use them or how they are made.

Also, custom anchors can be used (and are, in fact, quite common in a lot of Microsoft Learn documents, for precedent), so I added a section for them, as well, in a separate commit.

Closes: #33530

What's being changed (if available, include any code snippets, screenshots, or gifs):

As described in #33530, I have expanded and enhanced the Section links reusable, detailing behavior and usage, as well as added a small section detailing behavior and usage of custom anchor tags.

Check off the following:

  • I have reviewed my changes in staging, available via the View deployment link in this PR's timeline (this link will be available after opening the PR).

    • For content changes, you will also see an automatically generated comment with links directly to pages you've modified. The comment won't appear if your PR only edits files in the data directory.
  • For content changes, I have completed the self-review checklist.

Copy link

welcome bot commented Jun 17, 2024

Thanks for opening this pull request! A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the contributing guidelines.

Copy link
Contributor

github-actions bot commented Jun 17, 2024

Automatically generated comment ℹ️

This comment is automatically generated and will be overwritten every time changes are committed to this branch.

The table contains an overview of files in the content directory that have been changed in this pull request. It's provided to make it easy to review your changes on the staging site. Please note that changes to the data directory will not show up in this table.


Content directory changes

You may find it useful to copy this table into the pull request summary. There you can edit it to share links to important articles or changes and to give a high-level overview of how the changes in your pull request support the overall goals of the pull request.

Source Preview Production What Changed
get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax.md fpt
ghec
ghes@ 3.13 3.12 3.11 3.10 3.9
fpt
ghec
ghes@ 3.13 3.12 3.11 3.10 3.9
repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-readmes.md fpt
ghec
ghes@ 3.13 3.12 3.11 3.10 3.9
fpt
ghec
ghes@ 3.13 3.12 3.11 3.10 3.9
from reusable

fpt: Free, Pro, Team
ghec: GitHub Enterprise Cloud
ghes: GitHub Enterprise Server

@dodexahedron
Copy link
Author

Re-based on master.

If checks pass and it looks good to me in the preview environment, I'll be ready to submit this for review.

@dodexahedron
Copy link
Author

Re-pushed from my local environment to sign the commits.

@dodexahedron dodexahedron force-pushed the dodexahedron-section-links-and-custom-links-expansion branch from ff2e392 to 04a9003 Compare June 17, 2024 08:22
@dodexahedron
Copy link
Author

Once more, with feeling...

@dodexahedron dodexahedron marked this pull request as ready for review June 17, 2024 08:34
@dodexahedron
Copy link
Author

Those linter errors for broken links don't have anything to do with my changes, as they're in completely unrelated files. Linter does not throw any errors when run locally as npm run lint-content -- --paths .\content\get-started\writing-on-github\getting-started-with-writing-and-formatting-on-github\basic-writing-and-formatting-syntax.md

Here are the previews for the modified and added documentation:

https://docs-33531-114a4a.preview.ghdocs.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#section-links

https://docs-33531-114a4a.preview.ghdocs.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#custom-anchors

This is ready for review.

@dodexahedron
Copy link
Author

Hm. I should probably make the section link I added to the #headings section a relative link rather than just an anchor target.

Stand by...

@dodexahedron dodexahedron force-pushed the dodexahedron-section-links-and-custom-links-expansion branch from 04a9003 to 49d4159 Compare June 17, 2024 08:54
@dodexahedron
Copy link
Author

Links are now relative.

Let's see how this goes...

@dodexahedron
Copy link
Author

Bah. Checks pass, but I accidentally mixed up a link.

Correction coming up.

@dodexahedron
Copy link
Author

Change made and it now looks and behaves as intended.

I also made the following comment in the associated issue, #33530, but I'll paste/quote it here, as well, for visibility:

#33530 (comment)

One thought I had, while going through the style guide, is that the links section, both before these changes, but now especially after them, would match the style guide better if there were a section ToC, as well as if h3 an h4 headers were used. I opted not to implement that guideline, however, as the rest of the containing document does not follow that guideline, either, so it seemed better to conform to the document's de facto style, instead.

@nguyenalex836 nguyenalex836 added content This issue or pull request belongs to the Docs Content team waiting for review Issue/PR is waiting for a writer's review get started Content related to "Getting Started" doc set and removed triage Do not begin working on this issue until triaged by the team labels Jun 18, 2024
@nguyenalex836
Copy link
Contributor

@dodexahedron Thanks so much for opening a PR! I'll get this triaged for review ✨

@dodexahedron
Copy link
Author

My pleasure.

Any requests/thoughts/ideas/rude commentary, just let me know!

Copy link
Contributor

@felicitymay felicitymay left a comment

Choose a reason for hiding this comment

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

Hi @dodexahedron - I want to start by thanking you for your patience. It seems as if your PR must have slipped through the cracks 🙈

I also want to let you know how much we appreciate the thought you put into following our style, creating a reusable, and matching the existing content 💖

This is a useful addition to the articles with some great examples. Thank you 🚀

I've added quite a few comments which I'll leave for a few days in case you're interested to see why I'm suggesting changes. Then I'll commit those changes, check that the preview still looks okay and merge your pull request.

I hope that the delay in getting a review for this work doesn't put you off contributing in the future.

@@ -0,0 +1,25 @@
Use HTML anchor tags (`<a id="unique-anchor-name"></a>`) to create navigation anchor points to any place in the document.
Copy link
Contributor

@felicitymay felicitymay Aug 15, 2024

Choose a reason for hiding this comment

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

I'm going to suggest a few small changes here to align better with the other sections:

Suggested change
Use HTML anchor tags (`<a id="unique-anchor-name"></a>`) to create navigation anchor points to any place in the document.
You can use standard HTML anchor tags (`<a name="unique-anchor-name"></a>`) to create navigation anchor points for any location in the document.

> [!NOTE]
> Custom anchors will not be included in the document outline/Table of Contents.
Link to custom anchors by using the `id` given to the anchor.
Copy link
Contributor

@felicitymay felicitymay Aug 15, 2024

Choose a reason for hiding this comment

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

Suggested change
Link to custom anchors by using the `id` given to the anchor.
You can link to a custom anchor with the name, `name`, you gave the anchor. The syntax is exactly the same as when you link to an anchor that is automatically generated for a heading.

@@ -1,3 +1,58 @@
You can link directly to a section in a rendered file by hovering over the section heading to expose {% octicon "link" aria-label="the link" %}.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
You can link directly to a section in a rendered file by hovering over the section heading to expose {% octicon "link" aria-label="the link" %}.
You can link directly to any section that has a heading. To view the automatically generated anchor in a rendered file, hover over the section heading to expose the {% octicon "link" aria-label="the link" %} icon then click the icon to display the anchor in your browser.

@@ -1,3 +1,58 @@
You can link directly to a section in a rendered file by hovering over the section heading to expose {% octicon "link" aria-label="the link" %}.

![Screenshot of a README for a repository. To the left of a section heading, a link icon is outlined in dark orange.](/assets/images/help/repository/readme-links.png)

[Headings](/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#headings) automatically create anchors which have default names created from the text of the heading, with the following rules:
Copy link
Contributor

Choose a reason for hiding this comment

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

Having read the sentence before this line, I think we need to explain about automatically generated anchors earlier.

Suggested change
[Headings](/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#headings) automatically create anchors which have default names created from the text of the heading, with the following rules:
If you need to determine the anchor for a heading in a file you are editing, you can use the following rules:

Comment on lines +7 to +8
* Generated identifiers are UTF-8 URI fragments.
* See [RFC 3986: Uniform Resource Identifier (URI): Generic Syntax, Section 3.5](https://www.rfc-editor.org/rfc/rfc3986#section-3.5).
Copy link
Contributor

Choose a reason for hiding this comment

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

🤔 I'm curious about what additional information this reference adds for users. Unless you have a good reason for including it, I'd be inclined to delete these two lines.

Comment on lines +16 to +17
* Percent Encoding is not performed.
* See [RFC 3986: Uniform Resource Identifier (URI): Generic Syntax, Section 2.1](https://www.rfc-editor.org/rfc/rfc3986#section-2.1) for the definition of Percent Encoding.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can omit these bullets because you've already explained how we process characters that would otherwise need to be encoded this way.

Suggested change
* Percent Encoding is not performed.
* See [RFC 3986: Uniform Resource Identifier (URI): Generic Syntax, Section 2.1](https://www.rfc-editor.org/rfc/rfc3986#section-2.1) for the definition of Percent Encoding.

Copy link
Contributor

Choose a reason for hiding this comment

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

Better to omit as it's not always the case. In wiki the links do not strip any nonASCII chars, but rather do "HTML-safe" i.e. url encode all chars outside of the lower ASCII, both "á" and "ř" get escaped as a multibyte 🤷

* Other multi-byte UTF-8 characters which are valid in URI fragments are not modified.
* Percent Encoding is not performed.
* See [RFC 3986: Uniform Resource Identifier (URI): Generic Syntax, Section 2.1](https://www.rfc-editor.org/rfc/rfc3986#section-2.1) for the definition of Percent Encoding.
* If more than one heading has content which would result in identical output by these rules, unique names for instances after the first identical name are generated by appending a hyphen and an auto-incrementing integer in the order they appear in the rendered document.
Copy link
Contributor

Choose a reason for hiding this comment

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

Room for simplification here:

Suggested change
* If more than one heading has content which would result in identical output by these rules, unique names for instances after the first identical name are generated by appending a hyphen and an auto-incrementing integer in the order they appear in the rendered document.
* If the automatically generated anchor for a heading is identical to an earlier anchor in the same document, a unique identifier is generated by appending a hyphen and an auto-incrementing integer.

* Percent Encoding is not performed.
* See [RFC 3986: Uniform Resource Identifier (URI): Generic Syntax, Section 2.1](https://www.rfc-editor.org/rfc/rfc3986#section-2.1) for the definition of Percent Encoding.
* If more than one heading has content which would result in identical output by these rules, unique names for instances after the first identical name are generated by appending a hyphen and an auto-incrementing integer in the order they appear in the rendered document.

Copy link
Contributor

Choose a reason for hiding this comment

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

Adding a note based on the caution below:

Suggested change
> [!NOTE]
> If you edit a heading, or if you change the order of headings with "identical" anchors, you will also need to update any links to those headings as the anchors will change.

* See [RFC 3986: Uniform Resource Identifier (URI): Generic Syntax, Section 2.1](https://www.rfc-editor.org/rfc/rfc3986#section-2.1) for the definition of Percent Encoding.
* If more than one heading has content which would result in identical output by these rules, unique names for instances after the first identical name are generated by appending a hyphen and an auto-incrementing integer in the order they appear in the rendered document.

**Examples**
Copy link
Contributor

Choose a reason for hiding this comment

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

For accessibility reasons, we don't use bold in this way. It also seems as if we don't tend to use the text "Examples" in this document, so I suggest we delete this line.

Suggested change
**Examples**

Comment on lines +55 to +58

> [!CAUTION]
> Changing the order of sections having headings with the same name will cause their generated identifiers to change, as well, resulting in links to those sections no longer pointing to the same locations they previously pointed to.\
> Use [Custom anchors](/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#custom-anchors) to create anchors that will not be automatically changed.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a great point and well worth making.

However, it doesn't qualify as a caution in the user docs because the content includes descriptions of how to delete repositories and cause major problems in an enterprise server version. We keep caution for actions that have permanent implications (see Caution).

I think it would be more helpful to users to add a note earlier in this section about the need for care when linking to autogenerated anchors, so I've added a suggestion there in place of this.

Suggested change
> [!CAUTION]
> Changing the order of sections having headings with the same name will cause their generated identifiers to change, as well, resulting in links to those sections no longer pointing to the same locations they previously pointed to.\
> Use [Custom anchors](/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#custom-anchors) to create anchors that will not be automatically changed.

Copy link
Contributor

@janbrasna janbrasna left a comment

Choose a reason for hiding this comment

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

I see the reusable doesn't get added to all the places the neighboring content is used (Q: couldn't this content be covered in one of the existing reusables/chapters where it contextually belongs perhaps?), and more importantly I'm not really sure id is the best attribute for this — that along with classes gets sanitized in many places, so this being a general markdown reference for all the places that accept markdown input I'd say name is a more bulletproof anchor target for this.

Comment on lines 139 to +145

{% data reusables.repositories.relative-links %}

## Custom anchors

{% data reusables.repositories.custom-anchors %}

Copy link
Contributor

Choose a reason for hiding this comment

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

  • does only one use/occurrence warrant a reusable?
  • adding that info to any of the previous reusables contextually might actually be better, so it gets added to the about-readme docs and other occurrences of the neighboring content too?
  • or if separate, perhaps add the same chapter with reusable to other place that include the two other reusables, like about-readmes…?

Copy link
Author

Choose a reason for hiding this comment

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

I would say no. However, that's how all of those sections seem to be formed, so I was just following suit. 🤷‍♂️

Copy link
Contributor

Choose a reason for hiding this comment

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

Q: does it need a separate section, or having that contextually appended to some of the existing content would provide more utility and be included with such reusable to all the places they're being currently included?

Copy link
Contributor

@felicitymay felicitymay Aug 22, 2024

Choose a reason for hiding this comment

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

Thanks for the discussion @janbrasna 👋🏻

does only one use/occurrence warrant a reusable?

Good point. We usually add a reusable file only if we want to use one or more sentences in more than one location.

I think that this content only needs to be included in the Basic writing and formatting syntax article because it's not something that most people will want to do.

So it would be worth moving the content directly into this article and deleting the reusable.

Comment on lines +1 to +4
Use HTML anchor tags (`<a id="unique-anchor-name"></a>`) to create navigation anchor points to any place in the document.

> [!NOTE]
> Custom anchors will not be included in the document outline/Table of Contents.
Copy link
Contributor

Choose a reason for hiding this comment

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

the syntax here is more of a general info ("writing on github", i.e. anywhere markdown is supported…), so implying a "document" when that might be post/comment/review is not completely correct. (the reusable gets included in several places/contexts…)

basically headings won't create anchors in comments, while custom named anchors are preserved so can be used as anchors, say even inside collapsed details elements in PR/review etc.

Copy link
Author

Choose a reason for hiding this comment

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

Hm, that's a good catch.

Do you have any thoughts on better wording? I felt the note was important in case people expected the same behavior as octothorpes, but I'm certainly not married to the verbiage.

As a bit of context, one of the things that led me to write this section in the first place is that there are quite a few docs on MS Learn that use anchor tags. I was about to fix some inconsistencies in a couple docs, but it turned into a rabbit hole of following a bunch of anchors and a fair amount of duplicated text.

The place I ultimately landed my focus was on the anchors, partially as something I wanted to both verify and ensure consistency of, since I wanted to fully understand how they were being interpreted and mangled, before getting into the rest of it all. But it wasn't mentioned, so I figured I'd experiment and then document for posterity. 😅

Copy link
Contributor

Choose a reason for hiding this comment

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

if you e.g. demonstrate the difference between heading links that are not created inside comments, whereas custom anchors are, it'll give you the path to also mention autogenerated ToC for documents won't include them (but in context demonstrating the anchor use is not restricted to just documents but any input that accepts md on the site…)

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for opening this discussion, that's a great point that I overlooked.

We could revise this note to be more general - something like:

Any HTML you include in markdown content is rendered directly. If you include custom anchors for headings in a markdown file, the anchors are not recognized as headings by the markdown processor.

> [!NOTE]
> Custom anchors will not be included in the document outline/Table of Contents.
Link to custom anchors by using the `id` given to the anchor.
Copy link
Contributor

Choose a reason for hiding this comment

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

that might get filtered in situations where classes and ids are stripped, but ‹a name="foo"> will still work — not sure whether that's more official, but is definitely preferred, and even the own docs guides use name in examples: https://docs.github.com/en/contributing/style-guide-and-content-model/style-guide#adding-anchors-to-preserve-links

Copy link
Contributor

Choose a reason for hiding this comment

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

(IIRC id gets stripped in wikis, so ‹a› name is a must there.)

Copy link
Contributor

Choose a reason for hiding this comment

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

or in some contexts there's id="user-content-foo" prepended to it so it's hard to explain beforehand what the value in given md context would be …

Copy link
Author

Choose a reason for hiding this comment

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

that might get filtered in situations where classes and ids are stripped, but ‹a name="foo"> will still work — not sure whether that's more official, but is definitely preferred, and even the own docs guides use name in examples: https://docs.github.com/en/contributing/style-guide-and-content-model/style-guide#adding-anchors-to-preserve-links

I did quite a bit of testing to ensure I was documenting actual behavior. The way I wrote it, at least at the time, was what my of course non-exhaustive testing revealed.

Being an undocumented "feature," that's all that was really available for me to do, without being familiar with the pipeline that produces the final rendered content.

My thinking was that, in the course of this PR, a formal behavior could be either gleaned from the source or defined here, to be formally implemented however it is settled upon. Since it's all over the place in other ms learn documents, it seems only fair for it to be documented. 🙂

Copy link
Author

Choose a reason for hiding this comment

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

Adding to that thought, I do kinda think a formal spec for the feature and perhaps even exposure of it in the slash menu or something for didcoverability is warranted.

Otherwise, it's effectively an unsafe-for-public-consumption internal abuse of the markup that IMO shouldn't be used in public open source documents at all. Lead by example and all that. 😅

Copy link
Contributor

Choose a reason for hiding this comment

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

There are many systems using many renders and formatting libraries used around the site, so there's no formal spec how that behaves once you start going too much into detail (as every place has its own implementation specifics…) — so it's better to be safe and a bit vague;)

(The "id" behav has changed over the past decade, whereas "name" stays consistent, and is used in style guide docs as an example, that's why I'm offering it as a more stable alternative; also not interfering with the rest of the page if one's not too careful…)

Copy link
Contributor

Choose a reason for hiding this comment

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

I had forgotten that we already have guidance on custom anchors for the GitHub docs site itself 🙈

I agree with @janbrasna that name would be better here. The GitHub docs site is rendered using different process from the content on the GitHub platform, but it will avoid introducing confusion.

The GitHub docs have limited information on the use of HTML in markdown files and fields that accept markdown. My understanding is that this is intentional - we don't want to end up writing an HTML primer, there are lots of those already. However, it sounds as if adding information on custom anchors will be useful to users.


> [!CAUTION]
> Changing the order of sections having headings with the same name will cause their generated identifiers to change, as well, resulting in links to those sections no longer pointing to the same locations they previously pointed to.\
> Use [Custom anchors](/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#custom-anchors) to create anchors that will not be automatically changed.
Copy link
Contributor

Choose a reason for hiding this comment

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

this will not pass wrt style guide for l10n issues, inline links are not preferable, see the style guide for examples how to link relevant sections, +autotitle use for easier translations.

@@ -1,3 +1,58 @@
You can link directly to a section in a rendered file by hovering over the section heading to expose {% octicon "link" aria-label="the link" %}.

![Screenshot of a README for a repository. To the left of a section heading, a link icon is outlined in dark orange.](/assets/images/help/repository/readme-links.png)

[Headings](/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#headings) automatically create anchors which have default names created from the text of the heading, with the following rules:
Copy link
Contributor

Choose a reason for hiding this comment

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

same ref issue as above — i believe both could be avoided if the addition is somehow blended with the existing content, not creating a specific chapter for it…

Copy link
Author

Choose a reason for hiding this comment

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

Yeah I struggled with that part for quite a while and was expecting something to that effect to be part of the feedback.

I wasn't really sure where was most appropriate to say all this stuff, how best to avoid being repetitive, and whether it necessarily belonged together or not, among other things.

Believe it or not, this version is like ⅓ the length of the original I had written up on my local machine before editing it down for commit. 😅

Plus it was I think one of the final parts I wrote, chronologically, so I'm sure there was a bit of fatigue involved. 😆

I'm not attached to any of the content, as written, so definitely don't hold back for sake of my ego or anything. All I want is a good and slightly more complete document, however it ends up. 🙂

* All other whitespace characters are removed.
* Paired formatting markup characters are removed, leaving only their contents (e.g., `_italics_` becomes `italics`).
* Punctuation and other characters not allowed in a URI fragment are removed.
* Other multi-byte UTF-8 characters which are valid in URI fragments are not modified.
Copy link
Contributor

Choose a reason for hiding this comment

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

@felicitymay I believe these two bullets would still refer to the RFC syntax for explanation how the string gets transformed (i.e. what's allowed =to stay, and what's not) so this may need a teeny tiny tweaking if removing #33531 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

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

In that case, I suggest that we provide a set of simple bullets in this article as general guidance, but give the link to the RFC syntax for anyone who wants more detailed information.

Comment on lines +10 to +21
```markdown
# Section Heading

Some body text of this section.

<a id="my-custom-anchor-point"></a>
Some text I want to provide a direct link to, but which doesn't have its own heading.

...more content...

[A link to that custom anchor](#my-custom-anchor-point)
```
Copy link
Contributor

Choose a reason for hiding this comment

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

TL;DR the example is somewhat lengthy to just demonstrate the feature (and lack differentiating / demonstrating the implicit header anchors at the same time); maybe someone from the content/triage could suggest something more to the point?

(if not, at least the ellipsis etc. in the dummy content could be typographically correct?)

Copy link
Author

@dodexahedron dodexahedron Aug 19, 2024

Choose a reason for hiding this comment

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

I think that's a semi-common issue in that document, as a whole, actually, so I agree and think one or more advanced or details or whatever pages are warranted for various features in that rather large document (including this one).

The github documentation is a bit more monolithic.in a lot of places than other ms learn topics. I don't know if there are any high level goals around consistency between them, organization-wise, but that's just my 2 cents on that specific concept.

Copy link
Author

Choose a reason for hiding this comment

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

That would also aid mobile-friendliness. Github doc pages can be VERY heavy on mobile browsers.

@dodexahedron
Copy link
Author

Thanks for coming back to it, regardless!

I am just now going through my inbox, so I am just seeing this now and will read it over shortly and address any remaining feedback as soon as I can. 🙂

@Mdanowe

This comment was marked as spam.

Mdanowe

This comment was marked as off-topic.


* Generated identifiers are UTF-8 URI fragments.
* See [RFC 3986: Uniform Resource Identifier (URI): Generic Syntax, Section 3.5](https://www.rfc-editor.org/rfc/rfc3986#section-3.5).
* All ASCII letters are converted to lower-case.
Copy link
Contributor

Choose a reason for hiding this comment

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

That's too specific to be always true;] Quickly checking, wiki encodes Á (which is ascii) instead of lowercasing it as-is, encoding it as percent/multibyte instead. 🤷

So I'd stay away from referring ASCII, Unicode codepoints, multibyte chars, RFC rules etc. as these can change any day:/ and may differ between readmes/files, Jekyll-built pages, wikis, projects, comments, discussions etc.


Some body text of this section.

<a id="my-custom-anchor-point"></a>
Copy link
Contributor

Choose a reason for hiding this comment

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

Replacing with name to align with the information on contributing to GitHub docs.

Suggested change
<a id="my-custom-anchor-point"></a>
<a name="my-custom-anchor-point"></a>

Comment on lines +23 to +25
> [!TIP]
> Custom anchors are not considered by the automatic naming and numbering behavior of automatic heading links.\
> To avoid ambiguous references, use a unique naming scheme for custom anchors, such as adding a prefix to the `id` attribute value of custom anchors.
Copy link
Contributor

Choose a reason for hiding this comment

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

We can probably delete this if we expand the note above as suggested 🤔

@felicitymay
Copy link
Contributor

@dodexahedron and @janbrasna - thanks for this PR and the interesting discussions ✨

@dodexahedron - I'm not sure if you have the time or desire to wade through all the comments and update your PR or not. Let me know if you want me to have a go. I'm out of the office next week, but would be happy to update the PR when I'm back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content This issue or pull request belongs to the Docs Content team get started Content related to "Getting Started" doc set waiting for review Issue/PR is waiting for a writer's review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add more information on behavior and usage of section links and document custom anchors
6 participants