<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Swift on Wang Fenjin</title><link>https://www.wangfenjin.com/tags/swift/</link><description>Recent content in Swift on Wang Fenjin</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><copyright>Copyright © 2026 Wang Fenjin :: Powered by &lt;a href="http://gohugo.io"&gt;Hugo&lt;/a&gt;</copyright><lastBuildDate>Fri, 02 Oct 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://www.wangfenjin.com/tags/swift/index.xml" rel="self" type="application/rss+xml"/><item><title>LeftBlank: a macOS Typst writing app inspired by Emacs</title><link>https://www.wangfenjin.com/posts/leftblank-en/</link><pubDate>Fri, 02 Oct 2026 00:00:00 +0000</pubDate><guid>https://www.wangfenjin.com/posts/leftblank-en/</guid><description>&lt;p&gt;&lt;a href="https://www.wangfenjin.com/posts/leftblank/"&gt;中文版&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I recently started a new open-source project called LeftBlank, or 留白 in Chinese. It is a macOS writing app built around Typst, for articles, technical notes, and longer documents. The app is free, the source is open, and a development preview is already available to download.&lt;/p&gt;
&lt;p&gt;Most of my work is on the backend, so building a desktop app has given me quite a few things to learn. In this post, I want to introduce what LeftBlank can do today and explain how some ideas I encountered through Emacs influenced the project.&lt;/p&gt;</description><content>&lt;p&gt;&lt;a href="https://www.wangfenjin.com/posts/leftblank/"&gt;中文版&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I recently started a new open-source project called LeftBlank, or 留白 in Chinese. It is a macOS writing app built around Typst, for articles, technical notes, and longer documents. The app is free, the source is open, and a development preview is already available to download.&lt;/p&gt;
&lt;p&gt;Most of my work is on the backend, so building a desktop app has given me quite a few things to learn. In this post, I want to introduce what LeftBlank can do today and explain how some ideas I encountered through Emacs influenced the project.&lt;/p&gt;
&lt;div style="text-align: center;"&gt;
&lt;img src="https://www.wangfenjin.com/img/leftblank-writing.png" alt="LeftBlank with editable Typst source on the left and the typeset page on the right" style="width: 760px; max-width: 100%; height: auto;" /&gt;
&lt;/div&gt;
&lt;h2 id="background"&gt;Background&lt;/h2&gt;
&lt;p&gt;Writing a document usually involves two tasks: explaining the content clearly and laying out the page. For technical documents, equations, tables, code, and images add more work. Markdown is useful for taking notes, but when I need more control over the page layout, I need another tool as well.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://typst.app/docs/"&gt;Typst&lt;/a&gt; offers a useful option. It is a text-based typesetting system. A document is an ordinary source file, with markup and functions describing its content and style, which can then be compiled into a PDF. Here is a simple example:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-typst" data-lang="typst"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;= A technical note
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Here is some ordinary text, followed by an equation:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ &lt;span style="color:#a6e22e"&gt;f&lt;/span&gt;(x) &lt;span style="color:#f92672"&gt;=&lt;/span&gt; x^&lt;span style="color:#ae81ff"&gt;2&lt;/span&gt; &lt;span style="color:#f92672"&gt;+&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;1&lt;/span&gt; $
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;#table&lt;/span&gt;(
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; columns: &lt;span style="color:#ae81ff"&gt;2&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; [Component], [Description],
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; [Editor], [LeftBlank],
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; [Typesetting engine], [Typst],
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Text, equations, and tables all live in the same document. For more complex tasks, packages from Typst Universe can help with things such as drawing diagrams or adding line numbers to code blocks.&lt;/p&gt;
&lt;p&gt;With the typesetting engine in place, there is still plenty for an editor to do. How can I find a command easily? How can I move between the source and the page? How can a long article be more comfortable to read? LeftBlank focuses on these everyday tasks, bringing writing and the typeset result together in one app.&lt;/p&gt;
&lt;h2 id="what-i-learned-from-spacemacs-and-which-key"&gt;What I learned from Spacemacs and which-key&lt;/h2&gt;
&lt;p&gt;In 2020, I wrote a short &lt;a href="https://www.wangfenjin.com/posts/spacemacs-intro/"&gt;introduction to Spacemacs&lt;/a&gt;. It was mostly a list of common operations and their key sequences. One design I liked was being able to see the available commands after pressing a prefix key.&lt;/p&gt;
&lt;p&gt;As an editor gains more features, it also gains more shortcuts. The few I use every day are easy to remember, but a command I use occasionally is easy to forget. Spacemacs and which-key offer a practical approach: group commands by purpose and show what is available at each step.&lt;/p&gt;
&lt;p&gt;LeftBlank uses a similar approach. Press &lt;code&gt;⌘J&lt;/code&gt; to open the command panel, then follow the hints. To insert a table, for example:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Press &lt;code&gt;⌘J&lt;/code&gt; to open the command panel.&lt;/li&gt;
&lt;li&gt;Press &lt;code&gt;i&lt;/code&gt; to enter the insert group.&lt;/li&gt;
&lt;li&gt;Press &lt;code&gt;t&lt;/code&gt; to insert a table.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If I do not know which group a feature belongs to, I can press &lt;code&gt;/&lt;/code&gt; to search all commands. Common operations also have direct shortcuts, so they can be executed immediately once they become familiar.&lt;/p&gt;
&lt;div style="text-align: center;"&gt;
&lt;img src="https://www.wangfenjin.com/img/leftblank-commands.jpg" alt="LeftBlank's command panel showing command groups and hints for the next available keys" style="width: 760px; max-width: 100%; height: auto;" /&gt;
&lt;/div&gt;
&lt;p&gt;I find this easier to get started with than reading a shortcut reference first. At the beginning, I can follow the hints to find a feature. After using it a few times, the common sequences become familiar.&lt;/p&gt;
&lt;h2 id="the-influence-of-org-mode-and-nano-emacs"&gt;The influence of Org-mode and nano-emacs&lt;/h2&gt;
&lt;p&gt;One lesson I took from Org-mode is that plain text can have a comfortable reading and editing experience. Headings can show hierarchy, an outline can organize an article, and the underlying text can remain a file that is easy to open and edit. LeftBlank keeps this idea in its editor.&lt;/p&gt;
&lt;p&gt;Headings, emphasis, and inline code have corresponding styles in the editing area. Moving the caret into a paragraph reveals its source markers for editing. An outline beside the text helps me find sections without scrolling through the whole document.&lt;/p&gt;
&lt;p&gt;These display styles leave the original Typst source intact. Saving and copying preserve the original text, and the source can be exported for further editing in another editor.&lt;/p&gt;
&lt;p&gt;nano-emacs also had a strong influence on the interface, especially its colors, spacing, and simplicity. LeftBlank has light and dark appearances. While writing, I can use the editor alone, then switch to a split view or a preview to check the page. The aim is to keep the content easy to see and reduce the attention the interface needs.&lt;/p&gt;
&lt;h2 id="implementation-and-everyday-features"&gt;Implementation and everyday features&lt;/h2&gt;
&lt;p&gt;LeftBlank is built with SwiftUI and AppKit, with editing based on native macOS text controls. Tinymist provides Typst language services and live preview, and typesetting runs locally. The required components are bundled with the app, so there is no separate Typst installation to set up.&lt;/p&gt;
&lt;div style="text-align: center;"&gt;
&lt;img src="https://www.wangfenjin.com/img/leftblank-notes.png" alt="Technical notes in LeftBlank with equations, code, and a table alongside their live typeset preview" style="width: 760px; max-width: 100%; height: auto;" /&gt;
&lt;/div&gt;
&lt;p&gt;The editor and preview also work together. Double-clicking content in the preview jumps to the corresponding source position. A selection in the source can also be located in the preview. When checking a table or an equation, I can move directly between its source and its appearance on the page.&lt;/p&gt;
&lt;p&gt;Beyond the editor, a few features are already available:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Browse templates and packages from Typst Universe, read their documentation, and insert imports with an explicit version.&lt;/li&gt;
&lt;li&gt;Autosave and local source history, with comparison and restoration of retained versions.&lt;/li&gt;
&lt;li&gt;Import an existing &lt;code&gt;.typ&lt;/code&gt; file or a project folder and continue editing it.&lt;/li&gt;
&lt;li&gt;Export a PDF or editable Typst source.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Document history is kept on the current Mac and covers source text. Images and other project files still need their own backups.&lt;/p&gt;
&lt;h2 id="the-current-preview"&gt;The current preview&lt;/h2&gt;
&lt;p&gt;The current release is a development preview for macOS 14 or later on Apple silicon, with Chinese and English interfaces. There is still work to do. Long-document editing, Chinese input, and the interaction between editing and preview need continued refinement through actual use.&lt;/p&gt;
&lt;p&gt;Downloads, source code, and editable examples are linked from the &lt;a href="https://leftblank.app/?lang=en"&gt;LeftBlank website&lt;/a&gt;. If it looks interesting, please give it a try. Issues are welcome, whether something is awkward to use or there is a feature worth adding.&lt;/p&gt;
&lt;p&gt;In my earlier open-source projects, many improvements came from other people&amp;rsquo;s usage and feedback. I hope LeftBlank can gradually become a tool people enjoy using every day. Thanks also to Typst, Tinymist, and the Emacs community for the implementations and ideas this project has learned from.&lt;/p&gt;</content></item><item><title>留白：一个受 Emacs 启发的 macOS Typst 写作工具</title><link>https://www.wangfenjin.com/posts/leftblank/</link><pubDate>Fri, 02 Oct 2026 00:00:00 +0000</pubDate><guid>https://www.wangfenjin.com/posts/leftblank/</guid><description>&lt;p&gt;&lt;a href="https://www.wangfenjin.com/posts/leftblank-en/"&gt;English version&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;最近做了一个新的开源项目，叫留白（LeftBlank）。这是一个基于 Typst 的 macOS 写作工具，可以用来写文章、技术笔记，也可以写比较长的文档。程序免费，代码也开源，目前已经有一个可以下载使用的开发预览版。&lt;/p&gt;
&lt;p&gt;我平常主要做后端开发，这次做一个桌面软件，有不少东西需要重新学习。这篇文章介绍一下留白现在能做什么，以及之前用 Emacs 时接触到的一些设计，怎么影响了这个项目。&lt;/p&gt;
&lt;div style="text-align: center;"&gt;
&lt;img src="https://www.wangfenjin.com/img/leftblank-writing.png" alt="留白的写作界面：左侧编辑 Typst 源文档，右侧显示排版结果" style="width: 760px; max-width: 100%; height: auto;" /&gt;
&lt;/div&gt;
&lt;h2 id="背景"&gt;背景&lt;/h2&gt;
&lt;p&gt;写文档时通常有两件事要做，一件是把内容写清楚，另一件是把页面排好。对于技术文档，公式、表格、代码和图片又会增加一些工作。Markdown 很适合记笔记，但是需要控制页面布局的时候，就得再找其他工具。&lt;/p&gt;
&lt;p&gt;&lt;a href="https://typst.app/docs/"&gt;Typst&lt;/a&gt; 提供了一个挺好的选择。它是一个基于文本的排版系统，文档本身是普通的源文件，可以用标记和函数来描述内容与样式，再编译成 PDF。下面就是一个简单的例子：&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-typst" data-lang="typst"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;= 一份技术笔记
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;这里可以写普通的文字，也可以写公式：
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ &lt;span style="color:#a6e22e"&gt;f&lt;/span&gt;(x) &lt;span style="color:#f92672"&gt;=&lt;/span&gt; x^&lt;span style="color:#ae81ff"&gt;2&lt;/span&gt; &lt;span style="color:#f92672"&gt;+&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;1&lt;/span&gt; $
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;#table&lt;/span&gt;(
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; columns: &lt;span style="color:#ae81ff"&gt;2&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; [项目], [说明],
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; [编辑器], [留白],
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; [排版引擎], [Typst],
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;可以看到，文字、公式和表格都放在同一个文档里。需要更复杂的功能时，还可以使用 Typst Universe 里的包，比如画图或者给代码块加上行号。&lt;/p&gt;
&lt;p&gt;有了排版引擎，编辑器还有很多可以做的事。比如怎么方便地找到一个命令，怎么在源文档和页面之间跳转，怎么让一篇长文章读起来更舒服。留白主要想把这些日常使用的问题处理好，让写作和看排版结果可以在一个程序里完成。&lt;/p&gt;
&lt;h2 id="从-spacemacs-和-which-key-学到的东西"&gt;从 Spacemacs 和 which-key 学到的东西&lt;/h2&gt;
&lt;p&gt;我在 2020 年写过一篇 &lt;a href="https://www.wangfenjin.com/posts/spacemacs-intro/"&gt;Spacemacs 的介绍&lt;/a&gt;。当时那篇文章很简单，主要列了一些常用的操作和按键。其中一个我很喜欢的设计，就是按下前缀键以后，可以看到接下来有哪些命令可以用。&lt;/p&gt;
&lt;p&gt;编辑器的功能越来越多，快捷键也会越来越多。平常经常用的几个很好记，但是偶尔才用一次的功能，下次需要的时候很可能就忘了。Spacemacs 和 which-key 的做法很实用：把命令按用途分组，每按一步，都提示下一步能做什么。&lt;/p&gt;
&lt;p&gt;留白也采用了类似的方式。按下 &lt;code&gt;⌘J&lt;/code&gt; 会打开命令面板，然后可以按照提示继续选择。例如插入一个表格：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;按 &lt;code&gt;⌘J&lt;/code&gt; 打开命令面板。&lt;/li&gt;
&lt;li&gt;按 &lt;code&gt;i&lt;/code&gt; 进入插入分组。&lt;/li&gt;
&lt;li&gt;按 &lt;code&gt;t&lt;/code&gt; 插入表格。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;如果不知道一个功能属于哪个分组，可以按 &lt;code&gt;/&lt;/code&gt; 搜索所有命令。常用的操作也有直接快捷键，用熟之后就可以直接执行。&lt;/p&gt;</description><content>&lt;p&gt;&lt;a href="https://www.wangfenjin.com/posts/leftblank-en/"&gt;English version&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;最近做了一个新的开源项目，叫留白（LeftBlank）。这是一个基于 Typst 的 macOS 写作工具，可以用来写文章、技术笔记，也可以写比较长的文档。程序免费，代码也开源，目前已经有一个可以下载使用的开发预览版。&lt;/p&gt;
&lt;p&gt;我平常主要做后端开发，这次做一个桌面软件，有不少东西需要重新学习。这篇文章介绍一下留白现在能做什么，以及之前用 Emacs 时接触到的一些设计，怎么影响了这个项目。&lt;/p&gt;
&lt;div style="text-align: center;"&gt;
&lt;img src="https://www.wangfenjin.com/img/leftblank-writing.png" alt="留白的写作界面：左侧编辑 Typst 源文档，右侧显示排版结果" style="width: 760px; max-width: 100%; height: auto;" /&gt;
&lt;/div&gt;
&lt;h2 id="背景"&gt;背景&lt;/h2&gt;
&lt;p&gt;写文档时通常有两件事要做，一件是把内容写清楚，另一件是把页面排好。对于技术文档，公式、表格、代码和图片又会增加一些工作。Markdown 很适合记笔记，但是需要控制页面布局的时候，就得再找其他工具。&lt;/p&gt;
&lt;p&gt;&lt;a href="https://typst.app/docs/"&gt;Typst&lt;/a&gt; 提供了一个挺好的选择。它是一个基于文本的排版系统，文档本身是普通的源文件，可以用标记和函数来描述内容与样式，再编译成 PDF。下面就是一个简单的例子：&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-typst" data-lang="typst"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;= 一份技术笔记
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;这里可以写普通的文字，也可以写公式：
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ &lt;span style="color:#a6e22e"&gt;f&lt;/span&gt;(x) &lt;span style="color:#f92672"&gt;=&lt;/span&gt; x^&lt;span style="color:#ae81ff"&gt;2&lt;/span&gt; &lt;span style="color:#f92672"&gt;+&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;1&lt;/span&gt; $
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;#table&lt;/span&gt;(
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; columns: &lt;span style="color:#ae81ff"&gt;2&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; [项目], [说明],
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; [编辑器], [留白],
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; [排版引擎], [Typst],
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;可以看到，文字、公式和表格都放在同一个文档里。需要更复杂的功能时，还可以使用 Typst Universe 里的包，比如画图或者给代码块加上行号。&lt;/p&gt;
&lt;p&gt;有了排版引擎，编辑器还有很多可以做的事。比如怎么方便地找到一个命令，怎么在源文档和页面之间跳转，怎么让一篇长文章读起来更舒服。留白主要想把这些日常使用的问题处理好，让写作和看排版结果可以在一个程序里完成。&lt;/p&gt;
&lt;h2 id="从-spacemacs-和-which-key-学到的东西"&gt;从 Spacemacs 和 which-key 学到的东西&lt;/h2&gt;
&lt;p&gt;我在 2020 年写过一篇 &lt;a href="https://www.wangfenjin.com/posts/spacemacs-intro/"&gt;Spacemacs 的介绍&lt;/a&gt;。当时那篇文章很简单，主要列了一些常用的操作和按键。其中一个我很喜欢的设计，就是按下前缀键以后，可以看到接下来有哪些命令可以用。&lt;/p&gt;
&lt;p&gt;编辑器的功能越来越多，快捷键也会越来越多。平常经常用的几个很好记，但是偶尔才用一次的功能，下次需要的时候很可能就忘了。Spacemacs 和 which-key 的做法很实用：把命令按用途分组，每按一步，都提示下一步能做什么。&lt;/p&gt;
&lt;p&gt;留白也采用了类似的方式。按下 &lt;code&gt;⌘J&lt;/code&gt; 会打开命令面板，然后可以按照提示继续选择。例如插入一个表格：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;按 &lt;code&gt;⌘J&lt;/code&gt; 打开命令面板。&lt;/li&gt;
&lt;li&gt;按 &lt;code&gt;i&lt;/code&gt; 进入插入分组。&lt;/li&gt;
&lt;li&gt;按 &lt;code&gt;t&lt;/code&gt; 插入表格。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;如果不知道一个功能属于哪个分组，可以按 &lt;code&gt;/&lt;/code&gt; 搜索所有命令。常用的操作也有直接快捷键，用熟之后就可以直接执行。&lt;/p&gt;
&lt;div style="text-align: center;"&gt;
&lt;img src="https://www.wangfenjin.com/img/leftblank-commands.jpg" alt="留白的命令面板，按用途展示命令分组和下一步按键提示" style="width: 760px; max-width: 100%; height: auto;" /&gt;
&lt;/div&gt;
&lt;p&gt;个人觉得，这样比让用户先看一遍快捷键文档更容易上手。刚开始可以跟着提示找功能，使用几次之后，自然就能记住常用的操作。&lt;/p&gt;
&lt;h2 id="org-mode-和-nano-emacs-的影响"&gt;Org-mode 和 nano-emacs 的影响&lt;/h2&gt;
&lt;p&gt;Org-mode 给我的一个启发是，普通文本也可以有很好的阅读和编辑体验。标题可以有层次，文章可以按大纲组织，文字本身仍然是能直接打开和修改的文件。留白的编辑器也保留了这个思路。&lt;/p&gt;
&lt;p&gt;在编辑区，标题、强调和行内代码会有相应的样式。光标进入一段文字时，会显示这一段的源文本标记，方便修改。旁边的大纲可以用来找到章节，文档长了以后不用一直滚动。&lt;/p&gt;
&lt;p&gt;这些显示效果不会改掉原来的 Typst 源文件。保存和复制的仍然是原始文本，也可以导出源文件，继续用其他编辑器修改。&lt;/p&gt;
&lt;p&gt;nano-emacs 对界面的影响也很大，特别是主题的颜色、间距和整体的简洁感。留白提供了浅色和深色外观，写作时可以只看编辑区，需要检查页面时再切到分栏或者预览。希望能把内容放在比较显眼的位置，让界面少占一些注意力。&lt;/p&gt;
&lt;h2 id="实现和一些日常功能"&gt;实现和一些日常功能&lt;/h2&gt;
&lt;p&gt;留白使用 SwiftUI 和 AppKit 开发，编辑部分基于 macOS 原生文本控件。Typst 的语言服务和实时预览通过 Tinymist 提供，排版在本机运行。需要的组件随程序一起打包，所以下载之后不用再单独安装 Typst。&lt;/p&gt;
&lt;div style="text-align: center;"&gt;
&lt;img src="https://www.wangfenjin.com/img/leftblank-notes.png" alt="留白中包含公式、代码和表格的技术笔记，以及对应的实时排版预览" style="width: 760px; max-width: 100%; height: auto;" /&gt;
&lt;/div&gt;
&lt;p&gt;编辑和预览之间也做了一些配合。双击预览里的内容，可以跳到对应的源文档位置；在源文档里选中一段内容，也可以定位到页面里。这样检查一张表格或者一个公式的时候，不用在两个窗口里分别找。&lt;/p&gt;
&lt;p&gt;除了编辑器，还有几个现在已经可以使用的功能：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;浏览 Typst Universe 的模板和包，查看文档，并插入带有明确版本的 import。&lt;/li&gt;
&lt;li&gt;自动保存，以及本机的源文档历史，可以比较和恢复之前保留的版本。&lt;/li&gt;
&lt;li&gt;导入现有的 &lt;code&gt;.typ&lt;/code&gt; 文件或者项目文件夹，继续编辑已经写好的内容。&lt;/li&gt;
&lt;li&gt;导出 PDF，也可以导出可以继续修改的 Typst 源文档。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;文档历史保存在本机，记录的是源文本。项目里的图片等其他文件，还是需要另外做好备份。&lt;/p&gt;
&lt;h2 id="当前版本"&gt;当前版本&lt;/h2&gt;
&lt;p&gt;目前发布的是开发预览版，支持 macOS 14 及以上版本，需要 Apple silicon 的 Mac，界面支持中文和英文。功能还在继续完善，长文档编辑、中文输入和预览之间的配合，都需要在实际使用中继续打磨。&lt;/p&gt;
&lt;p&gt;下载、源码和可以编辑的示例都放在 &lt;a href="https://leftblank.app/"&gt;留白的官网&lt;/a&gt; 上。感兴趣的朋友可以下载试一下，也欢迎提 issue，告诉我哪些地方不好用，或者有哪些功能值得继续做。&lt;/p&gt;
&lt;p&gt;之前做开源项目的时候，有不少改进都是从其他人的使用和反馈里来的。希望留白也能慢慢变成一个大家愿意日常使用的工具。也感谢 Typst、Tinymist，以及 Emacs 社区提供的实现和想法，这个项目从它们身上学到了很多东西。&lt;/p&gt;</content></item></channel></rss>