1
0
mirror of synced 2025-12-21 02:46:50 -05:00

Add documentation for line linking in Markdown (#20169)

* Add documentation for line linking in Markdown

* Slight rewording

Co-authored-by: Ethan P <56270045+ethanpalm@users.noreply.github.com>
This commit is contained in:
Emma Makinson
2021-06-30 13:39:54 +01:00
committed by GitHub
parent e1742aca90
commit 2a892d3653

View File

@@ -13,6 +13,8 @@ topics:
- Pull requests
shortTitle: Permanent links to code
---
## Linking to code
This type of permanent link will render as a code snippet only in the repository it originated in. In other repositories, the permalink code snippet will render as a URL.
![Code snippet rendered in a comment](/assets/images/help/repository/rendered-code-snippet.png)
@@ -34,6 +36,12 @@ This type of permanent link will render as a code snippet only in the repository
6. Paste your permalink into a comment, and click **Comment**.
![Pasted permalink in a comment in the same repository](/assets/images/help/repository/code-snippet-permalink-in-comment.png)
## Linking to Markdown
You can link to specific lines in Markdown files by loading the Markdown file without Markdown rendering. To load a Markdown file without rendering, you can use the `?plain=1` parameter at the end of the url for the file. For example, `github.com/<organization>/<repository>/blob/<branch_name>/README.md?plain=1`.
You can link to a specific line in the Markdown file the same way you can in code. Append `#L` with the line number or numbers at the end of the url. For example, `github.com/<organization>/<repository>/blob/<branch_name>/README.md?plain=1#L14` will highlight line 14 in the plain README.md file.
## Further reading
- "[Creating an issue](/articles/creating-an-issue/)"