A simple and lightweight code editor for the web.
| en-US | 中文 |
For many users who want to experience the tool, CDN is a good choice. You can directly introduce this tool into your project and start using it. You may have different usage habits. Here I provide you with several simple methods to introduce this tool. Below are some simple example links, you can click to view the corresponding files.
-
esm is a good choice, it allows you to use the import syntax to introduce this tool in the project. This is also the default export method of shiki, which is relatively convenient to use.
-
The pluggability of functions has always been a very important part of my code design philosophy. Here you can see how to introduce function expansion plugins.
-
If you don't want to use esm, then umd might be a good choice. It allows you to use the script tag to introduce this tool in the project. (But in fact, for shiki, it may not be a good example, I need some time to make it better reflect the advantages of umd)
For some users who want to use this tool in the compilation process, it may be a better choice to install dependencies through package management and then introduce this tool in the code.
- Install dependencies
npm install @shikitor/core
# If you are using yarn
yarn add @shikitor/core
- Introduce in the code
import '@shikitor/core/index.css'
import { create } from '@shikitor/core'
const shikitor = create(document.getElementById('editor'), {
value: 'console.log("Hello, Shikitor!")',
language: 'javascript',
theme: 'github-light'
})
You can use Tab
to indent the current line or selected lines, and use Shift + Tab
to outdent.
Building...
MIT