mdast-util-inject

WebJar for mdast-util-inject

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

mdast-util-inject
Последняя версия

Последняя версия

1.1.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

mdast-util-inject
WebJar for mdast-util-inject
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/anandthakker/mdast-util-inject

Скачать mdast-util-inject

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/mdast-util-inject/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>mdast-util-inject</artifactId>
    <version>1.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/mdast-util-inject/
implementation 'org.webjars.npm:mdast-util-inject:1.1.0'
// https://jarcasting.com/artifacts/org.webjars.npm/mdast-util-inject/
implementation ("org.webjars.npm:mdast-util-inject:1.1.0")
'org.webjars.npm:mdast-util-inject:jar:1.1.0'
<dependency org="org.webjars.npm" name="mdast-util-inject" rev="1.1.0">
  <artifact name="mdast-util-inject" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='mdast-util-inject', version='1.1.0')
)
libraryDependencies += "org.webjars.npm" % "mdast-util-inject" % "1.1.0"
[org.webjars.npm/mdast-util-inject "1.1.0"]

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
org.webjars.npm : mdast-util-to-string jar [1.0.0,2)

Модули Проекта

Данный проект не имеет модулей.

Circle CI js-standard-style

An mdast utility to inject some markdown into some other markdown, keeping heading structure intact.

Install

npm install mdast-util-inject

Usage

inject

Inject some markdown into some other markdown at a desired heading. Heading levels in the source markdown are adjusted to match the target document based on the target heading's level. targetAst is modified in place

Parameters

  • targetHeadingText string The heading to look for in the target ast
  • targetAst object The target markdown document, as an mdast
  • toInjectAst object The source markdown to be injected into the target, also as an mdast.

Examples

var mdast = require('mdast')
var inject = require('mdast-util-inject')

var target = mdast.parse('# A document\n## Section1\nBlah\n## Section2\nBlargh')
var newStuff = mdast.parse('# Some other document\nwith some content')
inject('Section1', target, newStuff)

console.log(mdast.stringify(target))
// outputs:
// # A document
//
// ## Section1
//
// ### Some other document
//
// with some content
//
// ## Section2
//
// Blargh

Returns boolean whether the specified section was found and content inserted

Версии библиотеки

Версия
1.1.0