Skip to content

Add scripts to verify anchors#3835

Merged
yikeke merged 15 commits into
masterfrom
markdown-link
Jul 2, 2020
Merged

Add scripts to verify anchors#3835
yikeke merged 15 commits into
masterfrom
markdown-link

Conversation

@breezewish
Copy link
Copy Markdown
Member

@breezewish breezewish commented Jun 30, 2020

What is changed, added or deleted? (Required)

Add a script to verify anchors.

The source code of the checker is at https://github.com/breeswish/remark-lint-pingcap-docs-anchor/blob/master/index.js , which uses the same slug algorithm as the current one in https://docs.pingcap.com/

Note that I didn't modified CI script to execute this script since I'm too lazy to fix existing problems.

53 dead anchors in docs-cn:master
auto-random.md
     14:91-14:159  warning  Dead anchor: /tidb-configuration-file.md#allow-auto-random
                 pingcap-docs-anchors  remark-lint

best-practices/high-concurrency-best-practices.md
  176:152-176:233  warning  Dead anchor: /tidb-specific-system-variables.md#shard_row_id_bits
                 pingcap-docs-anchors  remark-lint

br/backup-and-restore-faq.md
     27:69-27:112  warning  Dead anchor: /br/backup-and-restore-tool.md#备份原理
                 pingcap-docs-anchors  remark-lint

constraints.md
      63:25-63:65  warning  Dead anchor: /transaction-overview.md#事务的惰性检查
                 pingcap-docs-anchors  remark-lint

coprocessor-cache.md
     12:88-12:166  warning  Dead anchor: /tidb-configuration-file.md#tikv-clientcopr-cache-从-v400-版本开始引入
                 pingcap-docs-anchors  remark-lint

dashboard/dashboard-faq.md
       16:6-16:78  warning  Dead anchor: /dashboard/dashboard-ops-deploy.md#多-PD-实例部署
                 pingcap-docs-anchors  remark-lint

dashboard/dashboard-ops-deploy.md
       12:3-12:77  warning  Dead anchor: /quick-start-with-tidb.md#第二种使用-tiup-playground-快速部署本地测试环境
                 pingcap-docs-anchors  remark-lint

dashboard/dashboard-ops-reverse-proxy.md
     14:98-14:170  warning  Dead anchor: /dashboard/dashboard-ops-deploy.md#多-PD-实例部署
                 pingcap-docs-anchors  remark-lint

dashboard/dashboard-ops-security.md
    38:104-38:176  warning  Dead anchor: /dashboard/dashboard-ops-deploy.md#多-PD-实例部署
                 pingcap-docs-anchors  remark-lint

error-codes.md
      35:22-35:80  warning  Dead anchor: /faq/tidb-faq.md#433-transaction-too-large-是什么原因怎么解决
                 pingcap-docs-anchors  remark-lint
      39:33-39:61  warning  Dead anchor: /faq/tidb-faq.md#九故障排除
                 pingcap-docs-anchors  remark-lint
    266:22-266:69  warning  Dead anchor: /mysql-compatibility.md#ddl
                 pingcap-docs-anchors  remark-lint
    338:33-338:61  warning  Dead anchor: /faq/tidb-faq.md#九故障排除
                 pingcap-docs-anchors  remark-lint

faq/sql-faq.md
      78:57-78:92  warning  Dead anchor: /overview.md#tidb-整体架构
                 pingcap-docs-anchors  remark-lint
  217:154-217:224  warning  Dead anchor: /tidb-specific-system-variables.md#shard_row_id_bits
                 pingcap-docs-anchors  remark-lint

functions-and-operators/aggregate-group-by-functions.md
      85:21-85:76  warning  Dead anchor: /mysql-compatibility.md#默认设置的区别
                 pingcap-docs-anchors  remark-lint

garbage-collection-configuration.md
      77:39-77:85  warning  Dead anchor: /garbage-collection-overview.md#do-gc
                 pingcap-docs-anchors  remark-lint
      79:30-79:76  warning  Dead anchor: /garbage-collection-overview.md#do-gc
                 pingcap-docs-anchors  remark-lint
     85:57-85:119  warning  Dead anchor: /garbage-collection-overview.md#resolve-locks
                 pingcap-docs-anchors  remark-lint
    85:211-85:257  warning  Dead anchor: /garbage-collection-overview.md#do-gc
                 pingcap-docs-anchors  remark-lint

get-started-with-tidb-lightning.md
     51:75-51:107  warning  Dead anchor: /overview.md#部署方式
                 pingcap-docs-anchors  remark-lint

