Eliminate horizontal scrolling in rust code blocks
Maintainer thường phản hồi trong vòng 1 ngày
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
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- markdown, rust
- Lĩnh vực
- documentation
Hướng nghiên cứu
Bắt đầu với rustfmt.toml và các khối mã Rust có thể chỉnh sửa được mô tả trong issue, sau đó so sánh các khối đã render với độ dài dòng và số lượng dòng khác nhau. Xem xét cách các tệp Rust được include, các chú thích đã dịch, các biểu thức use, macro, lệnh shell và đầu ra được xử lý. Việc hoàn tất cần bao gồm một phương án đã thống nhất để ngăn việc cuộn ngang và một bước xác thực, hoặc một quyết định được ghi lại cho các trường hợp còn lại.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
The style guide mentiones presentation use case for the course. That means much inconvenience while dealing with very long lines in the code snippets.
The problem was addressed earlier as it can be seen from rustfmt.toml configuration:
# The code blocks get a scrollbar if they are wider than this.
max_width = 85
This works well for read only blocks, but fails for editable ones. Due to line numbering, there is less space left for the code. My observations are that the scrolling threshold is 83 for less than 10 line long code, 82 - less than 100 and 81 - above 100. There are no snippets above 1k and I suppose there must not be in the context of the course.
The following merge request adopts max 81-character width and eliminates detected scrolling in rust code blocks.
I suppose it is a partial solution though. But further steps require a discussion.
There should be an automated format validation step. rustfmt can do so with rust files, but not markdown. Across the course there are examples where rust code is separated from markdown files and included like:
{{#include testing/src/lib.rs:leftpad}}
But. Firstly, that means all the rust code should be excluded from md files and guides updated. Secondly, rust code contains comments that are translated. And translations can turn out to be longer than the source. And the result should also be tested. Thirdly, rustfmt seems to ignore long use expressions and long strings in macro arguments - leaves them as they are without errors.
Also the course has some code blocks with long shell commands and text output. Were left unchanged.
Summary questions:
- Should we exclude all rust code from markdown files?
- How can we validate rust code with translated comments?
- How to deal with
useand macros arguments that can still produce horizontal scrolling? - What to do with other code blocks with very long lines?
- Ngôn ngữ chính
- Rust
- Star
- 33.4k
- Fork
- 2.1k
- Merge trung bình
- 2 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 16
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọ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 google/comprehensive-rust
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
google/comprehensive-rust#2955 ·
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 68/100
google/comprehensive-rust#2733 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
google/comprehensive-rust#2732 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Minor suggested updates to the Collatz Sequence exercise in section 6.8 and its solution in section 6.8.1Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
google/comprehensive-rust#2636 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
google/comprehensive-rust#3155 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của google/comprehensive-rust
Issue tương tự
-
documentation enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
adorsys/status-list-server#619 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
batch-backport only backports the first 30 matching PRsCó thể đã có người làm @DvirDukhan đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 5 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/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 65/100
equinor/septic-config-generator#481 ·
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 76/100
Maintainer thường phản hồi trong vòng 1 ngày