Text viewer with line number.
https://luna.liriliri.io/?path=/story/text-viewer
Add the following script and style to your page.
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/luna-text-viewer/luna-text-viewer.css" />
<script src="//cdn.jsdelivr.net/npm/luna-text-viewer/luna-text-viewer.js"></script>
You can also get it on npm.
npm install luna-text-viewer --save
import 'luna-text-viewer/luna-text-viewer.css'
import LunaTextViewer from 'luna-text-viewer'
const textViewer = new LunaTextViewer(container)
textViewer.setOption({
text: 'Luna Text Viewer',
})
- escape(boolean): Whether to escape text or not.
- maxHeight(number): Max viewer height.
- showLineNumbers(boolean): Show line numbers.
- text(string): Text to view.
- wrapLongLines(boolean): Wrap lone lines.
Append text.