Skip to content

Commit

Permalink
docs: auto-generation edit link (#16213)
Browse files Browse the repository at this point in the history
* docs: auto-generation edit link

* docs: remove unsed edit_link

* docs: fix wrong start with edit link
  • Loading branch information
kecrily committed Aug 17, 2022
1 parent 4e9671f commit 7137344
Show file tree
Hide file tree
Showing 359 changed files with 21 additions and 363 deletions.
8 changes: 8 additions & 0 deletions docs/src/_data/sites/en.yml
Expand Up @@ -107,3 +107,11 @@ footer:
actions:
back_to_home: Back to homepage
browse_docs: Browse the docs

#------------------------------------------------------------------------------
# Edit link
#------------------------------------------------------------------------------

edit_link:
start_with: https://github.com/eslint/eslint/edit/main/docs/
text: Edit this page
9 changes: 8 additions & 1 deletion docs/src/_includes/layouts/doc.html
Expand Up @@ -81,7 +81,14 @@ <h1>{{ title }}</h1>
</div>

<div class="docs-edit-link">
<a href="{{ edit_link }}" class="c-btn c-btn--secondary">Edit this page</a>
<a href="
{% if edit_link %}
{{ edit_link }}
{% else %}
{{ site.edit_link.start_with }}{{ page.inputPath }}
{% endif %}
"
class="c-btn c-btn--secondary">{{ site.edit_link.text }}</a>
</div>
</main>

Expand Down
1 change: 0 additions & 1 deletion docs/src/about/index.md
@@ -1,7 +1,6 @@
---
title: About
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/about/index.md

---

Expand Down
1 change: 0 additions & 1 deletion docs/src/developer-guide/architecture/index.md
@@ -1,7 +1,6 @@
---
title: Architecture
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/architecture/index.md
eleventyNavigation:
key: architecture
parent: developer guide
Expand Down
1 change: 0 additions & 1 deletion docs/src/developer-guide/code-conventions.md
@@ -1,7 +1,6 @@
---
title: Code Conventions
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/code-conventions.md

---

Expand Down
1 change: 0 additions & 1 deletion docs/src/developer-guide/code-path-analysis.md
@@ -1,7 +1,6 @@
---
title: Code Path Analysis Details
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/code-path-analysis.md

---

Expand Down
5 changes: 2 additions & 3 deletions docs/src/developer-guide/contributing/changes.md
@@ -1,15 +1,14 @@
---
title: Change Requests
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/contributing/changes.md

---

If you'd like to request a change to ESLint, please [create a new issue](https://github.com/eslint/eslint/issues/new/choose) on GitHub. Be sure to include the following information:

1. The version of ESLint you are using.
1. The problem you want to solve.
1. Your take on the correct solution to problem.
2. The problem you want to solve.
3. Your take on the correct solution to problem.

If you're requesting a change to a rule, it's helpful to include this information as well:

Expand Down
1 change: 0 additions & 1 deletion docs/src/developer-guide/contributing/index.md
@@ -1,7 +1,6 @@
---
title: Contributing
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/contributing/index.md
eleventyNavigation:
key: contributing
parent: developer guide
Expand Down
1 change: 0 additions & 1 deletion docs/src/developer-guide/contributing/new-rules.md
@@ -1,7 +1,6 @@
---
title: New Rules
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/contributing/new-rules.md

---

Expand Down
1 change: 0 additions & 1 deletion docs/src/developer-guide/contributing/pull-requests.md
@@ -1,7 +1,6 @@
---
title: Pull Requests
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/contributing/pull-requests.md

---

Expand Down
1 change: 0 additions & 1 deletion docs/src/developer-guide/contributing/reporting-bugs.md
@@ -1,7 +1,6 @@
---
title: Reporting Bugs
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/contributing/reporting-bugs.md

---

Expand Down
1 change: 0 additions & 1 deletion docs/src/developer-guide/contributing/rule-changes.md
@@ -1,7 +1,6 @@
---
title: Rule Changes
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/contributing/rule-changes.md

---

Expand Down
1 change: 0 additions & 1 deletion docs/src/developer-guide/contributing/working-on-issues.md
@@ -1,7 +1,6 @@
---
title: Working on Issues
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/contributing/working-on-issues.md

---

Expand Down
1 change: 0 additions & 1 deletion docs/src/developer-guide/development-environment.md
@@ -1,7 +1,6 @@
---
title: Development Environment
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/development-environment.md
eleventyNavigation:
key: set up a development environment
parent: developer guide
Expand Down
1 change: 0 additions & 1 deletion docs/src/developer-guide/index.md
@@ -1,7 +1,6 @@
---
title: Developer Guide
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/index.md
eleventyNavigation:
key: developer guide
title: Developer Guide
Expand Down
1 change: 0 additions & 1 deletion docs/src/developer-guide/nodejs-api.md
@@ -1,7 +1,6 @@
---
title: Node.js API
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/nodejs-api.md
eleventyNavigation:
key: node.js api
parent: developer guide
Expand Down
1 change: 0 additions & 1 deletion docs/src/developer-guide/scope-manager-interface.md
@@ -1,7 +1,6 @@
---
title: ScopeManager
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/scope-manager-interface.md

---

Expand Down
5 changes: 2 additions & 3 deletions docs/src/developer-guide/selectors.md
@@ -1,15 +1,14 @@
---
title: Selectors
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/selectors.md

---

Some rules and APIs allow the use of selectors to query an AST. This page is intended to:

1. Explain what selectors are
1. Describe the syntax for creating selectors
1. Describe what selectors can be used for
2. Describe the syntax for creating selectors
3. Describe what selectors can be used for

## What is a selector?

Expand Down
1 change: 0 additions & 1 deletion docs/src/developer-guide/shareable-configs.md
@@ -1,7 +1,6 @@
---
title: Shareable Configs
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/shareable-configs.md
eleventyNavigation:
key: shareable configs
parent: developer guide
Expand Down
1 change: 0 additions & 1 deletion docs/src/developer-guide/source-code.md
@@ -1,7 +1,6 @@
---
title: Source Code
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/source-code.md
eleventyNavigation:
key: getting the source code
parent: developer guide
Expand Down
1 change: 0 additions & 1 deletion docs/src/developer-guide/unit-tests.md
@@ -1,7 +1,6 @@
---
title: Unit Tests
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/unit-tests.md
eleventyNavigation:
key: run the tests
parent: developer guide
Expand Down
1 change: 0 additions & 1 deletion docs/src/developer-guide/working-with-custom-formatters.md
@@ -1,7 +1,6 @@
---
title: Working with Custom Formatters
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/working-with-custom-formatters.md
eleventyNavigation:
key: working with custom formatters
parent: developer guide
Expand Down
1 change: 0 additions & 1 deletion docs/src/developer-guide/working-with-custom-parsers.md
@@ -1,7 +1,6 @@
---
title: Working with Custom Parsers
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/working-with-custom-parsers.md
eleventyNavigation:
key: working with custom parsers
parent: developer guide
Expand Down
1 change: 0 additions & 1 deletion docs/src/developer-guide/working-with-plugins.md
@@ -1,7 +1,6 @@
---
title: Working with Plugins
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/working-with-plugins.md
eleventyNavigation:
key: working with plugings
parent: developer guide
Expand Down
1 change: 0 additions & 1 deletion docs/src/developer-guide/working-with-rules-deprecated.md
@@ -1,7 +1,6 @@
---
title: Working with Rules (Deprecated)
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/working-with-rules-deprecated.md

---

Expand Down
1 change: 0 additions & 1 deletion docs/src/developer-guide/working-with-rules.md
@@ -1,7 +1,6 @@
---
title: Working with Rules
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/developer-guide/working-with-rules.md
eleventyNavigation:
key: working with rules
parent: developer guide
Expand Down
1 change: 0 additions & 1 deletion docs/src/maintainer-guide/governance.md
@@ -1,7 +1,6 @@
---
title: Governance
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/maintainer-guide/governance.md
eleventyNavigation:
key: governance
parent: maintainer guide
Expand Down
1 change: 0 additions & 1 deletion docs/src/maintainer-guide/index.md
@@ -1,7 +1,6 @@
---
title: Maintainer Guide
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/maintainer-guide/index.md
eleventyNavigation:
key: maintainer guide
title: Maintainer Guide
Expand Down
1 change: 0 additions & 1 deletion docs/src/maintainer-guide/issues.md
@@ -1,7 +1,6 @@
---
title: Managing Issues
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/maintainer-guide/issues.md
eleventyNavigation:
key: managing issues
parent: maintainer guide
Expand Down
1 change: 0 additions & 1 deletion docs/src/maintainer-guide/pullrequests.md
@@ -1,7 +1,6 @@
---
title: Reviewing Pull Requests
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/maintainer-guide/pullrequests.md
eleventyNavigation:
key: reviewing pull requests
parent: maintainer guide
Expand Down
1 change: 0 additions & 1 deletion docs/src/maintainer-guide/releases.md
@@ -1,7 +1,6 @@
---
title: Managing Releases
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/maintainer-guide/releases.md
eleventyNavigation:
key: managing releases
parent: maintainer guide
Expand Down
1 change: 0 additions & 1 deletion docs/src/maintainer-guide/working-groups.md
@@ -1,7 +1,6 @@
---
title: Working Groups
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/maintainer-guide/working-groups.md

---

Expand Down
1 change: 0 additions & 1 deletion docs/src/pages/index.md
Expand Up @@ -2,7 +2,6 @@
title: Documentation
layout: doc
permalink: /index.html
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/pages/index.md
---

Welcome to our documentation pages! What would you like to view?
Expand Down
1 change: 0 additions & 1 deletion docs/src/rules/accessor-pairs.md
@@ -1,7 +1,6 @@
---
title: accessor-pairs
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/accessor-pairs.md
rule_type: suggestion
related_rules:
- no-dupe-keys
Expand Down
1 change: 0 additions & 1 deletion docs/src/rules/array-bracket-newline.md
@@ -1,7 +1,6 @@
---
title: array-bracket-newline
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/array-bracket-newline.md
rule_type: layout
related_rules:
- array-bracket-spacing
Expand Down
1 change: 0 additions & 1 deletion docs/src/rules/array-bracket-spacing.md
@@ -1,7 +1,6 @@
---
title: array-bracket-spacing
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/array-bracket-spacing.md
rule_type: layout
related_rules:
- space-in-parens
Expand Down
1 change: 0 additions & 1 deletion docs/src/rules/array-callback-return.md
@@ -1,7 +1,6 @@
---
title: array-callback-return
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/array-callback-return.md
rule_type: problem
---

Expand Down
1 change: 0 additions & 1 deletion docs/src/rules/array-element-newline.md
@@ -1,7 +1,6 @@
---
title: array-element-newline
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/array-element-newline.md
rule_type: layout
related_rules:
- array-bracket-spacing
Expand Down
1 change: 0 additions & 1 deletion docs/src/rules/arrow-body-style.md
@@ -1,7 +1,6 @@
---
title: arrow-body-style
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/arrow-body-style.md
rule_type: suggestion
---

Expand Down
1 change: 0 additions & 1 deletion docs/src/rules/arrow-parens.md
@@ -1,7 +1,6 @@
---
title: arrow-parens
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/arrow-parens.md
rule_type: layout
further_reading:
- https://github.com/airbnb/javascript#arrows--one-arg-parens
Expand Down
1 change: 0 additions & 1 deletion docs/src/rules/arrow-spacing.md
@@ -1,7 +1,6 @@
---
title: arrow-spacing
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/arrow-spacing.md
rule_type: layout
---

Expand Down
1 change: 0 additions & 1 deletion docs/src/rules/block-scoped-var.md
@@ -1,7 +1,6 @@
---
title: block-scoped-var
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/block-scoped-var.md
rule_type: suggestion
further_reading:
- https://www.adequatelygood.com/JavaScript-Scoping-and-Hoisting.html
Expand Down
1 change: 0 additions & 1 deletion docs/src/rules/block-spacing.md
@@ -1,7 +1,6 @@
---
title: block-spacing
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/block-spacing.md
rule_type: layout
related_rules:
- space-before-blocks
Expand Down
1 change: 0 additions & 1 deletion docs/src/rules/brace-style.md
@@ -1,7 +1,6 @@
---
title: brace-style
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/brace-style.md
rule_type: layout
related_rules:
- block-spacing
Expand Down
1 change: 0 additions & 1 deletion docs/src/rules/callback-return.md
@@ -1,7 +1,6 @@
---
title: callback-return
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/callback-return.md
rule_type: suggestion
related_rules:
- handle-callback-err
Expand Down
1 change: 0 additions & 1 deletion docs/src/rules/camelcase.md
@@ -1,7 +1,6 @@
---
title: camelcase
layout: doc
edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/camelcase.md
rule_type: suggestion
---

Expand Down

0 comments on commit 7137344

Please sign in to comment.