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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add anchors to headings inside docs content #16134

Merged
merged 3 commits into from Jul 20, 2022

Conversation

harish-sethuraman
Copy link
Member

@harish-sethuraman harish-sethuraman commented Jul 15, 2022

Prerequisites checklist

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

Fixes #16128

[x] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofix to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:

What changes did you make? (Give an overview)

Added anchor-js library and add anchors for headings inside docs

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

check if any other element is getting anchors. I verified that table of content was h2 and was getting the anchor so I've move it to be a paragraph text and added font-weight alone to match the styling. If you are aware of any other elements like that need help. I verified once 馃槄 and everything seems to work fine

@eslint-github-bot eslint-github-bot bot added triage An ESLint team member will look at this issue soon documentation Relates to ESLint's documentation labels Jul 15, 2022
@netlify
Copy link

netlify bot commented Jul 15, 2022

Deploy Preview for docs-eslint ready!

Name Link
馃敤 Latest commit efee098
馃攳 Latest deploy log https://app.netlify.com/sites/docs-eslint/deploys/62d2b1431df57900090c19c4
馃槑 Deploy Preview https://deploy-preview-16134--docs-eslint.netlify.app
馃摫 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@@ -121,6 +121,7 @@
<script type="module" src="{{ '/assets/js/search.js' | url }}"></script>
<link rel="stylesheet" type="text/css" href="{{ '/assets/css/styles.css' | url }}">
<link rel="stylesheet" href="{{ '/assets/css/print.css' | url }}" media="print">
<script src="https://unpkg.com/anchor-js@4.3.1/anchor.min.js"></script>
Copy link
Sponsor Member

@bmish bmish Jul 15, 2022

Choose a reason for hiding this comment

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

This was an actual dependency in package.json on the old documentation site so probably it should be here as well?

Copy link
Member Author

@harish-sethuraman harish-sethuraman Jul 16, 2022

Choose a reason for hiding this comment

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

Yea? We could do it either way? https://www.npmjs.com/package/anchor-js both are suggested as per their documentation?

Copy link
Sponsor Member

@bmish bmish Jul 16, 2022

Choose a reason for hiding this comment

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

Personally I prefer to take advantage of the package management provided by package.json and specify it there, especially given that we haven't begun using unpkg anywhere.

Copy link
Member Author

@harish-sethuraman harish-sethuraman Jul 16, 2022

Choose a reason for hiding this comment

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

we have to change the imports as module if we want to use imports or add passthrough through eleventy (I haven't tried these yet) anyway the passthrough is just going to import add the files into the assets and we will be importing it from there. I don't think there is going to be much difference using the dep from npm too instead of this approach which seems very straight forward.

Copy link
Member

@nzakas nzakas Jul 20, 2022

Choose a reason for hiding this comment

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

I think this is fine for now. If we end up needing to upgrade this dependency at any point, then I'd say let's move it to an npm dependency.

nzakas
nzakas approved these changes Jul 20, 2022
@@ -121,6 +121,7 @@
<script type="module" src="{{ '/assets/js/search.js' | url }}"></script>
<link rel="stylesheet" type="text/css" href="{{ '/assets/css/styles.css' | url }}">
<link rel="stylesheet" href="{{ '/assets/css/print.css' | url }}" media="print">
<script src="https://unpkg.com/anchor-js@4.3.1/anchor.min.js"></script>
Copy link
Member

@nzakas nzakas Jul 20, 2022

Choose a reason for hiding this comment

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

I think this is fine for now. If we end up needing to upgrade this dependency at any point, then I'd say let's move it to an npm dependency.

@nzakas nzakas merged commit 2aadc93 into eslint:main Jul 20, 2022
20 checks passed
@harish-sethuraman harish-sethuraman deleted the feat/add-anchors branch Jul 21, 2022
crapStone pushed a commit to Calciumdibromid/CaBr2 that referenced this pull request Aug 9, 2022
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [eslint](https://eslint.org) ([source](https://github.com/eslint/eslint)) | devDependencies | minor | [`8.20.0` -> `8.21.0`](https://renovatebot.com/diffs/npm/eslint/8.20.0/8.21.0) |

---

### Release Notes

<details>
<summary>eslint/eslint</summary>

### [`v8.21.0`](https://github.com/eslint/eslint/releases/tag/v8.21.0)

[Compare Source](eslint/eslint@v8.20.0...v8.21.0)

#### Features

-   [`7b43ea1`](eslint/eslint@7b43ea1) feat: Implement FlatESLint ([#&#8203;16149](eslint/eslint#16149)) (Nicholas C. Zakas)
-   [`92bf49a`](eslint/eslint@92bf49a) feat: improve the key width calculation in `key-spacing` rule ([#&#8203;16154](eslint/eslint#16154)) (Nitin Kumar)
-   [`c461542`](eslint/eslint@c461542) feat: add new `allowLineSeparatedGroups` option to the `sort-keys` rule ([#&#8203;16138](eslint/eslint#16138)) (Nitin Kumar)
-   [`1cdcbca`](eslint/eslint@1cdcbca) feat: add deprecation warnings for legacy API in `RuleTester` ([#&#8203;16063](eslint/eslint#16063)) (Nitin Kumar)

#### Bug Fixes

-   [`0396775`](eslint/eslint@0396775) fix: lines-around-comment apply `allowBlockStart` for switch statements ([#&#8203;16153](eslint/eslint#16153)) (Nitin Kumar)

#### Documentation

-   [`2aadc93`](eslint/eslint@2aadc93) docs: add anchors to headings inside docs content ([#&#8203;16134](eslint/eslint#16134)) (Strek)

#### Chores

-   [`8892511`](eslint/eslint@8892511) chore: Upgrade to Espree 9.3.3 ([#&#8203;16173](eslint/eslint#16173)) (Brandon Mills)
-   [`1233bee`](eslint/eslint@1233bee) chore: switch to eslint-plugin-node's maintained fork ([#&#8203;16150](eslint/eslint#16150)) (鍞劧)
-   [`97b95c0`](eslint/eslint@97b95c0) chore: upgrade puppeteer v13 ([#&#8203;16151](eslint/eslint#16151)) (鍞劧)

</details>

---

### Configuration

馃搮 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

馃殾 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

 **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

馃敃 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xMzUuMSIsInVwZGF0ZWRJblZlciI6IjMyLjEzNS4xIn0=-->

Co-authored-by: cabr2-bot <cabr2.help@gmail.com>
Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1483
Reviewed-by: Epsilon_02 <epsilon_02@noreply.codeberg.org>
Co-authored-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
Co-committed-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Relates to ESLint's documentation triage An ESLint team member will look at this issue soon
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Anchor link missing on headers
3 participants