Skip to content

Commit

Permalink
fix: replace all usage of @docs-tools/transform with diplodoc
Browse files Browse the repository at this point in the history
  • Loading branch information
main-kun committed Mar 18, 2024
1 parent d216600 commit 5a3edf4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions en/plugins/import.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ npm i markdown-it-emoji

```javascript
const fs = require('fs');
const transform = require('@doc-tools/transform');
const cut = require('@doc-tools/transform/lib/plugins/cut');
const sup = require('@doc-tools/transform/lib/plugins/sup');
const transform = require('@diplodoc/transform');
const cut = require('@diplodoc/transform/lib/plugins/cut');
const sup = require('@diplodoc/transform/lib/plugins/sup');
const emoji = require('markdown-it-emoji');
const content = fs.readFileSync(filePath, 'utf');
const {result: {html, meta}, logs} = transform(content, {plugins: [cut, sup, emoji]});
```

{% note warning %}

When overriding the `plugins` parameter, you must reconnect [YFM plugins](index.md). To do this, import them from the `@doc-tools/transform` package and pass them in the plugin array.
When overriding the `plugins` parameter, you must reconnect [YFM plugins](index.md). To do this, import them from the `@diplodoc/transform` package and pass them in the plugin array.

{% endnote %}

Expand Down
2 changes: 1 addition & 1 deletion en/syntax/additional.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ You can vote to include footnote support in YFM by default in [GitHub issues](ht

Import plugin from package like so:
```
const checkbox = require('@doc-tools/transform/lib/plugins/checkbox');
const checkbox = require('@diplodoc/transform/lib/plugins/checkbox');
```

The task list is a list of checkboxes. A normal item is represented by the `- [ ]` symbol, a checked one by `- [x]`. You can use [line formatting](./base.md#line) in the task description.
Expand Down
2 changes: 1 addition & 1 deletion en/tools/transform/highlight.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ A set of languages is passed as an object, with:
* A function that defines the language as the value.

```javascript
const transform = require('@doc-tools/transform');
const transform = require('@diplodoc/transform');
const customLang = require('./custom-lang');

const highlightLangs = { 'custom-lang': customLang };
Expand Down
10 changes: 5 additions & 5 deletions en/tools/transform/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Transformer

[@doc-tools/transform](https://www.npmjs.com/package/@doc-tools/transform) is a package for converting Yandex Flavored Markdown to HTML.
[@diplodoc/transform](https://www.npmjs.com/package/@diplodoc/transform) is a package for converting Yandex Flavored Markdown to HTML.

Use it in your code to work with text during program execution. For example, to display user-generated content.

Expand All @@ -15,17 +15,17 @@ Use it in your code to work with text during program execution. For example, to
1. Add the package in your code using the `require()` or `import()` function:
```javascript
const transform = require('@doc-tools/transform');
const transform = require('@diplodoc/transform');
```

1. To ensure text is displayed properly, add CSS styles and client scripts to the project:

```css
@import '~@doc-tools/transform/dist/css/yfm.css';
@import '~@diplodoc/transform/dist/css/yfm.css';
```

```javascript
import '@doc-tools/transform/dist/js/yfm';
import '@diplodoc/transform/dist/js/yfm';
```

## Usage {#use}
Expand Down Expand Up @@ -56,7 +56,7 @@ The package provides the `transform()` function:
```javascript
const fs = require('fs');
const transform = require('@doc-tools/transform');
const transform = require('@diplodoc/transform');
const content = fs.readFileSync(filePath, 'utf');
const vars = { user: { name: 'Alice' } };
Expand Down

0 comments on commit 5a3edf4

Please sign in to comment.