1.1.42 • Published 12 months ago

@technote-space/anchor-markdown-header v1.1.42

Weekly downloads
9
License
MIT
Repository
github
Last release
12 months ago

anchor-markdown-header

npm version CI Status codecov CodeFactor License: MIT

Generates an anchor for a markdown header.

Table of Contents

Install

yarn add @technote-space/anchor-markdown-header

Example

import anchor from '@technote-space/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.
 */
1.1.41

1 year ago

1.1.42

12 months ago

1.1.40

1 year ago

1.1.39

1 year ago

1.1.38

2 years ago

1.1.37

2 years ago

1.1.36

2 years ago

1.1.34

2 years ago

1.1.33

2 years ago

1.1.32

2 years ago

1.1.35

2 years ago

1.1.31

2 years ago

1.1.30

3 years ago

1.1.29

3 years ago

1.1.28

3 years ago

1.1.27

3 years ago

1.1.26

3 years ago

1.1.25

3 years ago

1.1.24

3 years ago

1.1.23

3 years ago

1.1.22

3 years ago

1.1.21

3 years ago

1.1.20

3 years ago

1.1.19

3 years ago

1.1.18

3 years ago

1.1.17

3 years ago

1.1.16

3 years ago

1.1.15

3 years ago

1.1.14

3 years ago

1.1.13

3 years ago

1.1.12

3 years ago

1.1.11

3 years ago

1.1.10

3 years ago

1.1.9

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago