Skip to content

Commit

Permalink
Merge pull request #516 from wedge-jarrad/download-link-example
Browse files Browse the repository at this point in the history
Add download link example
  • Loading branch information
awanlin authored Jul 20, 2024
2 parents a3d8b4a + dcfe317 commit bb438e4
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
24 changes: 24 additions & 0 deletions docs/examples/download.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Download Links

## Overview

This page shows how you can create a link that will cause a file to be
downloaded when clicked.

## Example

Here is an example:

[Hello world code sample](./files/sample1.py){: download="hello.py"}

## Markdown

Here is the Markdown:

```MD
[Hello world code sample](./files/sample1.py){: download="hello.py"}
```

Note that the name specified after `download=` is the name the file will be
given when it is downloaded. This does not need to be the same as the name of
the file on the server side.
5 changes: 5 additions & 0 deletions docs/examples/files/sample1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env python
# vim: ts=4 sw=4 et

if __name__ == '__main__':
print('Hello world!')
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ This set of documentation is intended to show simple working examples of TechDoc

Current examples:

- [Download Links](./examples/download.md): this shows how you can create a link that will cause a file to be downloaded
- [iframe](./examples/iframe.md): this shows how you can use an iframe in your TechDocs
- [Lists](./examples/lists.md): this showcases how to setup your lists in TechDocs
- [Mermaid](./examples/mermaid.md): this showcases how to use Mermaid diagrams in your TechDocs
Expand Down

0 comments on commit bb438e4

Please sign in to comment.