1.3.3 • Published 2 years ago

highlightjs-focus v1.3.3

Weekly downloads
-
License
BSD-3-Clause
Repository
github
Last release
2 years ago

Highlight.js Focus Plugin

This plugin provide the ability to highlight a focused line when using Highlight.js

To use, first, register this plugin with addPlugin command:

hljs.addPlugin(new LineFocusPlugin({
    focusedStyle: {
        borderLeft: "2px solid #78e08f55",
        background: "#78e08f05",
        padding: "2px",
        paddingLeft: "10px",
    },
    unfocusedStyle: {
        borderLeft: "2px solid transparent",
        paddingLeft: "10px",
        opacity: "0.5",
        filter: "grayscale(1)"
    }
}));

Then in your code, or in your markdown source, add the language with the format:

<language>@focus=<lines>

For example:

js@focus=5,8:12,14
1.3.3

2 years ago

1.3.2

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago