Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
A tiny JavaScript utility for adding deep anchor links (like these) to existing page content.
By default, AnchorJS displays a link icon appended to an element which is made visible on hover.
Deep links are useful for linking to specific places in online books and documentation (like, for example, this README file when rendered on the Github project page--hover over headings to see what I mean).
Download AnchorJS via npm:
npm install anchor-js
or alternatively via bower:
bower install anchor-js --save-dev
Include the anchor.js file (or alternatively anchor.min.js) in your webpage.
<script src="anchor.js"></script>
For the default anchor link styling (demonstrated in the demo) you should also include anchor.css.
<link rel="stylesheet" href="anchor.css">
Alternatively, you can provide your own styling.
AnchorJS provides the addAnchors()
method for adding anchors to the page. This method accepts a selector as a parameter in the form of a string. The selector can be used to target specific elements that you want to add anchors to. Here's an example.
/**
* Example 1
* Add anchors to all h1's on the page
*/
addAnchors('h1');
/**
* Example 2
* Adds anchors to elements that have been assigned the class '.anchored'
*/
addAnchors('.anchored');
/**
* Example 3
* Adds anchors to all h1, h2, & h3's inside a container with an ID of '#post'
*/
addAnchors('#post h1, #post h2, #post h3');
/**
* Example 4
* If no selector is provided, it falls back to a default selector of 'h1, h2, h3, h4, h5, h6'
* which adds anchors to all headings.
*/
addAnchors();
Currently Supports: IE9+ and modern browsers
Licensed with the MIT License.
FAQs
A JavaScript utility for adding deep anchor links to online docs.
The npm package anchor-js receives a total of 2,370 weekly downloads. As such, anchor-js popularity was classified as popular.
We found that anchor-js demonstrated a not healthy version release cadence and project activity because the last version was released 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 supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.