Add a title that shows on hover
Put text in quotes after the address, inside the round brackets. Most browsers show it when the pointer rests on the link.
You write
[MarkdownPaper](https://markdownpaper.app "A reader for Markdown")You see
Turn a bare address into a link
Wrap the address in angle brackets. Many renderers, GitHub and MarkdownPaper among them, also turn an address written on its own into a link.
You write
<https://example.com>
Or just https://example.com on its own.You see
Or just https://example.com on its own.
Link to a section in the same file
Every heading gets an anchor, so you can link to it with # and the heading's
name. To work out the anchor, write the heading in lower case, swap spaces for
hyphens, and drop punctuation.
You write
## Install the app
Jump down to [Getting help](#getting-help).
## Getting help
Write to support.You see
| Heading | Anchor |
|---|---|
## Install | #install |
## Getting help | #getting-help |
## Step 1: Setup | #step-1-setup |
## FAQ & Help | #faq--help |
If two headings have the same text, the second one gets -1 on the end, the
third -2, and so on.
Link to another Markdown file
Use the path to the file, the same way you would in a web page. A path without
a leading / starts from the folder the current file is in.
You write
See the [setup notes](docs/setup.md) and the [changelog](../CHANGELOG.md).You see
See the setup notes and the changelog.
To land on a section in that file, add the anchor after the file name:
[database setup](docs/setup.md#database).
On GitHub these links work between files in the same repository. In the MarkdownPaper desktop app they open the other document, once it is in your library.
Reference links
When the same address is used many times, or a long address makes a sentence hard to read, give the link a label and put the address at the bottom.
You write
Read the [guide][1] and the [cheat sheet][sheet].
[1]: https://markdownpaper.app/guides/
[sheet]: https://markdownpaper.app/guides/markdown-cheat-sheet/You see
Read the guide and the cheat sheet.
The label lines do not show on the page.
Email links
Put the address in angle brackets, or use mailto: in a normal link.
You write
<hello@example.com>
[Write to us](mailto:hello@example.com)You see
A link on an image
Put the image syntax inside the square brackets of a link.
You write
[](https://markdownpaper.app)Common problems
- A space between
]and(.[text] (url)is not a link. Remove the space. - Spaces in the address. Replace each space with
%20, or wrap the address in angle brackets:[notes](<my notes.md>). - A section link that goes nowhere. Check the anchor is lower case, with hyphens for spaces and no punctuation.
- Brackets in the address. Write
)as%29so the address does not end early.
Questions
How do I make a link open in a new tab in Markdown?
Markdown has no way to do that. Some sites, MarkdownPaper included, open links
to other websites in a new tab on their own. Elsewhere you can write an HTML
link with target="_blank", but GitHub removes it.
How do I link to a specific line in a file?
On GitHub, add #L and the line number to the file's address, such as
setup.md#L20. That is a GitHub feature, not Markdown, so it does not work
elsewhere.
Why is my link showing as plain text?
Usually there is a space between the two brackets, or the round bracket is
missing. Look for [text](address) with nothing between ] and (.
How do I link to a heading with special characters?
Drop the special characters and keep the rest. ## FAQ & Help becomes
#faq--help: the & goes, and the two spaces around it become two hyphens.
Next
- How to add an image in Markdown, which uses almost the same syntax.
- Open any Markdown file as a page and test your links.
