Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Markdown extension to wrap images in a lightbox.
Will only wrap images by adding "!" right after the opening "[" bracket of the image.
![!Description](/img/pic1.png)
This will Output :
<p>
<div class="lightgallery">
<a href="../img/pic1.png" data-sub-html="Description">
<img alt="Description" src="../img/pic1.png" />
</a>
</div>
</p>
The extension is made to work with lightgallery.js a full featured JavaScript lightgallery/lightbox with no dependencies.
Extension inspired by : mardown-lightbox
To test the extension:
import markdown
from lightgallery import LightGalleryExtension
print(markdown.markdown('![!description](/img/pic1.png)', extensions=[LightGalleryExtension()]))
$ pip install lightgallery
1. Create a theme folder will the following structure in your Mkdocs folder
theme/
|_ css/
|_ fonts/
|_ img/
|_ js/
2. Go to lightgallery.js GitHub or JSDELIVR to download the following files to the theme sub-folders as listed below
3. Create a theme/main.hml file and add the following code to the file
{% extends "base.html" %}
{% block styles %}
{{ super() }}
<link rel="stylesheet" href="{{ base_url }}/css/lightgallery.min.css">
{% endblock styles %}
{% block libs %}
{{ super() }}
<script src="{{ base_url }}/js/lightgallery.min.js"></script>
{% endblock libs %}
{% block scripts %}
{{ super() }}
<script>
var elements = document.getElementsByClassName("lightgallery");
for(var i=0; i<elements.length; i++) {
lightGallery(elements[i]);
}
</script>
{% endblock scripts %}
4. Modify the mkdocs.yml file to add the following settings
# Documentation and theme
theme:
custom_dir: 'theme'
# Extensions
markdown_extensions:
- lightgallery
5. Change extension settings in mkdocs.yml
All settings of the extension are optional and can be omitted.
# Extensions
markdown_extensions:
- lightgallery:
show_description_in_lightgallery: true | false
show_description_as_inline_caption: true | false
custom_inline_caption_css_class: 'my-caption-class'
Setting | Description | Default Value |
---|---|---|
show_description_in_lightgallery | Adds the description as caption in lightgallery dialog. | true |
show_description_as_inline_caption | Adds the description as inline caption below the image. | false |
custom_inline_caption_css_class | Custom CSS classes which are applied to the inline caption paragraph. Multiple classes are separated via space. | Empty |
MIT License
FAQs
Markdown extension to wrap images in lightbox/lightgallery
We found that lightgallery 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.