@singapore-editor/minimap
v0.2.15
Published
A worker-rendered file overview with scroll controls for the Singapore editor.
Maintainers
Readme
@singapore-editor/minimap
A worker-rendered file overview with scroll controls for the Singapore editor.
Part of Singapore. A code editor for the browser that keeps every version.
Install
npm install @singapore-editor/core @singapore-editor/minimapUsage
import { Editor } from '@singapore-editor/core/editor'
import { createMinimapPlugin } from '@singapore-editor/minimap'
const host = document.createElement('div')
host.style.height = '400px'
document.body.append(host)
const editor = new Editor(host, {
plugins: [createMinimapPlugin({ side: 'right', showSlider: 'always' })],
})
editor.setText('const value = 1\n')API highlights
createMinimapPlugin()adds the overview.sidechooses its edge.showSlidercontrols the viewport marker.
In the Singapore family
@singapore-editor/core owns the editor view. Add this plugin for a file overview beside the text.
Use a bundler that serves the package worker and data assets. See the hosting guide.
Singapore README · Documentation
License
MIT. License