mysql-compatibility.md
   143:88-143:152  warning  Dead anchor: /command-line-flags-for-tidb-configuration.md#store
                 pingcap-docs-anchors  remark-lint

quick-start-with-tidb.md
     122:7-122:65  warning  Dead anchor: /production-deployment-using-tiup.md#如何关闭部署机器的防火墙
                 pingcap-docs-anchors  remark-lint

sql-statements/sql-statement-add-column.md
    122:20-122:55  warning  Dead anchor: /generated-columns.md#局限性
                 pingcap-docs-anchors  remark-lint

sql-statements/sql-statement-alter-table.md
      97:31-97:82  warning  Dead anchor: /mysql-compatibility.md#ddl
                 pingcap-docs-anchors  remark-lint

sql-statements/sql-statement-commit.md
       77:3-77:46  warning  Dead anchor: /transaction-overview.md#事务的惰性检查
                 pingcap-docs-anchors  remark-lint

sql-statements/sql-statement-create-index.md
   194:94-194:125  warning  Dead anchor: /generated-columns.md#局限性
                 pingcap-docs-anchors  remark-lint

sql-statements/sql-statement-create-table.md
   232:69-232:139  warning  Dead anchor: /tidb-specific-system-variables.md#shard_row_id_bits
                 pingcap-docs-anchors  remark-lint

sql-statements/sql-statement-load-data.md
      76:1-76:187  warning  Dead anchor: /faq/tidb-faq.md#923-error-1148-42000-the-used-command-is-not-allowed-with-this-tidb-version-问题的处理方法  pingcap-docs-anchors  remark-lint

sql-statements/sql-statement-recover-table.md
       65:7-65:69  warning  Dead anchor: /ecosystem-tool-user-guide.md#tidb-集群数据的全量备份及恢复-1
                 pingcap-docs-anchors  remark-lint

storage-engine/titan-configuration.md
     47:54-47:111  warning  Dead anchor: /tikv-control.md###手动-compact-整个-TiKV-集群的数据
                 pingcap-docs-anchors  remark-lint

system-variables.md
       13:4-13:61  warning  Dead anchor: /sql-statements/sql-statement-admin.md#set-语句
                 pingcap-docs-anchors  remark-lint

telemetry.md
     64:29-64:103  warning  Dead anchor: /tidb-configuration-file.md#enable-telemetry
                 pingcap-docs-anchors  remark-lint
     81:74-81:133  warning  Dead anchor: /tidb-configuration-file.md#enable-telemetry
                 pingcap-docs-anchors  remark-lint
   153:28-153:111  warning  Dead anchor: /tidb-specific-system-variables.md#tidb_enable_telemetry
                 pingcap-docs-anchors  remark-lint

ticdc/ticdc-overview.md
      80:17-80:86  warning  Dead anchor: /character-set-and-collation.md#新框架下的-collation-支持
                 pingcap-docs-anchors  remark-lint

tidb-binlog/deploy-tidb-binlog.md
     20:35-20:119  warning  Dead anchor: /production-deployment-using-tiup.md#场景-3通过-tidb-binlog-同步到下游
                 pingcap-docs-anchors  remark-lint

tidb-binlog/get-started-with-tidb-binlog.md
   421:85-421:161  warning  Dead anchor: /tidb-binlog/maintain-tidb-binlog-cluster.md#binlogctl-工具
                 pingcap-docs-anchors  remark-lint

tidb-binlog/handle-tidb-binlog-errors.md
      33:11-33:84  warning  Dead anchor: /tidb-binlog/maintain-tidb-binlog-cluster.md#binlogctl-工具
                 pingcap-docs-anchors  remark-lint

tidb-binlog/troubleshoot-tidb-binlog.md
       15:7-15:80  warning  Dead anchor: /tidb-binlog/maintain-tidb-binlog-cluster.md#binlogctl-工具
                 pingcap-docs-anchors  remark-lint

tidb-configuration-file.md
   147:54-147:137  warning  Dead anchor: /tidb-specific-system-variables.md#tidb_enable_telemetry
                 pingcap-docs-anchors  remark-lint

tidb-lightning/deploy-tidb-lightning.md
    70:114-70:175  warning  Dead anchor: /faq/tidb-faq.md#326-每个-region-的-replica-数量可配置吗调整的方法是
                 pingcap-docs-anchors  remark-lint
    181:64-181:96  warning  Dead anchor: /overview.md#部署方式
                 pingcap-docs-anchors  remark-lint

tidb-lightning/tidb-lightning-overview.md
     41:93-41:147  warning  Dead anchor: /mysql-compatibility.md#auto-increment-id
                 pingcap-docs-anchors  remark-lint

