Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: install correct package in docs #26

Merged
merged 2 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
12 changes: 6 additions & 6 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 @@ -9,23 +9,23 @@ Use it in your code to work with text during program execution. For example, to
1. Install a package:

```shell
npm i @doc-tools/transform
npm i @diplodoc/transform
```

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
Loading