Embed File
A way to embed a file present in your docs. Support both wikilinks & normal links. Intended to be used by obsidian user.
Activate the plugin
- Run
pip install mkdocs-embed-file-plugins - Update your
mkdocs.ymlwith :(the plugin have a dependency to roamlinks)plugins: - search - roamlinks - embed_file
- Override your
main.htmlwith :{% extends "base.html" %} {% block extrahead %} <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.15.4/css/fontawesome.min.css" integrity="sha384-jLKHWM3JRmfMU0A5x5AkjWkw/EYfGUAGagvnfryNV3F9VqM98XiIH7VBGVoxVSc7" crossorigin="anonymous"> {% endblock %}
Usage
| Usage | wikilinks | markdown links |
|---|---|---|
| cite a entire file | ![[filename]] |
 |
| Cite a heading part | ![[filename#heading]] |
 |
| Cite a block | ![[filename#^blockid]] |
 |
CSS
The plugin will create :
- A link to the original file, with the form of :
<a href="original link" class="link_citation"><i class='fas fa-link'></i></a> - A div with the founded content :
<div class="citation">content founded</div> - In case of the link / contents is not found :
<div class="not_found">filename#part</div>
You can add a css in your docs/assets/css (or whatever the path is), and add it to your mkdocs.yml :
extra_css:
- assets/css/embed_link.cssYou can find an example of custom css in docs
Limitation
The embed file don't use plugin you would use, as wikilinks for example.
Credit
Thanks to midnightprioriem for the tooltip plugin.

