You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/_index.md
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title = 'Flexible Syntax Highlighted Editable Textareas'
3
3
+++
4
4
5
-
# An <mark>editable</mark> `<textarea>` that supports *any* <mark>syntax highlighting</mark> algorithm, for code or something else. [Also, added plugins.](#TODO)
5
+
# An <mark>editable</mark> `<textarea>` that supports *any* <mark>syntax highlighting</mark> algorithm, for code or something else. [Also, added plugins.](plugins)
6
6
7
7
Aiming to be [more <mark>flexible</mark>, <mark>lightweight</mark>,
8
8
<mark>modular</mark>, <mark>progressively enhanced</mark> and
<!--A list of plugins are here, allowing a well-rounded code-editor to be created quickly from code-input, if you're into that: #TODO-->
100
+
<!--Additional usage details are here: https://code-input-js.org/#pages-->
101
+
<!--A list of plugins are here, allowing a well-rounded code-editor to be created quickly from code-input, if you're into that: https://code-input-js.org/plugins-->
102
102
</body>
103
103
</html>
104
104
```
105
105
106
-
#### highlight.js Code Editor (use **with vanilla HTML here** or [with ECMAScript Modules/Vue/Nuxt](#TODO)) {#demo-preset-hljs}
106
+
#### highlight.js Code Editor (use **with vanilla HTML here** or [with ECMAScript Modules/Vue/Nuxt](frameworks/hljs)) {#demo-preset-hljs}
<!--A list of plugins are here. We recommend the Autodetect plugin with highlight.js: #TODO-->
157
+
<!--Additional usage details are here: https://code-input-js.org/#pages-->
158
+
<!--A list of plugins are here. We recommend the Autodetect plugin with highlight.js: https://code-input-js.org/plugins-->
159
159
</body>
160
160
</html>
161
161
```
162
162
163
-
#### Editor with Custom Highlighting Algorithm (use **with vanilla HTML here** or [with ECMAScript Modules/Vue/Nuxt](#TODO)) {#demo-preset-custom}
163
+
#### Editor with Custom Highlighting Algorithm (use **with vanilla HTML here** or [with ECMAScript Modules/Vue/Nuxt](frameworks/custom)) {#demo-preset-custom}
164
164
165
165
```
166
166
<!--custom: TODO-->
@@ -189,7 +189,7 @@ Extensible With Plugins
189
189
</dt>
190
190
<dd>
191
191
192
-
Want coding features like easy indentation and closing of brackets, tools like find and replace and go to line, or better integration like custom autocomplete popups and processing of selected highlighted tokens? [Try a selection of the easy-to-use plugins.](#TODO) Plugin not available? [Make one yourself as a JavaScript class!](#TODO)
192
+
Want coding features like easy indentation and closing of brackets, tools like find and replace and go to line, or better integration like custom autocomplete popups and processing of selected highlighted tokens? [Try a selection of the easy-to-use plugins.](plugins) Plugin not available? [Make one yourself as a JavaScript class!](plugins/new)
title = 'How to use code-input and Custom Highlighting Algorithms with Vue or Nuxt'
3
+
+++
4
+
5
+
# How to use code-input and Custom Highlighting Algorithms with Vue or Nuxt
6
+
7
+
We plan to get documentation for this soon (contributions via a pull request are welcome!), but for now please use [the corresponding article for highlight.js](../hljs)[the demo frameworkless code for code-input and custom highlighting algorithms](../../#demo-preset-custom).
Copy file name to clipboardExpand all lines: docs/frameworks/hljs/index.md
+17-14Lines changed: 17 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,23 @@
1
-
# Vue/Nuxt Tutorial - For Highlight.js Integration
2
-
3
-
Vue and Nuxt have some similarities, but there is one big difference in how they can use this library. In Nuxt there is server side rendering (SSR) that will attempt to create the final HTML before sending the page to the browser. This cannot use any browser-specific things so the `code-input` component must be excluded from rendering until hydration in the browser.
1
+
+++
2
+
title = 'How to use code-input and highlight.js with Vue or Nuxt'
3
+
+++
4
+
5
+
# How to use code-input and highlight.js with Vue or Nuxt
4
6
5
-
> [!NOTE]
6
-
> The following demo is for integrating with `highlight.js` but if you follow the instructions in [the main README](../README.md) you can substitute highlight.js for Prism.js or a custom template.
7
+
> Contributors: 2025 Paul Rosen
7
8
9
+
Vue and Nuxt have some similarities, but there is one big difference in how they can use this library. In Nuxt there is server side rendering (SSR) that will attempt to create the final HTML before sending the page to the browser. This cannot use any browser-specific things so the `code-input` component must be excluded from rendering until hydration in the browser.
10
+
8
11
## Vue
9
12
10
13
### 1. Create a Vue app
11
14
12
15
First, create a Vue project. (If you already have a Vue project then you can skip this step). On a command line, type this:
13
-
```
16
+
```bash
14
17
npm create vue@latest
15
18
```
16
19
At the time this tutorial was created, the output was the following, after I named the project `syntax-highlighter` and checked "typescript":
title = 'How to use code-input and Prism.js with Vue or Nuxt'
3
+
+++
4
+
5
+
# How to use code-input and Prism.js with Vue or Nuxt
6
+
7
+
We plan to get documentation for this soon (contributions via a pull request are welcome!), but for now please use [the corresponding article for highlight.js](../hljs) and [the demo frameworkless code for code-input and Prism.js](../../#demo-preset-prism).
0 commit comments