[Feature] Warn about headings that skip a level
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
Read the TOC generation and filtering paths for --depth and --start-depth, along with the implementation of --numbered outline referenced in the issue. Decide whether to warn for every skipped level or only cases affected by indentation, and what link the warning should use. Done means warnings go to stderr for the retained entries, with each input checked independently and the TOC output and exit code unchanged.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Is your feature request related to a problem? Please describe.
When a heading skips a level (# Title followed by ### Skipped), GitHub can render its
TOC entry as text of the parent entry, on one line. The TOC is built without any notice.
The same request for the Bash version is ekalinin/github-markdown-toc#75, and it is
implemented there in ekalinin/github-markdown-toc#187.
Here it depends on the indent. TOCs rendered by the GitHub Markdown API:
| Headings | Indent | Rendered |
|---|---|---|
# Title two, then ### Skipped |
2 (default) | a nested list, as expected |
# Title two, then ### Skipped |
3 | one item: Title two * Skipped |
# Title, then #### Deep |
2 (default) | one item: Title * Deep |
Describe the solution you'd like
The same warning as in the Bash version. For every TOC entry whose heading level is
greater than the level of its parent plus 1, print to stderr:
Warning: heading 'Skipped' (level 3) skips a level after 'Title two' (level 1), see https://github.com/ekalinin/github-markdown-toc/issues/75
Behavior in the Bash version:
- The TOC does not change: on stdout and in the file with
--insert. The warning never
goes to stdout or into the file, and the exit code stays the same. - The parent of an entry is the nearest previous TOC entry with a lower level, as for
--numbered outline(#92). - One line per such entry, in document order. An entry without a parent gets no warning.
- It applies to every input. With several inputs each document is checked on its own,
and each line starts with the input as given on the command line, followed by:. - With
--depth, only the entries kept by--depthare checked, and the parent is taken
among them.
Additional context
- Here entries are also dropped by
--start-depth. The check should use only the entries
that stay in the TOC, as with--depth. - To decide: warn on every skipped level, as the Bash version does, or only when the
indent makes GitHub render the entry as text (see the table above). - To decide: the link in the message points to the issue of the Bash version.
- Ngôn ngữ chính
- Go
- Star
- 525
- Fork
- 89
- Merge trung bình
- 6 phút
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của ekalinin/github-markdown-toc.go
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
-
enhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 65/100
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
Tất cả issue của ekalinin/github-markdown-toc.go
Issue tương tự
-
/shutdown/ready can fail to return an HTTP response when readiness takes longer than the server write timeoutCó thể đã có người làm @floriankoch đã nhận hôm nay. Đang mởtriage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
envoyproxy/gateway#10562 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Adding an LDAP group reports every search failure as "LDAP Group DN is not found"Có thể đã có người làm @Daksha1611 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
[Bug] K8s reconcile still resets explicit 0 to defaults for response_api, memory and flow stateCó thể đã có người làm @Bevisy đã nhận hôm nay. Đang mởneeds-acceptance
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 87/100
vllm-project/semantic-router#5998 ·
Maintainer thường phản hồi trong vòng 2 ngày