anchor-markdown-header
Generates an anchor for a markdown header.
Last updated 7 months ago by GitHub Actions .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install anchor-markdown-header 
SYNC missed versions from official npm registry.

anchor-markdown-header Node.js CI

Generates an anchor for a markdown header.

Example

var anchor = require('anchor-markdown-header');

anchor('"playerJoined" (player)'); 
// --> ["playerJoined" (player)](#playerjoined-player)

anchor('fs.rename(oldPath, newPath, [callback])', 'nodejs.org', 'fs') 
// --> [fs.rename(oldPath, newPath, [callback])](#fs_fs_rename_oldpath_newpath_callback)

// github.com mode is default
anchor('"playerJoined" (player)') === anchor('"playerJoined" (player)', 'github.com'); 
// --> true

API

anchor(header[, mode] [, repetition] [, href])

/**
 * @name anchorMarkdownHeader
 * @function
 * @param header      {String} The header to be anchored.
 * @param mode        {String} The anchor mode (github.com|nodejs.org|bitbucket.org|ghost.org|gitlab.com).
 * @param repetition  {Number} The nth occurrence of this header text, starting with 0. Not required for the 0th instance.
 * @param href        {String} The href to be used in the anchor.
 * @return            {String} The header anchor that is compatible with the given mode.
 */

Current Tags

  • 0.8.0                                ...           backfill (10 months ago)
  • 0.8.4                                ...           latest (7 months ago)

30 Versions

  • 0.8.4                                ...           7 months ago
  • 0.8.3                                ...           8 months ago
  • 0.8.2                                ...           10 months ago
  • 0.8.0                                ...           10 months ago
  • 0.8.1                                ...           10 months ago
  • 0.7.0                                ...           4 years ago
  • 0.6.0                                ...           4 years ago
  • 0.5.7                                ...           10 years ago
  • 0.5.6                                ...           10 years ago
  • 0.5.5                                ...           10 years ago
  • 0.5.4                                ...           11 years ago
  • 0.5.3                                ...           12 years ago
  • 0.5.2                                ...           12 years ago
  • 0.5.1                                ...           12 years ago
  • 0.5.0                                ...           12 years ago
  • 0.4.1                                ...           12 years ago
  • 0.4.0                                ...           12 years ago
  • 0.3.8                                ...           13 years ago
  • 0.3.7                                ...           13 years ago
  • 0.3.6                                ...           13 years ago
  • 0.3.5                                ...           13 years ago
  • 0.3.4                                ...           13 years ago
  • 0.3.3                                ...           13 years ago
  • 0.3.2                                ...           14 years ago
  • 0.3.1                                ...           14 years ago
  • 0.3.0                                ...           14 years ago
  • 0.2.1                                ...           14 years ago
  • 0.2.0                                ...           14 years ago
  • 0.1.2                                ...           14 years ago
  • 0.1.1                                ...           14 years ago
Downloads
Total 128
Today 0
This Week 0
This Month 28
Last Day 0
Last Week 0
Last Month 35
Dependencies (2)
Dev Dependencies (1)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE