anchor-markdown-header
Generates an anchor for a markdown header.
Last updated 9 years ago by thlorenz .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install anchor-markdown-header 
SYNC missed versions from official npm registry.

anchor-markdown-header build status

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] [, moduleName] [, repetition)

/**
 * @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 moduleName  {String} The name of the module of the given header (required only for 'nodejs.org' mode).
 * @return            {String} The header anchor that is compatible with the given mode.
 */

Current Tags

  • 0.5.7                                ...           latest (9 years ago)

23 Versions

  • 0.5.7                                ...           9 years ago
  • 0.5.6                                ...           9 years ago
  • 0.5.5                                ...           10 years ago
  • 0.5.4                                ...           11 years ago
  • 0.5.3                                ...           11 years ago
  • 0.5.2                                ...           11 years ago
  • 0.5.1                                ...           11 years ago
  • 0.5.0                                ...           11 years ago
  • 0.4.1                                ...           11 years ago
  • 0.4.0                                ...           12 years ago
  • 0.3.8                                ...           12 years ago
  • 0.3.7                                ...           12 years ago
  • 0.3.6                                ...           12 years ago
  • 0.3.5                                ...           12 years ago
  • 0.3.4                                ...           12 years ago
  • 0.3.3                                ...           12 years ago
  • 0.3.2                                ...           13 years ago
  • 0.3.1                                ...           13 years ago
  • 0.3.0                                ...           13 years ago
  • 0.2.1                                ...           13 years ago
  • 0.2.0                                ...           13 years ago
  • 0.1.2                                ...           13 years ago
  • 0.1.1                                ...           13 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 23
Last Day 0
Last Week 23
Last Month 1
Dependencies (1)
Dev Dependencies (1)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |