A plugin to quote file from docs
Project description
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-plugin
- Update your
mkdocs.yml
with :plugins: - search - roamlinks - embed_file
(the plugin have a dependency to roamlinks) - Override your
main.html
with :{% 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]] |
![](filename) |
Cite a heading part | ![[filename#heading]] |
![](filename#heading) |
Cite a block | ![[filename#^blockid]] |
![](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.css
You can find an example of custom css in docs
Credit
Thanks to midnightprioriem for the tooltip plugin.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for mkdocs_embed_file_plugins-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1f13016c78c55ab893720441a03f3967413658c4ab277499113810ecb5c9b14 |
|
MD5 | 38a2522d7295e69d72ca43b6db3c9cdf |
|
BLAKE2b-256 | 6cc581c12b06e9a97a47045d15d4bd081f8a371bfe1759d1af11b5c606cedfc1 |
Close
Hashes for mkdocs_embed_file_plugins-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc3e0a1411552a57470d1270efc1b06c6535a939a2c58e10fbd8487e1c71c9f8 |
|
MD5 | c4ff9e1b829fd586b6a7b552207d6ff7 |
|
BLAKE2b-256 | 2e2980a6f36eba1c9dc3646eea42414e4cbcad04c9d8d0ffcc2b59e11bcf1338 |