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
Configuration
If you want, you can add compatibility with :
To do that, adjust your mkdocs.yml
markdown_extensions:
- attr_list
- nl2br
- admonition
- pymdownx.details
plugins:
- search
- callouts
- custom-attributes:
file: 'assets/css/custom_attributes.css'
- embed_file:
callouts: true
custom-attribute: 'assets/css/custom_attributes.css' //need to be the same as in the config!
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.3.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0cc3ce71c45e2a4506159e210d037c9a5092260d8d66652331f5c73f8db0498f |
|
MD5 | 2824e244b5c561c8b161d5a20e10f613 |
|
BLAKE2b-256 | ebe4a8fa3ad2318650b0a21332aba338e033a89ce5c748b385c809154ae2d591 |
Close
Hashes for mkdocs_embed_file_plugins-1.3.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 589369438462433a77b19f6218aba7d6a25399736656198e0f9b63a2b68dc87c |
|
MD5 | bc4f7257233c6311359c9b4240421d7d |
|
BLAKE2b-256 | 20439a6277ca17261615eb4a88202094d050a74e7ff13f9006d759a52b5a856f |