Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
mkdocs-embed-file-plugins
Advanced tools
A way to embed a file present in your docs. Support both wikilinks & normal links. Intended to be used by obsidian user.
pip install mkdocs-embed-file-plugins
mkdocs.yml
with :
plugins:
- search
- embed_file
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 %}
[!IMPORTANT] You need to set the
site_url
in themkdocs.yml
to make the plugin work.
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) |
The plugin will create :
<a href="original link" class="link_citation"><i class='fas fa-link'></i></a>
<div class="citation">content founded</div>
<div class='citation'><a class='link_citation'><i class='fas fa-link'></i></a><p style="text-align: center; display: block"><i class="not_found"> link_alt </i> {a configured message}</p></div>
The message for the not found file can be customized in mkdocs.yml
. The default message is file not exists
.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
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!
language_message: 'file not exists.'
Note : Every extension set in markdown_extensions
will be used for the converting, so you can use any extension you want.
Thanks to midnightprioriem for the tooltip plugin.
FAQs
A plugin to quote file from docs
We found that mkdocs-embed-file-plugins demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.