Links
The standard markup for a link looks like this:
[текст_ссылки](ссылка "текст_подсказки")
link_text— explicit specification of the link text.link— URL or file path."tooltip_text"— a tooltip that will be displayed when hovering over the link text. Optional parameter.
Depending on the type of link, simplifications and other formatting options are allowed.
Opening in a new tab
By default, all relative links open in the current browser tab, and all absolute links open in a new tab. You can override this behavior using the target attribute.
Examples:
[text](link){target=_blank}— will open in a new tab,[text](link){target=_self}— will open in the current tab.
Link to an md file
You can create a link to an md file without explicitly specifying the link text. To do this, add the character combination {#T} in place of the text, and it will be substituted automatically from the heading of the specified file.
[Syntax](./index.md)
Result
Link to a section in an md file
You can link to:
-
a section on the current page;
[text](#anchor)Result
-
a section on another page.
[text](base.md#headers)Result
Restriction of relative paths in HTML
In HTML links, use absolute paths from the documentation root.
Example:
<a href="/root_folder/path_to_file">Ссылка</a>
URL or email address
To convert a URL or email address into a link, add angle brackets <> on both sides.
<https://yandex.com/>
<alice.the.girl@yandex.com>
Result
Reference-style markup for links
Use reference-style links to make the source text of the document easier to read. Links of this type consist of two parts connected by labels:
-
a brief description of the link in the text.
[link_text][link_label] -
a long URL placed in a special location at the end of a paragraph or document.
[link_label]: URL
My favorite search engine is [Yandex][1].
[1]: https://yandex.com/ "The best search engine"
Result
My favorite search engine is Yandex.
Link text formatting
You can apply inline formatting to the link text.
I love the **[Yandex Cloud](https://cloud.yandex.com)**.
This is the _[YFM Guide](https://yadocs.tech)_.
See the section on [`code`](#code).
Super [^men^](https://en.wikipedia.org/wiki/Major_Grom_(2017_film)).
Result
I love the Yandex Cloud.
This is the YFM Guide.
See the section on code.
Super men.
Links for downloading files
To provide files for download, upload them to an external storage.
Then use a link to the external source as a link to the file. You can use a special link with a file icon. After clicking such a link, the browser will start downloading the specified file to the device.
{% file src="data:text/plain;base64,Cg==" name="empty.txt" %}