Mkdocs plugin which shows embedded links in a more elegant manner.
Project description
Link Embeds Plugin: mkdocs
About
Requires mkdocs to function.
This plugin allows you to display embedded links in a more elegant and modern way with the use of markdown codeblocks. You may either specify a URL and let the plugin auto-fill in details such as the site description and title, or you can override the auto-generated values and add your own.
Install
pip install beautifulsoup4
pip install mkdocs-link-embeds-plugin
Once you install the packages above, open your mkdocs.yml
and add a few new lines:
plugins:
- link-embeds:
enabled: true
default_name: "Untitled Link"
default_desc: "No description found"
default_image: "https://path/to/default/image.png"
extra_css:
- path/to/link-embeds.css
Ensure you download the contents of mkdocs_link_embeds_plugin/resources/link-embeds.css
and place the file in your mkdocs directory. It must be placed in the path you specified under extra_css
in the mkdocs.yml config above.
Usage
Once you have installed this plugin, you may now create a new page in your mkdocs project and insert a new codeblock with the following syntax:
```embed
url: https://github.com/mkdocs/mkdocs/releases
image: https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQjFUDe-vdiprKpCsiLoRmfCdUq0WS5tqUR9fyEzJjQ0g&s
name: Github: Download Mkdocs
desc: MkDocs is a fast, simple and downright gorgeous static site generator that's geared towards building project documentation. Documentation source files are written in Markdown, and configured with a single YAML configuration file. It is designed to be easy to use and can be extended with third-party themes, plugins, and Markdown extensions.
```
This plugin takes 4 values:
url
: The URL to the linkimage
: Image to display on the left side of each embedded website.name
: Name / Title to show at the top of each embeddesc
: A description of what the site is for.
The only required value is url
.
If you provide only the url
, and leave the others out; the plugin will attempt to check if your URL is valid, and then auto-fetch the metadata for that website. It will be used to populate the fields you did not provide.
If you do provide values such as desc
, name
, or image
; those user inputs will take priority over the automatically fetched values.
Other
This plugin was originally based on mkdocs-link-preview-plugin
. However, that plugin stopped being updated, and the style needed to be modernized. As well as giving more control for customization.
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
File details
Details for the file mkdocs-link-embeds-plugin-0.1.2.tar.gz
.
File metadata
- Download URL: mkdocs-link-embeds-plugin-0.1.2.tar.gz
- Upload date:
- Size: 10.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff1a958f1815dc6c918ba0ec0275687149a34672898985a2db64ffdd7dd74b88 |
|
MD5 | 4052d4d4fc3da9753ce6bacf3a048c3e |
|
BLAKE2b-256 | 3c92502edd1c4fbce38ee026b8365588b56f755dfd03297139f43fb437a28734 |