file-links
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseFormat file references as markdown links
将文件引用格式化为Markdown链接
When referencing files in your output, always format them as markdown links. Use the GitHub-style fragment for line numbers.
#L在输出内容中引用文件时,请始终将其格式化为Markdown链接。使用GitHub风格的片段来指定行号。
#LFormat
格式
With a line number:
[filename.el:42](relative/path/to/filename.el#L42)With a line range:
[filename.el:42-50](relative/path/to/filename.el#L42-L50)Without a line number:
[filename.el](relative/path/to/filename.el)带行号的情况:
[filename.el:42](relative/path/to/filename.el#L42)带行号范围的情况:
[filename.el:42-50](relative/path/to/filename.el#L42-L50)不带行号的情况:
[filename.el](relative/path/to/filename.el)Important
注意事项
- The link text uses for line numbers (e.g.,
:).filename.el:42 - The URL uses for line numbers (e.g.,
#L).filename.el#L42 - For ranges, the link text uses (e.g.,
-) and the URL usesfilename.el:42-50(e.g.,-L).filename.el#L42-L50 - The range must appear in both the link text and the URL.
Do NOT do this:
[filename.el#L42-L50](filename.el#L42)- 链接文本使用来分隔行号(例如:
:)。filename.el:42 - URL使用来指定行号(例如:
#L)。filename.el#L42 - 对于行号范围,链接文本使用(例如:
-),URL使用filename.el:42-50(例如:-L)。filename.el#L42-L50 - 行号范围必须同时出现在链接文本和URL中。
请勿这样做:
[filename.el#L42-L50](filename.el#L42)Rules
规则
- Use paths relative to the project root.
- Include line numbers when they are relevant (e.g., error locations, function definitions, modified lines).
- Use line ranges when referring to a block of code.
- The link text should be the filename (or relative path if needed for clarity) followed by the line number.
- 使用相对于项目根目录的路径。
- 当行号相关时(例如错误位置、函数定义、修改的代码行),请包含行号。
- 引用代码块时使用行号范围。
- 链接文本应为文件名(如需清晰表达可使用相对路径)后跟行号。