diplodoc-platform / diplodoc-platform/transform

Support for Code Block Line Highlighting in YFM

Open
#535 0 comments 0 reactions 0 assignees View on GitHub
enhancement good first issue
Dominant language
TypeScript
Stars
69
Forks
59
Avg merge
1d 21h
Merged PRs (30d)
6

Description

It would be beneficial if YFM supported line highlighting within code blocks. This feature is frequently used in documentation to draw attention to critical lines of code, demonstrate changes, or emphasize specific parts of the code.

### Proposed Solution
Introduce a new prop, `{1,3-5}`, within the language meta string of code blocks.

### Syntax Example

```
```javascript {1}
const example = "This is a code block.";
console.log(examples);
```

Reference: https://docusaurus.io/docs/markdown-features/code-blocks#line-numbering

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.