tidb-lightning/tidb-lightning-web-interface.md
     61:29-61:121  warning  Dead anchor: /tidb-lightning/tidb-lightning-configuration.md#tidb-lightning-任务配置参数
                 pingcap-docs-anchors  remark-lint

tidb-specific-system-variables.md
   959:65-959:131  warning  Dead anchor: /tidb-configuration-file.md#enable-telemetry
                 pingcap-docs-anchors  remark-lint

tidb-troubleshooting-map.md
   500:14-500:110  warning  Dead anchor: /troubleshoot-tidb-lightning.md#resourcetemporarilyunavailabletoo-many-open-engines--8                       pingcap-docs-anchors  remark-lint
   512:14-512:125  warning  Dead anchor: /troubleshoot-tidb-lightning.md#sql2kv-sql-encode-error--types1292invalid-time-format-1970-1-1-0-45-0-0      pingcap-docs-anchors  remark-lint

tiflash/troubleshoot-tiflash.md
       93:6-93:65  warning  Dead anchor: /tiflash/maintain-tiflash.md#下线-tiflash-节点
                 pingcap-docs-anchors  remark-lint

tiflash/tune-tiflash-performance.md
       27:5-27:86  warning  Dead anchor: /tidb-specific-system-variables.md#tidb_allow_batch_cop
                 pingcap-docs-anchors  remark-lint

troubleshoot-lock-conflicts.md
      77:26-77:65  warning  Dead anchor: /tidb-control.md#decoder-子命令
                 pingcap-docs-anchors  remark-lint

upgrade-tidb-using-ansible.md
    33:192-33:284  warning  Dead anchor: /online-deployment-using-ansible.md#在中控机器上安装-tidb-ansible-及其依赖
                 pingcap-docs-anchors  remark-lint
     83:36-83:116  warning  Dead anchor: /online-deployment-using-ansible.md#在中控机器上下载-tidb-ansible
                 pingcap-docs-anchors  remark-lint

⚠ 53 warnings
21 dead anchors in docs:master
auto-random.md
    14:145-14:213  warning  Dead anchor: /tidb-configuration-file.md#allow-auto-random
  pingcap-docs-anchors  remark-lint

br/backup-and-restore-tool.md
      85:22-85:86  warning  Dead anchor: /tune-tikv-performance.md#tune-tikv-performance
  pingcap-docs-anchors  remark-lint

check-cluster-status-using-sql-statements.md
     25:65-25:165  warning  Dead anchor: /system-tables/system-table-information-schema.md#analyze-status-table
  pingcap-docs-anchors  remark-lint

coprocessor-cache.md
    14:191-14:279  warning  Dead anchor: /tidb-configuration-file.md#tikv-clientcopr-cache-new-in-v400
  pingcap-docs-anchors  remark-lint

dashboard/dashboard-faq.md
       18:7-18:89  warning  Dead anchor: /dashboard/dashboard-ops-deploy.md#
  pingcap-docs-anchors  remark-lint

dashboard/dashboard-statement-list.md
       59:5-59:94  warning  Dead anchor: /statement-summary-tables.md#configurations
  pingcap-docs-anchors  remark-lint

get-started-with-tidb-binlog.md
  332:172-332:251  warning  Dead anchor: /tidb-binlog/maintain-tidb-binlog-cluster.md#binlogctl-guide
  pingcap-docs-anchors  remark-lint

quick-start-with-tidb.md
    130:3-130:146  warning  Dead anchor: /production-deployment-using-tiup.md#how-to-stop-the-firewall-service-of-deployment-machines  pingcap-docs-anchors  remark-lint

releases/release-2.1-ga.md
   182:11-182:105  warning  Dead anchor: /pd-control.md#region-store-store-id
  pingcap-docs-anchors  remark-lint

releases/release-2.1.18.md
    52:185-52:302  warning  Dead anchor: /tidb-specific-system-variables.md#tidb_allow_remove_auto_inc-new-in-v2118-and-v304
  pingcap-docs-anchors  remark-lint

sql-statements/sql-statement-recover-table.md
     66:89-66:201  warning  Dead anchor: /ecosystem-tool-user-guide.md#full-backup-and-restore-of-tidb-cluster-data-1
  pingcap-docs-anchors  remark-lint

system-tables/system-table-inspection-result.md
  278:170-278:244  warning  Dead anchor: /command-line-flags-for-tidb-configuration.md#token-limit
  pingcap-docs-anchors  remark-lint

