Generate HTML identifier from section title

Đang mở
#996 11 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
html
Lĩnh vực
web-dev

Hướng nghiên cứu

Start by finding the HTML export code that assigns section identifiers and the tests covering exported sections; compare its current numeric IDs with the title-based behavior described here. Done means exported section IDs reflect their titles and can be used as fragment links, with tests verifying the generated HTML.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Help wanted Scripting Type: Feature
Expected behaviour

I can link to a specific section in a exported HTML document using an identifier generated from its title.

eg. <h4 id="my-section">My section</h4> in generated html, in order to be able to use my_note.html#my-section to access "My section"

Actual behaviour

The identifier for sections exist, but are numerically incremented, and do not reflect the title of the section.

example: <h4 id="toc_6">My section</h4>

Possible implementation

This is how it's done in the insert-toc script, in order to work well with GitHub flavored Markdown:

    function extractLink(title) {
        var lowercase = title.toLowerCase()
        var spaceReplaced = lowercase.replace(/ /g, "-")
        var invalidCharsRemoved = spaceReplaced.replace(/[^A-Za-zÀ-ÿ-_]/g, "")
        return invalidCharsRemoved;
    }
Ngôn ngữ chính
C++
Star
5.9k
Fork
499
Merge trung bình
4 giờ 4 phút
Pull request đã merge (30 ngày)
3

Chuẩn bị môi trường

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của pbek/QOwnNotes

Tất cả issue của pbek/QOwnNotes

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.