Beauty Doc: Word-Style Markdown Editor
Write in a Word-style window and keep clean Markdown in git. Beauty Doc gives VS Code a ribbon,
A4 pages, track changes and comment balloons, and exports to Word, PDF and HTML. It is made for
formal documents: GB/T 8567 software documents (SRS, SDD, test reports, development plans),
GB/T 9704 党政机关公文, reports and papers.
像 Word 一样编辑 Markdown:所见即所得、修订与批注、国标与公文排版,可导出 Word、PDF、HTML,从不改写你的源文件。
- Your file stays yours. Opening a document does not mark it modified, and an edit changes only the characters you typed, so pull request diffs stay small.
- Review like in Word. Track Changes and comments are saved as plain text in the
.md file, and travel to and from .docx as Word tracked changes and comments.
- Export what you see. Word, PDF and HTML use the same numbering and page setup as the print layout.
- Built for long documents. Heading numbers, captions and cross-references, tables of contents, footnotes, citations (GB/T 7714, IEEE, APA), equations and diagrams.
Beauty Doc is an independent project, not affiliated with or endorsed by Microsoft. Word and Office are trademarks of Microsoft.
The .md file stays the single source of truth. The editor (CodeMirror 6 live preview) styles
the text in place and never rewrites text you did not touch: opening a file does not mark it
modified, and an edit changes exactly the characters you typed — table cells included. Exports to
Word, PDF and HTML use the same numbering and page setup you see in the print layout.
The interface is Chinese-first and follows VS Code's display language (Chinese or English).
Contents
Getting started
Open a .md file and run Beauty Doc: Open as Document (Ctrl+Shift+Alt+D, on macOS
Cmd+Shift+Alt+D, the book icon in the editor title, or right-click the file in the Explorer).
Ctrl+Shift+Alt+D again, or { } Source, returns to the Markdown source. To always open Markdown this way, turn on the setting Open Markdown as Document:
"beautiDoc.editor.openMarkdownAsDocument": true
A Search view result, file.md:12 in Quick Open, a link or a Problems entry then jumps to its place in the document, also when the document is already open. The result clicked is marked in orange until you click or type in the document. Don't use a workbench.editorAssociations entry for this: with one, VS Code gives Beauty Doc no position, and a click on a result opens the document where you last left it.
Beauty Doc opens as an option, so git diffs keep using the text editor, and without the setting a Search result opens in the text editor at the match. Git
revisions and read-only files open read-only, and the editor switches in place when that changes. The editor reopens where you left off and follows
the VS Code theme.
Features
A Word-style window
Title bar with quick access (save, undo, redo), a ribbon with Fluent (Office) icons, an A4 page on
a grey canvas, a navigation pane whose search box searches the document as Word's does (Ctrl+F;
matches are highlighted, also inside tables, and the headings whose sections hold one are marked),
and a status bar with page count, word count, view buttons and a zoom slider. A document opens in Print Layout at Page Width with the
navigation pane, without the ruler and page boundaries; what you change on the View tab is kept by
that editor tab. Drag the navigation pane's right edge to resize it (double-click it for the default
width); the width you choose is also used for documents you open later. In a window narrower than 640 px the pane starts hidden. Double-click a tab to collapse the ribbon. Right-click (or
Shift+F10) opens Word's context menu for text, links, table cells and pictures; selecting text
shows a mini toolbar.
| Ribbon tab |
What it offers |
| 文件 File |
Backstage: Info (word/character counts, document info), New from template, Print (via PDF), Export (Word / PDF / HTML, export a folder), Import & Compare, Save, Save As, Open Source, Close, Options. |
| 开始 Home |
Clipboard; font (bold, italic, strikethrough, inline code, link, clear formatting); paragraph (bullets, numbering, task list, indent, quote, ¶ show the Markdown of the cursor's line); Styles gallery (正文, 标题 1–4, 引用, Apply Styles…); find / replace; Ask Copilot. |
| 插入 Insert |
Table (Word's grid picker), pictures, diagram (Mermaid, Graphviz, PlantUML), caption, link, callout, code, equation, horizontal line, page break. |
| 设计 Design |
Document formatting presets (默认, 国标正文, 公文, 学术, and the themes GitHub, 报刊 Newsprint, 夜间 Night, 雅致 Elegant, 简约 Minimal, which also colour the page, headings, links, code and quotes in the editor and in HTML/PDF exports), fonts (East Asian, Latin, headings), body size (字号 or points), line spacing (multiple or fixed, e.g. 28磅), first-line indent, justify. Apply to: all documents (VS Code setting) or this document only (front matter). |
| 布局 Layout |
Margins, orientation, paper size (together in Page Setup, also under File › Export and Print), page breaks and automatic breaks before headings, header & footer, text watermark and opacity. |
| 引用 References |
Table of contents (insert, levels, title), footnotes and footnote/endnote placement, citations and bibliography (file, style), captions and cross-references, caption and equation numbering, heading numbering, document info. |
| 审阅 Review |
Comments (new — Ctrl+Alt+M, edit, delete, previous/next thread), Track Changes, Show Markup (comments in balloons or inline), Display for Review (显示以供审阅: Simple Markup, All Markup, No Markup, Original — display only), accept / reject (this or all), previous/next change. |
| 视图 View |
Print layout, Web layout, Source; navigation pane (resizable), ruler, page boundaries; zoom (100%, one page, page width, in/out). Opens at page width with the navigation pane, without ruler and page boundaries. |
| 表格布局 Table Layout |
Contextual, while a table cell is edited: insert rows/columns, delete, merge right/down, split, alignment, tidy source (CJK-aware padding), edit source. |
Content
| Feature |
Notes |
| WYSIWYG editing |
You see styled text — no **, #, > or | — even where you type; the cursor steps over hidden Markdown. Formulas, diagrams and the document info card open their source when clicked. Formatted text pasted from Word or web pages becomes Markdown (Ctrl+Shift+V pastes plain text); cells copied from Excel/WPS/Word paste as a table. Spell check, CJK-friendly bold/italic, optional typographic quotes and Chinese–Latin auto spacing. |
| Tables |
Rich-text cells (bold, italic, links inside a cell; Tab/Enter/arrows move between cells). Merged cells: || (colspan) and ^^ (rowspan). |
| Heading numbers |
Shown, not written into the text: 1 / 1.1 / 1.1.1 or 一、 / (一) / 1. / (1). Auto leaves hand-numbered documents alone. Sections fold. |
| Captions & cross-references |
a picture followed by {#fig:arch}, 表:… {#tbl:req}, $$…$$ {#eq:x}, ## … {#sec:x}; reference with @fig:arch → “图 1-1”. Footnotes work in table captions. Per-chapter or continuous numbering; 图/表/式 or Figure/Table/Eq. |
| Callouts |
> [!NOTE], [!TIP], [!IMPORTANT], [!WARNING], [!CAUTION]. |
| Footnotes / endnotes |
[^1]; exported as Word footnotes or endnotes. |
| Citations |
[@key], [@key, 第 12 页] from BibTeX or CSL-JSON; GB/T 7714-2015 (numeric or author-date; “等” for Chinese works, “et al.” for Western ones), IEEE, APA or any .csl file (CSL via citation-js). |
| Text highlight |
==text== (yellow) or ==text=={bg=green}: yellow green cyan pink orange red blue purple gray or a hex colour. Home › Text Highlight Color; printed in PDF and HTML, shading in Word. |
| Review marks |
CriticMarkup {++ins++} {--del--} {~~old~>new~~} {==text==}{>>comment<<}, edited with Track Changes; exported as Word tracked changes and comments, imported back from Word. In Print Layout comments appear in Word-style balloons right of the page, level with the text they annotate, coloured per reviewer with their initials; the active thread is joined to its text by a line. New Comment and Edit Comment type in the balloon; its "…" menu edits, deletes and resolves/reopens ([已解决] after the date, see docs/spec/syntax.md); Reply, Post and Cancel work by mouse or keyboard (Tab to a balloon, ↑/↓ between threads, Enter to its text). Back-to-back comments are a thread. Web Layout, or editor.commentDisplay: inline, shows them as icons in the text (edited in a dialog). Lines with tracked changes get a change bar in the left margin. Track Changes records typing, deleting, pasting, Enter and character formatting of selected text (Ctrl+B/I…, shown as the old text deleted and the formatted text inserted); paragraph formatting (heading level, lists, indentation) is applied untracked, with a notice. Typing and deleting are separate undo steps, as in Word. 审阅 › 显示以供审阅 (its button shows the current view) switches between All Markup, Simple Markup (the changed text with red change bars and comment icons, as in Word), No Markup and Original — display only: Backspace/Delete, arrows and copy work on the text as shown and never touch hidden marks. New comments are signed by you (review.authorName, else your OS user name; the front-matter author 编制/作者 only as a fallback). Ctrl+Alt+M: New Comment; Ctrl+Shift+E: Track Changes. |
| Math |
KaTeX ($…$, $$…$$), macros from settings or front matter; native Word equations in .docx. |
| Diagrams |
Mermaid (local), Graphviz dot (local WebAssembly), PlantUML (only when you configure a server). |
| Pictures |
Paste, drop or insert; saved under beautiDoc.imageFolder; size and alignment as attributes ({width=60% align=center}), never by re-encoding the image. |
| Large documents |
Above beautiDoc.editor.largeFileThreshold characters, cross-references, captions and review marks update when you pause typing (大文件模式 in the status bar). |
| Ask Copilot |
Sends the selection (or the current paragraph) to the chat view; needs GitHub Copilot Chat or another chat provider. |
Commands
| Command |
Where |
| Beauty Doc: Open as Document (以文档方式打开) |
Palette, editor title (book icon), editor and tab context menus, Explorer context (.md), Ctrl+Shift+Alt+D |
| Beauty Doc: Open Markdown Source (打开 Markdown 源文件) |
Palette, editor title ({ }), File › Open Source, Ctrl+Shift+Alt+D (in the editor) |
| Beauty Doc: Export… (导出…) |
Palette, File › Export |
| Beauty Doc: Export to Word (.docx) |
Palette, editor title … menu, editor context (text editor), Explorer context (.md) |
| Beauty Doc: Export to PDF |
Palette, editor title … menu, editor context (text editor), Explorer context (.md) |
| Beauty Doc: Export to HTML |
Palette, File › Export |
| Beauty Doc: Export All Documents in Folder… |
Palette, Explorer context (folders), File › Export |
| Beauty Doc: New Document from Template… |
Palette, File › New |
| Beauty Doc: Import Word Document (.docx)… |
Palette, Explorer context (.docx), File › Import & Compare |
| Beauty Doc: Compare with Word Document (.docx)… |
Palette, File › Import & Compare |
| Beauty Doc: Ask Copilot about Selection or Document |
Palette (whole document, up to 4,000 characters), Home › Ask Copilot (the selection) |
Keyboard shortcuts
On macOS use ⌘ for Ctrl (the ribbon tooltips show the Mac form).
| Keys |
Action |
Ctrl+Shift+Alt+D (Mac: Cmd+Shift+Alt+D) |
Switch between Beauty Doc and the Markdown source |
Ctrl+S |
Save (after every pending edit has reached the document) |
Ctrl+B / Ctrl+I |
Bold / italic (also inside table cells). With no selection, what you type next is bold/italic, as in Word (also with Track Changes); inside bold text it ends the bold there |
Ctrl+K |
Insert or edit link; Ctrl+click follows a link, in a table cell too (a link to a Markdown file opens it as a document, at the heading it names) |
Ctrl+1 … Ctrl+6 |
Heading 1–6 (inside a quote or list item too: > ## text, - ## item) |
Ctrl+Shift+N |
Normal text (正文) |
Ctrl+Shift+L |
Bullets |
Ctrl+Enter |
Page break |
Ctrl+F |
Find: the search box in the navigation pane (matches are highlighted, also in tables; Enter / Shift+Enter step through them; Esc ends the search and returns to the document) |
Ctrl+H |
Replace bar under the ribbon (Mac: ⌃H) |
Ctrl+Shift+V |
Paste as plain text |
Tab / Shift+Tab, Ctrl+] / Ctrl+[ |
Indent / outdent list items and code. In a plain paragraph Tab inserts nothing (spaces would turn it into a code block) and points to Design › First Line Indent; Shift+Tab removes stray leading spaces. In a table, Tab moves to the next cell. |
Ctrl+Shift+[ / Ctrl+Shift+] |
Fold / unfold the section under the heading |
Ctrl+Z / Ctrl+Y (Ctrl+Shift+Z) |
Undo / redo |
Ctrl + mouse wheel |
Zoom, 10% per notch |
Ctrl+Alt+M |
New Comment (typed in a balloon in Print Layout) |
Ctrl+Shift+E |
Track Changes on / off |
F6 / Shift+F6 |
Move between the ribbon, navigation pane, document, comment balloons and status bar |
Alt (alone) or F10 |
Focus the ribbon tabs; Esc returns to the document |
Shift+F10 |
Context menu at the cursor |
Word shortcuts with no Markdown form (Ctrl+U, Ctrl+E/L/R/J, Ctrl+=, Ctrl+Shift+=) are
swallowed so they don't trigger VS Code commands.
Settings
All settings are under beautiDoc.. Document settings resolve as defaults → style preset →
VS Code settings → front matter; most have a front-matter key (see below). Settings marked 🔒 are
restricted in untrusted workspaces.
Editor
| Setting |
Default |
Meaning |
headingNumbering |
none |
none, auto, decimal (1.1) or chinese (一、(一)). |
editor.webLayoutWidth |
1000 |
Maximum text width (px) in Web layout. |
editor.spellcheck |
true |
Browser spell checking. |
editor.statusBarCount |
words |
words, characters or both. |
editor.smartPunctuation |
off |
display: show “ ” ‘ ’ — in editor and exports; the source is unchanged. |
editor.cjkAutoSpace |
false |
Insert a space between Chinese and Latin while typing (typed text only). |
editor.keepKeyboardInList |
false |
With editor.openMarkdownAsDocument, a click on a Search view result leaves the keyboard in the list when the document is already open; a double click moves it to the document. Enter on a result, a link or Go to Definition then leaves the keyboard nowhere until the next click. |
editor.closeAutomaticPreview |
true |
With editor.openMarkdownAsDocument, closes the Markdown preview that another extension opens by itself beside the document (auto-preview extensions react to the text editor that shows for a moment). A preview already open stays. |
editor.openMarkdownAsDocument |
false |
Open Markdown as documents at the position they were opened for (Search view results, file.md:12 in Quick Open, links, Problems), also in a document already open. Opening a file moves the keyboard to the document, also on a single click in a list, and a text editor opened by another extension also becomes a document. |
editor.largeFileThreshold |
500000 |
Characters above which large-document mode is used; 0 = off. |
editor.commentDisplay |
balloons |
Comments in Print Layout: balloons beside the page (Word's markup area) or inline icons. Also 审阅 › 显示标记. |
review.authorName |
"" |
Your name on new comments and replies (user setting only). Empty: your OS user name; the front-matter author only when neither is available. |
diagram.mermaidTheme |
auto |
auto, default, neutral, forest, dark. |
diagram.plantumlServer 🔒 |
"" |
PlantUML server URL; empty = PlantUML is not rendered. |
math.macros |
{} |
KaTeX macros (also reads markdown.math.macros). |
Pictures
| Setting |
Default |
Meaning |
imageFolder 🔒 |
images/${fileName} |
Folder for pasted/dropped pictures, relative to the document. ${fileName}, ${date}. |
image.fileName |
${fileName}-${timestamp} |
Picture file name. ${fileName}, ${timestamp}, ${date}, ${originalName}. |
image.insertAction |
copy |
Insert › Picture: copy into the image folder, keepPath, or ask. |
image.maxWidth |
0 |
Add {width=…} to larger new pictures (px); 0 = no limit. |
Page and style
| Setting |
Default |
Meaning |
style.preset |
default |
default, gb (国标正文), gongwen (GB/T 9704 公文), academic, github, newsprint (报刊), night (夜间), elegant (雅致), minimal (简约). |
page.size |
A4 |
A4, A3, A5, B5, Letter, Legal. |
page.orientation |
portrait |
portrait or landscape. |
page.margins |
from preset |
{ top, bottom, left, right } in mm. |
style.fonts 🔒 |
from preset |
{ latin, cjk, headingLatin, headingCjk, mono }. |
style.fontSize |
from preset |
Points or a Chinese size (小四, 三号). |
style.headingSizes |
from preset |
Size of the title and of each heading level: { "title": 26, "h1": 18, "h2": "小三" } (points or Chinese sizes; h1 is the top numbered level). Levels left out keep the preset's. Also Design › Heading Sizes. |
style.lineSpacing |
from preset |
Multiple (1.5) or fixed points ("28pt", Word's Exactly). |
style.firstLineIndent |
from preset |
First-line indent in characters (layout and exports only). |
style.justify |
from preset |
Justify body text. |
header.text |
${title}||${docNo} |
Page header left|center|right with variables. |
footer.text |
|第 ${page} 页 共 ${pages} 页| |
Page footer, same syntax. |
header.onCover |
false |
Header/footer also on the cover, revision and contents pages. |
watermark.text |
"" |
Watermark text on every page (variables allowed). |
watermark.opacity |
0.12 |
0.02 – 0.5. |
Numbering, references, notes
| Setting |
Default |
Meaning |
numbering.startLevel |
auto |
Heading level that gets the first-level number; auto = first level used more than once. |
numbering.maxLevel |
4 |
Number of numbered levels. |
numbering.separator |
" " |
Text between a decimal number and the heading. |
toc.depth |
3 |
Levels in the table of contents. |
toc.title |
"" |
TOC title; empty = 目录 / Contents. |
captions.numbering |
chapter |
chapter (图 2-1) or continuous (图 3). |
captions.language |
auto |
auto, zh (图/表/式), en (Figure/Table/Eq.). |
math.equationNumbering |
labeled |
none, labeled (only {#eq:…}), all. |
notes |
footnotes |
Export [^1] as footnotes or endnotes. |
citations.bibliography 🔒 |
"" |
Default .bib / CSL-JSON file, relative to the document. |
citations.style 🔒 |
gb-t-7714-2015-numeric |
gb-t-7714-2015-numeric, gb-t-7714-2015-author-date, apa, ieee, or a .csl path. |
Export
| Setting |
Default |
Meaning |
export.outputFolder 🔒 |
"" |
Output folder; empty = next to the document. ${fileDir}, ${workspaceDir}. |
export.openAfterExport |
ask |
ask, open or none. |
export.pageBreakBefore |
none |
none, h1, h1h2: new page before chapters (and sections). |
export.metadata |
true |
Write title, author, subject and keywords into PDF/Word properties. |
export.docxTemplate 🔒 |
"" |
Reference .docx whose styles are used for Word export. |
export.css 🔒 |
[] |
Extra CSS files for HTML/PDF export and the editor page: absolute paths as they are, /… from the workspace root, others relative to the document (network paths are ignored). Not used for Word — use export.docxTemplate. Typora themes style Typora's own page (#write) and need adapting. |
export.checkFonts |
true |
Warn before PDF/Word export when style fonts are not installed. |
export.browserPath |
"" |
Edge/Chrome/Chromium for PDF and Mermaid-in-Word; empty = detect. Machine scope. |
export.browserArgs |
[] |
Extra browser arguments (root on Linux gets --no-sandbox … by default). Machine scope. |
Front matter
A YAML block at the top of the document sets document info and overrides settings. Keys accept
English or Chinese names. Main keys:
| Purpose |
Keys |
| Document info |
title/标题, subtitle/副标题, docNo/文档编号/编号, version/版本/版本号, author/作者/编制, date/日期, organization/单位/公司, classification/密级, revisions/修订记录 (items: 版本, 日期, 修订人/作者, 说明/修订内容), keywords/关键词 |
| Structure |
numbering/标题编号, toc/目录 (true/是), 目录级数, 目录标题, 分页 |
| Page |
纸张/paper, 方向/orientation (横向/纵向), 页边距 {上, 下, 左, 右}, 页眉, 页脚, 首页页眉, 水印, 水印透明度 |
| Typography |
样式/style (默认, 国标, 公文, 学术/论文), 字体 {中文, 西文, 标题, 代码}, 字号 (小四, 三号, points), 行距 (1.5, 28磅, 固定值 28), 首行缩进, 两端对齐 |
| References |
题注编号 (按章/连续), 公式编号, 注释 (脚注/尾注), 参考文献, 引用样式, 数学宏/macros |
| Export |
模板 (reference .docx); 公文 版头: 发文机关, 发文字号, 签发人 |
---
title: 软件需求规格说明
文档编号: SRS-2026-001
版本: "1.2"
编制: 张工
日期: 2026-10-20
样式: 国标
标题编号: decimal
toc: true
页边距: {上: 25, 下: 25, 左: 30, 右: 25}
修订记录:
- 版本: "1.0"
日期: 2026-09-01
说明: 初稿
---
The document info card at the top of the editor shows this block; the Design and Layout tabs can
write to it (This Document Only).
Templates
File › New or Beauty Doc: New Document from Template…:
| Template |
Content |
| 党政机关公文 |
GB/T 9704-2012 layout: 版头, 发文字号, title, 主送机关, body, 落款, 版记 |
| 软件需求规格说明(SRS) |
GB/T 8567-2006 |
| 软件设计说明(SDD) |
GB/T 8567-2006 |
| 软件测试报告(STR) |
GB/T 8567-2006 |
| 软件开发计划(SDP) |
GB/T 8567-2006 |
| 空白文档(国标正文) |
宋体 小四, 1.5 line spacing, 2-character indent, 黑体 headings |
Export
| Format |
How |
| Word (.docx) |
Built in. Cover page, revision table, contents, numbered headings, captions with Word SEQ fields, native equations, footnotes/endnotes, tracked changes and comments, header/footer and watermark. Mermaid diagrams need Edge or Chrome; other diagrams get a PNG fallback when a browser is available. |
| PDF |
Printed by the installed Edge or Chrome (same layout as the print view). File › Print creates the PDF to print. |
| HTML |
One standalone file; KaTeX CSS and Mermaid are loaded from jsDelivr pinned by Subresource Integrity. |
- Page setup and presets: paper, orientation, margins and typography from
default, gb
(国标正文: 宋体 小四, 1.5 lines, 2-character indent, 黑体 headings), gongwen (GB/T 9704:
仿宋_GB2312 三号, fixed 28.95 pt lines, margins 37/35/28/26 mm, centred — 1 — page number,
red 版头) or academic.
- Header/footer:
left|center|right with ${title} ${subtitle} ${docNo} ${version}
${author} ${date} ${organization} ${classification} ${page} ${pages} ${today} and
any front-matter key.
- Watermark, table of contents (
[TOC], <!-- toc --> or toc: true), heading numbers,
page breaks (<!-- pagebreak -->, or automatically before chapters).
- Line spacing as a multiple or fixed:
行距: 28磅 (Word's 固定值).
- Reference .docx template (
export.docxTemplate / 模板:) supplies Word styles.
- Output folder (
export.outputFolder); an existing file asks to overwrite or save as.
- Folder export: every
.md/.markdown file in a folder and its subfolders (hidden folders and
node_modules skipped) to one or more formats.
- Font check: warns before PDF/Word export when fonts of the style are not installed, naming the
fallback.
- Properties: title, author, subject and keywords (
export.metadata).
Import and compare
- Import Word Document: converts a
.docx into a new Markdown file next to it, pictures saved in
the image folder. Cover/properties become front matter; headings (by style or outline level),
heading numbering, captions, merged cells, footnotes, equations (OMML → $…$), callouts, the
TOC field, and tracked changes and comments (→ CriticMarkup) are kept.
- Compare with Word Document: converts a returned
.docx and opens a VS Code diff against the
Markdown. Differences the round trip cannot preserve (padding, list markers, escapes, picture
widths, front matter) are taken from the original, so the diff shows only real edits.
Both need documents saved on disk.
Sharing for review
Comments, replies and tracked changes are stored in the .md file (CriticMarkup), so a Git
repository is all you need to share a document for review. Share the link to the repository or to
the file; reviewers need access to the repository, VS Code and Beauty Doc.
- Author: commit the document and push it, then send the link.
- Reviewer: clone the repository (or pull), create a branch, open the
.md file with Beauty Doc,
set beautiDoc.review.authorName once, turn on Track Changes (Ctrl+Shift+E), edit, and add
comments (Ctrl+Alt+M) or replies. Save, commit, push the branch and open a pull request.
- Author: check out the branch, open the document and go through it with 审阅 › previous/next
change and thread: accept or reject each change, reply to or resolve comments, then merge.
Because Beauty Doc never rewrites text you did not touch, the pull request diff contains only the
reviewer's edits and comments, each an inline {++…++}, {--…--} or {>>…<<} mark. Two reviewers
changing the same paragraph get an ordinary Git merge conflict; resolve it in the text (both sets of
marks can be kept).
Opening the link in a browser (GitHub, vscode.dev, github.dev) shows the Markdown source, not the
Word-style editor: Beauty Doc runs in desktop VS Code only. Reviewers without VS Code can work on an
exported Word file instead (see Import and compare).
Requirements
- VS Code 1.85 or later.
- Microsoft Edge or Google Chrome (or Chromium) for PDF export and Mermaid diagrams in Word; set
beautiDoc.export.browserPath if it is not found.
- Optional: GitHub Copilot Chat (or another chat provider) for Ask Copilot.
- Node.js 22.18 or later only to build the extension (
.nvmrc).
Security and Restricted Mode
- No telemetry. The extension contacts the network only for: web pictures in PDF export (see
below), a PlantUML server you configure, and the viewer's browser loading KaTeX/Mermaid for an
exported HTML file.
- Restricted Mode: in an untrusted workspace, workspace and folder values of
diagram.plantumlServer, export.css, export.docxTemplate, export.outputFolder,
imageFolder, citations.bibliography, citations.style and style.fonts are ignored; user
settings apply. A workspace imageFolder must also stay inside the document's folder or
workspace.
- The editor's ribbon never writes path settings (
export.css, export.outputFolder,
export.docxTemplate, citations.bibliography) and only built-in citation styles.
- Path confinement: pictures, bibliography, CSL style and Word template named in a document must
lie in the document's folder, its workspace (or, for a file opened without a workspace, the folder
above it) or the picture folder; links and junctions leading elsewhere are not followed, and
network paths (
\\server\share, //server/share, file://server/…) are never opened. Paths in
your user settings may point anywhere. A picture left out is reported after the export.
- Your name in comments: new comments and replies are signed with
review.authorName, or, when it is empty, your operating-system user name, which is then written into the document (and its Word export). Set review.authorName to choose the name.
- PlantUML is off by default; with a server set, diagram source is sent to it.
- Remote pictures: only PDF export downloads them, over http(s) only, never from this machine or
the local network: host names are checked, resolved by the extension (DNS check), and the picture
is downloaded from the checked address (redirects are checked too; 25 MB / 20 s per picture).
Word export does not fetch web pictures. Limit: when an HTTP proxy or a fake-IP proxy tool (Clash
and the like) resolves names, a name the proxy maps to its own local network cannot be detected.
- Exports are sanitized: raw HTML keeps formatting only (no scripts, styles, frames or event
handlers); diagram SVGs are sanitized. Standalone HTML loads KaTeX and Mermaid from jsDelivr with
Subresource Integrity.
Development
npm install
npm run build # bundles into dist/ and prepares playground/
npm run typecheck # tsc --noEmit
npm test # unit tests (vitest)
npm run test:e2e # webview end-to-end tests in headless Edge (BD_BROWSER=chrome to switch)
npm run test:vscode # integration tests in a real VS Code
npm run test:all # build + typecheck + unit + e2e + VS Code
npm run package # production build + .vsix (pinned @vscode/vsce)
F5 ("Run Beauty Doc") opens playground/, a scratch copy of test/fixtures made by the build,
with only Beauty Doc loaded; "Run Beauty Doc (with my other extensions)" is there when you need
them. test/fixtures/sample.md must stay byte-identical to the original sample; a unit test checks
its hash.
| Path |
Content |
src/host/ |
Extension host: custom editor provider, document sync, settings (config.ts), pictures |
src/host/export/ |
DOCX, PDF and HTML export, templates, fonts, path and remote-picture checks |
src/host/import/ |
Word import and compare |
src/webview/ |
CodeMirror editor: live preview, sync, ribbon/ (tabs), ui/ (menus, dialogs), content/ (captions, citations, review, diagrams), layout/ (page layout, folding, dialogs) |
src/shared/ |
Pure, unit-tested modules shared by editor and exporters: protocol, front matter, settings, numbering, cross-references, citations, CriticMarkup |
Bundles: dist/extension.js and dist/webview/ load with the editor; dist/export.js (export
and import), dist/bibliography.js (citations) and dist/graphviz.js (Graphviz WebAssembly) load
on first use.
How sync works. The webview sends every CodeMirror transaction as exact line/character edits;
the host applies them with a WorkspaceEdit and recognises its own echo. Changes made elsewhere
(git, other editors, format-on-save) come back as the smallest possible edit; edits typed while
such a change is in flight are rebased onto it and resent, so no keystroke is lost.
Feedback
Bug reports and suggestions: the Q & A tab of the Marketplace page.
License
MIT
| |