Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
gist-simple
Advanced tools
JS for Gist code block loading.
Use one of the following examples to import Gist Simple.
We provide a version of Gist Simple built as ESM (gist-simple.esm.js and gist-simple.esm.min.js) which allows you to use Gist Simple as a module in your browser, if your targeted browsers support it.
<script type="module">
import gistSimple from "gist-simple.esm.min.js";
</script>
<script type="module">
import gistSimple from "https://cdn.jsdelivr.net/npm/gist-simple@2/+esm";
</script>
Gist Simple may be also used in a traditional way by including script in HTML and using library by accessing window.gistSimple
.
<link type="text/css" rel="stylesheet" href="gist-simple.css">
<script src="gist-simple.min.js"></script>
<link type="text/css" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gist-simple@2/dist/gist-simple.css">
<script src="https://cdn.jsdelivr.net/npm/gist-simple@2/dist/gist-simple.min.js"></script>
Install Gist Simple as a Node.js module using npm
npm install gist-simple
Import Gist Simple by adding this line to your app's entry point (usually index.js
or app.js
):
import gistSimple from "gist-simple";
<div class="gist-simple" data-id="b58861072e53b12430ec2f78a99dbe4d" data-file="example-1.html"></div>
Note: You can use all available options as data attributes. For example: data-id
, data-file
, data-show-footer
, etc...
gistSimple(document.querySelector('.gist-simple'), {
id: 'b58861072e53b12430ec2f78a99dbe4d',
file: 'example-1.html',
});
$('.gist-simple').gistSimple({
id: 'b58861072e53b12430ec2f78a99dbe4d',
file: 'example-1.html',
});
Sometimes to prevent existing namespace collisions you may call .noConflict
on the script to revert the value of.
const gistSimplePlugin = $.fn.gistSimple.noConflict() // return $.fn.gistSimple to previously assigned value
$.fn.newGistSimple = gistSimplePlugin // give $().newGistSimple the Gist Simple functionality
Name | Type | Default | Description |
---|---|---|---|
id | string | `` | Gist ID. |
theme | string | system | Theme: system , light , dark . |
file | string | `` | Specific file name. |
caption | string | `` | Caption, that will be shown above code. |
lines | string | `` | Show only specific code lines. Example: "2", "1-5", "1,4", "1,4,6-8". |
linesExpanded | boolean | false | Hidden lines may be expanded. |
highlightLines | string | `` | Highlight specific code lines. Example: "2", "1-5", "1,4", "1,4,6-8". |
showFooter | boolean | true | Show footer section. |
showLineNumbers | boolean | true | Show line numbers section. |
enableCache | boolean | true | Enable AJAX caching. |
npm install
in the command linenpm run dev
to run build and start local server with files watchernpm run build
to run buildnpm run js-lint
to show eslint errorsnpm run js-lint-fix
to automatically fix some of the eslint errors[2.1.0] - May 6, 2024
theme
optionFAQs
JS for Gist code block loading
The npm package gist-simple receives a total of 7 weekly downloads. As such, gist-simple popularity was classified as not popular.
We found that gist-simple 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
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.