telemetry.md
     64:41-64:115  warning  Dead anchor: /tidb-configuration-file.md#enable-telemetry
  pingcap-docs-anchors  remark-lint
     81:94-81:165  warning  Dead anchor: /tidb-configuration-file.md#enable-telemetry
  pingcap-docs-anchors  remark-lint
   153:69-153:152  warning  Dead anchor: /tidb-specific-system-variables.md#tidb_enable_telemetry
  pingcap-docs-anchors  remark-lint

tidb-binlog/handle-tidb-binlog-errors.md
      36:19-36:94  warning  Dead anchor: /tidb-binlog/maintain-tidb-binlog-cluster.md#binlog-guide
  pingcap-docs-anchors  remark-lint

tidb-binlog/troubleshoot-tidb-binlog.md
      16:12-16:90  warning  Dead anchor: /tidb-binlog/maintain-tidb-binlog-cluster.md#binlogctl-guide
  pingcap-docs-anchors  remark-lint

tidb-configuration-file.md
  149:122-149:205  warning  Dead anchor: /tidb-specific-system-variables.md#tidb_enable_telemetry
  pingcap-docs-anchors  remark-lint

tidb-lightning/tidb-lightning-faq.md
      64:4-64:114  warning  Dead anchor: /troubleshoot-tidb-lightning.md#checkpoint-for-has-invalid-status
  pingcap-docs-anchors  remark-lint

tidb-specific-system-variables.md
  595:165-595:231  warning  Dead anchor: /tidb-configuration-file.md#enable-telemetry
  pingcap-docs-anchors  remark-lint

tiflash/tune-tiflash-performance.md
     28:21-28:102  warning  Dead anchor: /tidb-specific-system-variables.md#tidb_allow_batch_cop
  pingcap-docs-anchors  remark-lint

⚠ 21 warnings

Which TiDB version(s) do your changes apply to? (Required)

  • master (the latest development version)
  • v4.0 (TiDB 4.0 versions)
  • v3.1 (TiDB 3.1 versions)
  • v3.0 (TiDB 3.0 versions)
  • v2.1 (TiDB 2.1 versions)

What is the related PR or file link(s)?

  • This PR is translated from:
  • Other reference link(s):

@github-actions github-actions Bot requested review from TomShawn, lilin90 and yikeke June 30, 2020 12:49
@github-actions github-actions Bot added translation/welcome Waits for a contributor to translate this PR and create a PR to the pingcap/docs-cn repository. status/PTAL This PR is ready for reviewing. labels Jun 30, 2020
@TomShawn TomShawn added translation/no-need No need to translate this PR. type/enhancement The issue or PR belongs to an enhancement. and removed translation/welcome Waits for a contributor to translate this PR and create a PR to the pingcap/docs-cn repository. labels Jun 30, 2020
@yikeke yikeke removed the request for review from TomShawn June 30, 2020 13:09
@yikeke yikeke added needs-cherry-pick-4.0 translation/doing This PR’s assignee is translating this PR. and removed translation/no-need No need to translate this PR. labels Jul 2, 2020
@yikeke yikeke self-assigned this Jul 2, 2020
Copy link
Copy Markdown
Member

@lilin90 lilin90 left a comment

Choose a reason for hiding this comment

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

LGTM

@yikeke yikeke merged commit ac19406 into master Jul 2, 2020
@yikeke yikeke deleted the markdown-link branch July 2, 2020 07:09
ti-srebot pushed a commit to ti-srebot/docs-cn that referenced this pull request Jul 2, 2020
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Copy Markdown
Contributor

cherry pick to release-4.0 in PR #3854

yikeke pushed a commit that referenced this pull request Jul 2, 2020
yikeke added a commit that referenced this pull request Jul 2, 2020
* cherry pick #3835 to release-4.0

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>

* fix conflict

* fix conflict

* test

* test result: script ok

Co-authored-by: Wenxuan <hi@breeswish.org>
Co-authored-by: yikeke <yikeke@pingcap.com>
Co-authored-by: Keke Yi <40977455+yikeke@users.noreply.github.com>
@yikeke yikeke mentioned this pull request Jul 2, 2020
5 tasks
yikeke added a commit that referenced this pull request Jul 3, 2020
* add anchor check

* chmod +x verify-link-anchors.sh

* fix 15 anchors
yikeke added a commit that referenced this pull request Jul 3, 2020
* add anchor check from #3835

* chmod +x verify-link-anchors.sh

* fix 18 anchors

* fix an anchor
ti-srebot pushed a commit that referenced this pull request Jul 3, 2020
* add anchor check

* fix 9 anchors
@yikeke yikeke added translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. and removed translation/doing This PR’s assignee is translating this PR. labels Jul 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status/PTAL This PR is ready for reviewing. translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. type/enhancement The issue or PR belongs to an enhancement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants