Loon 是一个基于 React 的协作编辑器,旨在提供一个高效、易用的写博客、项目文档或技术文档的工具,它类似于 Jekyll、 Hugo 等其他流行的博客编辑器,但通过 React 的语法和框架,提供了更强大的功能和更好的支持,以下是 Loon 的使用指南:
- 安装:使用 npm 安装 Loon:
npm install loon
- 登录:通过 web 界面登录:
- 打开浏览器,访问 https://localhost:3,然后找到 Loon 的page。
- 或者使用 web 界面登录:https://loon.js.org。
界面和布局
Loon 的界面类似于 Jekyll,使用 Bootstrap 和 Tailwind CSS 基础布局:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.">Loon</title>
<link href="https://unpkg.com-loon@latest/dist/loon.min.css" rel="stylesheet">
<style>
.container {
max-width: 1px;
margin: 0 auto;
padding: 2px;
}
</style>
</head>
<body>
<div class="container">
<!-- 播放器 -->
<div class="player">
<Audio src="https://player.jsloop.io" playloop>
</div>
<!-- 其他内容 -->
</div>
使用 Loon
- 网页:直接在网页上编辑 HTML:
<!DOCTYPE html> <html> <head> <script src="https://unpkg.com-loon@latest/dist/loon.js"></script> </head> <body> <div id="content"></div> </body> </html>
- 网页段落:直接在网页段落上编辑 HTML:
<p class="loons-light mb-4"> This is a paragraph. <br> This is a paragraph. <br> This is a paragraph. <br> This is a paragraph. </p>
- 代码块:直接在代码块上编辑代码:
<!DOCTYPE html> <html> <head> <script src="https://unpkg.com-loon@latest/dist/loon.js"></script> </head> <body> <div id="code"></div> <div id="code-container"> <pre id="pre"></pre> <div class="code"> <code class="language-javascript"> function hello() { console.log("Hello, world!"); } } </div> </div> </div> - 表格:直接在表格上编辑表格:
<!DOCTYPE html> <html> <head> <script src="https://unpkg.com-loon@latest/dist/loon.js"></script> </head> <body> <table> <thead> <tr> <th>Header 1</th> <th>Header 2</th> </tr> </thead> <tbody> <tr> <td>Data 1</td> <td>Data 2</td> </tr> </tbody> </table> - 预览:在代码块或 HTML 段落中使用
pre格式的代码,预览时会自动显示为纯文本:<!-- 预览 --> <pre id="pre"></pre>
常见问题
- 代码块位置:代码块位于 HTML 表格的下方,使用
code- 预览:代码块中的 HTML 会被预览为纯文本。
- 预览图:使用
pre格式的 HTML 表格会自动预览。
文档和教程
常用快捷键
- Ctrl+B:显示预览
- Ctrl+B (Ctrl+J):预览和代码
- Ctrl+B (Ctrl+V):预览和 HTML 表格
- Ctrl+A:选中
- Ctrl+S:保存
- Ctrl+P:预览
希望这些建议对你有帮助!如果有其他问题,欢迎随时提问。



