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-plugins
- Update your
mkdocs.yml
with :plugins: - search - embed_file
- 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
Limitation
- The embed file don't use plugin you would use.
- Wikilinks ambiguity are not supported : the first file with the name are used.
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.2.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7623df751005138c1035d28e58ff7ccfa799a3c51b7eb6326912a5b7542602d8 |
|
MD5 | cc69c574a0187ea3ee4ffb94f67410f6 |
|
BLAKE2b-256 | a33c0a3b4578dc08b98472dac349eedb25a92bb5870382573067c861ab23b8da |
Close
Hashes for mkdocs_embed_file_plugins-1.2.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93c4d12dcfb849c26765eb309124be4f4b91301bad0d2169170f22aaee29ebe2 |
|
MD5 | 48213bbb1aee15252b63737ce8cbf2cf |
|
BLAKE2b-256 | fe10bd23615ad4ec9a326f00595d54dcab61b85a4debf1af3838437891a0b6c2 |