A static file download component can be configured by using the
!file specifier in a link.
By default, the text of the file download component is not required. Retype will automatically use the file name as the text.
The text can be explicitly set by passing as the first part of the component config. In the following sample, we explicitly set the text to
Clicking anywhere within the file download component will trigger the web browser to download the static file.
icon used for the file download component can be customized using a name/value pair syntax for the
icon attributes. This allows for setting a custom
text value at the same time. The
icon attribute can be initialize with one of the following:
- Octicon name
:shortcode:(please see Mojee for a full list of supported Emoji shortcodes)
- Image file URL
The following samples demonstrate setting a custom
[!file icon="rocket"](/static/sample.txt) [!file icon=":rocket:"](/static/sample.txt) [!file icon="../static/retype-icon.svg"](/static/sample.txt)
By default, the file name is used as the component text value and the text can be customized by explicitly passing a separate
[!file icon="rocket" text="To the moon"](/static/sample.txt)