markdown-it-anchor

  • Version 9.1.0
  • Published
  • 136 kB
  • No dependencies
  • Unlicense license

Install

npm i markdown-it-anchor
yarn add markdown-it-anchor
pnpm add markdown-it-anchor

Overview

Header anchors for markdown-it.

Index

Functions

function anchor

anchor: typeof anchor;

    Namespaces

    namespace anchor

    namespace anchor {}
      const permalink: {
      headerLink: (opts?: HeaderLinkPermalinkOptions) => PermalinkGenerator;
      linkAfterHeader: (opts?: LinkAfterHeaderPermalinkOptions) => PermalinkGenerator;
      linkInsideHeader: (
      opts?: LinkInsideHeaderPermalinkOptions
      ) => PermalinkGenerator;
      ariaHidden: (opts?: AriaHiddenPermalinkOptions) => PermalinkGenerator;
      };

        interface AnchorInfo

        interface AnchorInfo {}

          property slug

          slug: string;

            property title

            title: string;

              interface AnchorOptions

              interface AnchorOptions {}

                property level

                level?: number | number[];
                  permalink?: PermalinkGenerator;

                    property tabIndex

                    tabIndex?: number | false;

                      property uniqueSlugStartIndex

                      uniqueSlugStartIndex?: number;

                        method callback

                        callback: (token: Token, anchor_info: AnchorInfo) => void;

                          method getTokensText

                          getTokensText: (tokens: Token[]) => string;

                            method slugify

                            slugify: (str: string) => string;

                              method slugifyWithState

                              slugifyWithState: (str: string, state: State) => string;

                                interface AriaHiddenPermalinkOptions

                                interface AriaHiddenPermalinkOptions extends PermalinkOptions {}

                                  property placement

                                  placement?: 'before' | 'after';

                                    property space

                                    space?: boolean | string;

                                      interface HeaderLinkPermalinkOptions

                                      interface HeaderLinkPermalinkOptions extends PermalinkOptions {}

                                        property safariReaderFix

                                        safariReaderFix?: boolean;

                                          interface LinkAfterHeaderPermalinkOptions

                                          interface LinkAfterHeaderPermalinkOptions extends PermalinkOptions {}

                                            property assistiveText

                                            assistiveText?: (title: string) => string;

                                              property placement

                                              placement?: 'before' | 'after';

                                                property space

                                                space?: boolean | string;

                                                  property style

                                                  style?:
                                                  | 'visually-hidden'
                                                  | 'aria-label'
                                                  | 'aria-describedby'
                                                  | 'aria-labelledby';

                                                    property visuallyHiddenClass

                                                    visuallyHiddenClass?: string;

                                                      property wrapper

                                                      wrapper?: [string, string] | null;

                                                        interface LinkInsideHeaderPermalinkOptions

                                                        interface LinkInsideHeaderPermalinkOptions extends PermalinkOptions {}

                                                          property ariaHidden

                                                          ariaHidden?: boolean;

                                                            property placement

                                                            placement?: 'before' | 'after';

                                                              property space

                                                              space?: boolean | string;

                                                                interface PermalinkOptions

                                                                interface PermalinkOptions {}

                                                                  property class

                                                                  class?: string;

                                                                    property renderAttrs

                                                                    renderAttrs?: RenderAttrs;

                                                                      property renderHref

                                                                      renderHref?: RenderHref;

                                                                        property symbol

                                                                        symbol?: string;

                                                                          type PermalinkGenerator

                                                                          type PermalinkGenerator = (
                                                                          slug: string,
                                                                          opts: PermalinkOptions,
                                                                          state: State,
                                                                          index: number
                                                                          ) => void;

                                                                            type RenderAttrs

                                                                            type RenderAttrs = (slug: string, state: State) => Record<string, string | number>;

                                                                              type RenderHref

                                                                              type RenderHref = (slug: string, state: State) => string;

                                                                                Package Files (1)

                                                                                Dependencies (0)

                                                                                No dependencies.

                                                                                Dev Dependencies (7)

                                                                                Peer Dependencies (2)

                                                                                Badge

                                                                                To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/markdown-it-anchor.

                                                                                • Markdown
                                                                                  [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/markdown-it-anchor)
                                                                                • HTML
                                                                                  <a href="https://www.jsdocs.io/package/markdown-it-anchor"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>