Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2022-06-28 23:20:49 +08:00
commit 22dad0a3b7
21 changed files with 1369 additions and 77 deletions

View file

@ -60,7 +60,7 @@
"netImg2LocalAsset": "Convert network images to local images",
"releaseDate": "Release Date",
"pkgSize": "Package size",
"spaceInZE": "Insert a space between Chinese and Western",
"optimizeTypography": "Optimize typography",
"dragPosition": "Drag image to reposition",
"exportPDF0": "Page Size",
"exportPDF1": "Landscape page",

View file

@ -60,7 +60,7 @@
"netImg2LocalAsset": "Convertir des images réseau en images locales",
"releaseDate": "Date de sortie",
"pkgSize": "Taille du package",
"spaceInZE": "Insérer un espace entre les langues chinoise et occidentale",
"optimizeTypography": "Optimiser la typographie",
"dragPosition": "Faites glisser l'image pour la repositionner",
"exportPDF0": "Taille de la page",
"exportPDF1": "Page paysage",

View file

@ -60,7 +60,7 @@
"netImg2LocalAsset": "網絡圖片轉換為本地圖片",
"releaseDate": "發布日期",
"pkgSize": "包大小",
"spaceInZE": "中西文間插入空格",
"optimizeTypography": "優化排版",
"dragPosition": "拖動圖像重新定位",
"exportPDF0": "頁面大小",
"exportPDF1": "橫向頁面",

View file

@ -60,7 +60,7 @@
"netImg2LocalAsset": "网络图片转换为本地图片",
"releaseDate": "发布日期",
"pkgSize": "包大小",
"spaceInZE": "中西文间插入空格",
"optimizeTypography": "优化排版",
"dragPosition": "上下拖动图片以调整位置",
"exportPDF0": "页面大小",
"exportPDF1": "横向页面",

View file

@ -2,6 +2,7 @@
"20200923234011-ieuun1p": 1,
"20200923234602-gy54e67": 4,
"20200923234731-h3zkwm2": 2,
"20200924093441-ft2rhps": 1,
"20200924095938-a9p5450": 2,
"20200924100110-vcg96wy": 1,
"20200924100635-ms0p9lb": 5,
@ -43,5 +44,6 @@
"20210808180303-xaduj2o": 5,
"20210824202056-udkf7wg": 6,
"20211010212318-3wx2kqb": 10,
"20220105101227-n5zpr1a": 6
"20220105101227-n5zpr1a": 6,
"20220628204454-hhxohv5": 2
}

View file

@ -0,0 +1,406 @@
{
"ID": "20220628204454-hhxohv5",
"Type": "NodeDocument",
"Properties": {
"id": "20220628204454-hhxohv5",
"title": "Optimize typography",
"updated": "20220628215421"
},
"Children": [
{
"ID": "20220628215200-ngjb7uu",
"Type": "NodeHeading",
"HeadingLevel": 2,
"Properties": {
"id": "20220628215200-ngjb7uu",
"updated": "20220628215200"
},
"Children": [
{
"Type": "NodeText",
"Data": "Overview"
}
]
},
{
"ID": "20220628215200-yi30jo7",
"Type": "NodeParagraph",
"Properties": {
"id": "20220628215200-yi30jo7",
"updated": "20220628215227"
},
"Children": [
{
"Type": "NodeText",
"Data": "In order to record the content quickly, we often ignore some typographic details, such as the lack of spaces before and after inline codes or bolds, and the lack of spaces between Chinese and Western texts."
}
]
},
{
"ID": "20220628215200-o0bidjn",
"Type": "NodeParagraph",
"Properties": {
"id": "20220628215200-o0bidjn",
"updated": "20220628215255"
},
"Children": [
{
"Type": "NodeText",
"Data": "This will cause the content typography to look less refined, and there will be some visual distraction when browsing the content in the future. Of course, this is just our feeling, maybe this is not a problem, and even such a compact typesetting is needed in the first place."
}
]
},
{
"ID": "20220628215200-efn43ah",
"Type": "NodeHeading",
"HeadingLevel": 2,
"Properties": {
"id": "20220628215200-efn43ah",
"updated": "20220628215200"
},
"Children": [
{
"Type": "NodeText",
"Data": "How to use"
}
]
},
{
"ID": "20220628215200-11bzo6r",
"Type": "NodeParagraph",
"Properties": {
"id": "20220628215200-11bzo6r",
"updated": "20220628215200"
},
"Children": [
{
"Type": "NodeText",
"Data": "Select "
},
{
"Type": "NodeKbd",
"Data": "kbd",
"Children": [
{
"Type": "NodeKbdOpenMarker"
},
{
"Type": "NodeText",
"Data": "Optimized Typesetting"
},
{
"Type": "NodeKbdCloseMarker"
}
]
},
{
"Type": "NodeText",
"Data": " in the "
},
{
"Type": "NodeKbd",
"Data": "kbd",
"Children": [
{
"Type": "NodeKbdOpenMarker"
},
{
"Type": "NodeText",
"Data": "..."
},
{
"Type": "NodeKbdCloseMarker"
}
]
},
{
"Type": "NodeText",
"Data": " menu in the upper right corner of the editor. After processing, a space will be automatically inserted before and after the following elements in the document:"
}
]
},
{
"ID": "20220628215200-rkz9o7o",
"Type": "NodeList",
"ListData": {},
"Properties": {
"id": "20220628215200-rkz9o7o",
"updated": "20220628215340"
},
"Children": [
{
"ID": "20220628215200-hjfctzh",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20220628215200-hjfctzh",
"updated": "20220628215330"
},
"Children": [
{
"ID": "20220628215200-s8crkrx",
"Type": "NodeParagraph",
"Properties": {
"id": "20220628215200-s8crkrx",
"updated": "20220628215330"
},
"Children": [
{
"Type": "NodeText",
"Data": "Tag"
}
]
}
]
},
{
"ID": "20220628215200-bdo2vnf",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20220628215200-bdo2vnf",
"updated": "20220628215333"
},
"Children": [
{
"ID": "20220628215200-cpv1dxw",
"Type": "NodeParagraph",
"Properties": {
"id": "20220628215200-cpv1dxw",
"updated": "20220628215333"
},
"Children": [
{
"Type": "NodeText",
"Data": "Mark"
}
]
}
]
},
{
"ID": "20220628215200-3ymuu1l",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20220628215200-3ymuu1l",
"updated": "20220628215334"
},
"Children": [
{
"ID": "20220628215200-n159ewe",
"Type": "NodeParagraph",
"Properties": {
"id": "20220628215200-n159ewe",
"updated": "20220628215334"
},
"Children": [
{
"Type": "NodeText",
"Data": "Strikethrough"
}
]
}
]
},
{
"ID": "20220628215200-jdgcfne",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20220628215200-jdgcfne",
"updated": "20220628215335"
},
"Children": [
{
"ID": "20220628215200-6pyhpe4",
"Type": "NodeParagraph",
"Properties": {
"id": "20220628215200-6pyhpe4",
"updated": "20220628215335"
},
"Children": [
{
"Type": "NodeText",
"Data": "Inline code"
}
]
}
]
},
{
"ID": "20220628215200-ojyqca0",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20220628215200-ojyqca0",
"updated": "20220628215200"
},
"Children": [
{
"ID": "20220628215200-vokqsi7",
"Type": "NodeParagraph",
"Properties": {
"id": "20220628215200-vokqsi7",
"updated": "20220628215200"
},
"Children": [
{
"Type": "NodeText",
"Data": "Inline formula"
}
]
}
]
},
{
"ID": "20220628215200-ftyia4q",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20220628215200-ftyia4q",
"updated": "20220628215339"
},
"Children": [
{
"ID": "20220628215200-ljro6gm",
"Type": "NodeParagraph",
"Properties": {
"id": "20220628215200-ljro6gm",
"updated": "20220628215339"
},
"Children": [
{
"Type": "NodeText",
"Data": "Emphasize"
}
]
}
]
},
{
"ID": "20220628215200-kw5xfoo",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20220628215200-kw5xfoo",
"updated": "20220628215340"
},
"Children": [
{
"ID": "20220628215200-dmpgbnr",
"Type": "NodeParagraph",
"Properties": {
"id": "20220628215200-dmpgbnr",
"updated": "20220628215340"
},
"Children": [
{
"Type": "NodeText",
"Data": "Bold"
}
]
}
]
}
]
},
{
"ID": "20220628215200-jruaraa",
"Type": "NodeParagraph",
"Properties": {
"id": "20220628215200-jruaraa",
"updated": "20220628215200"
},
"Children": [
{
"Type": "NodeText",
"Data": "In addition, a space will be automatically inserted between Chinese and Western texts in the hyperlink anchor text and normal text."
}
]
},
{
"ID": "20220628215200-f974ft7",
"Type": "NodeHeading",
"HeadingLevel": 2,
"Properties": {
"id": "20220628215200-f974ft7",
"updated": "20220628215200"
},
"Children": [
{
"Type": "NodeText",
"Data": "Automatic backup"
}
]
},
{
"ID": "20220628215200-dkde3is",
"Type": "NodeParagraph",
"Properties": {
"id": "20220628215200-dkde3is",
"updated": "20220628215421"
},
"Children": [
{
"Type": "NodeText",
"Data": "Before the actual execution of optimized typesetting, SiYuan will automatically back up the original document once, so that if the optimization result is not satisfied, it can be rolled back through "
},
{
"Type": "NodeBlockRef",
"Data": "span",
"Children": [
{
"Type": "NodeOpenParen"
},
{
"Type": "NodeOpenParen"
},
{
"Type": "NodeBlockRefID",
"Data": "20210615213222-vs5tzbd"
},
{
"Type": "NodeBlockRefSpace"
},
{
"Type": "NodeBlockRefText",
"Data": "Data history"
},
{
"Type": "NodeCloseParen"
},
{
"Type": "NodeCloseParen"
}
]
},
{
"Type": "NodeText",
"Data": "."
}
]
}
]
}

View file

@ -4,7 +4,7 @@
"Properties": {
"id": "20210615213222-vs5tzbd",
"title": "Data history",
"updated": "20220625231856"
"updated": "20220628203717"
},
"Children": [
{
@ -193,7 +193,7 @@
"ListData": {},
"Properties": {
"id": "20220501135308-30uwxvd",
"updated": "20220503122549"
"updated": "20220628203717"
},
"Children": [
{
@ -474,7 +474,7 @@
},
"Properties": {
"id": "20220501135308-wzazz01",
"updated": "20220501135536"
"updated": "20220628203717"
},
"Children": [
{
@ -482,7 +482,7 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20220501135308-xldpw4q",
"updated": "20220501135536"
"updated": "20220628203717"
},
"Children": [
{
@ -490,18 +490,18 @@
"Data": "When using the "
},
{
"Type": "NodeCodeSpan",
"Data": "code",
"Type": "NodeKbd",
"Data": "kbd",
"Children": [
{
"Type": "NodeCodeSpanOpenMarker"
"Type": "NodeKbdOpenMarker"
},
{
"Type": "NodeCodeSpanContent",
"Data": "Insert a space between Chinese and Western"
"Type": "NodeText",
"Data": "Optimize typography"
},
{
"Type": "NodeCodeSpanCloseMarker"
"Type": "NodeKbdCloseMarker"
}
]
},

View file

@ -8,6 +8,7 @@
"20200813131152-0wk5akh": 4,
"20200813163359-v04n73b": 4,
"20200822191536-rm6hwid": 3,
"20200825162036-4dx365o": 1,
"20200828105441-r76vmu5": 17,
"20200905090211-2vixtlf": 2,
"20200910201551-h4twhas": 5,
@ -44,5 +45,6 @@
"20211010211311-ffz0wbu": 10,
"20220105100506-auvmvcw": 8,
"20220119224322-rdzzk5e": 5,
"20220414110705-tu2un99": 6
"20220414110705-tu2un99": 6,
"20220628204444-9n0y9h2": 2
}

View file

@ -0,0 +1,459 @@
{
"ID": "20220628204444-9n0y9h2",
"Type": "NodeDocument",
"Properties": {
"id": "20220628204444-9n0y9h2",
"title": "优化排版",
"updated": "20220628215004"
},
"Children": [
{
"ID": "20220628204444-yil2u2m",
"Type": "NodeHeading",
"HeadingLevel": 2,
"Properties": {
"id": "20220628204444-yil2u2m",
"updated": "20220628204604"
},
"Children": [
{
"Type": "NodeHeadingC8hMarker",
"Data": "## ",
"Properties": {
"id": ""
}
},
{
"Type": "NodeText",
"Data": "概述",
"Properties": {
"id": ""
}
}
]
},
{
"ID": "20220628204604-qom7yyl",
"Type": "NodeParagraph",
"Properties": {
"id": "20220628204604-qom7yyl",
"updated": "20220628205230"
},
"Children": [
{
"Type": "NodeText",
"Data": "为了快速记录内容,我们时常会忽略一些排版细节,比如行内代码前后或者加粗前后缺少空格、中文和西文之间缺少空格。",
"Properties": {
"id": ""
}
}
]
},
{
"ID": "20220628205215-z3whiwr",
"Type": "NodeParagraph",
"Properties": {
"id": "20220628205215-z3whiwr",
"updated": "20220628215004"
},
"Children": [
{
"Type": "NodeText",
"Data": "这样会导致内容排版看上去不够精致,以后浏览该内容时也有一定视觉干扰。当然,这只是我们的感触,也许这并不是问题,甚至本来就需要这样紧凑排版。"
}
]
},
{
"ID": "20220628205558-6krkd89",
"Type": "NodeHeading",
"HeadingLevel": 2,
"Properties": {
"id": "20220628205558-6krkd89",
"updated": "20220628205611"
},
"Children": [
{
"Type": "NodeHeadingC8hMarker",
"Data": "## ",
"Properties": {
"id": ""
}
},
{
"Type": "NodeText",
"Data": "使用方式",
"Properties": {
"id": ""
}
}
]
},
{
"ID": "20220628205611-ikc5gy0",
"Type": "NodeParagraph",
"Properties": {
"id": "20220628205611-ikc5gy0",
"updated": "20220628205851"
},
"Children": [
{
"Type": "NodeText",
"Data": "在编辑器右上角 ",
"Properties": {
"id": ""
}
},
{
"Type": "NodeKbd",
"Properties": {
"id": ""
},
"Children": [
{
"Type": "NodeKbdOpenMarker",
"Properties": {
"id": ""
}
},
{
"Type": "NodeText",
"Data": "...",
"Properties": {
"id": ""
}
},
{
"Type": "NodeKbdCloseMarker",
"Properties": {
"id": ""
}
}
]
},
{
"Type": "NodeText",
"Data": " 菜单中选择 ",
"Properties": {
"id": ""
}
},
{
"Type": "NodeKbd",
"Properties": {
"id": ""
},
"Children": [
{
"Type": "NodeKbdOpenMarker",
"Properties": {
"id": ""
}
},
{
"Type": "NodeText",
"Data": "优化排版",
"Properties": {
"id": ""
}
},
{
"Type": "NodeKbdCloseMarker",
"Properties": {
"id": ""
}
}
]
},
{
"Type": "NodeText",
"Data": ",处理完成后文档中的如下元素前后会被自动插入一个空格:",
"Properties": {
"id": ""
}
}
]
},
{
"ID": "20220628205832-odovge3",
"Type": "NodeList",
"ListData": {},
"Properties": {
"id": "20220628205832-odovge3",
"updated": "20220628210303"
},
"Children": [
{
"ID": "20220628205914-usv3556",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20220628205914-usv3556",
"updated": "20220628205914"
},
"Children": [
{
"ID": "20220628205914-iky4uvu",
"Type": "NodeParagraph",
"Properties": {
"id": "20220628205914-iky4uvu",
"updated": "20220628205916"
},
"Children": [
{
"Type": "NodeText",
"Data": "标签"
}
]
}
]
},
{
"ID": "20220628205923-e4k3t4q",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20220628205923-e4k3t4q",
"updated": "20220628205923"
},
"Children": [
{
"ID": "20220628205923-khj268p",
"Type": "NodeParagraph",
"Properties": {
"id": "20220628205923-khj268p",
"updated": "20220628205923"
},
"Children": [
{
"Type": "NodeText",
"Data": "高亮"
}
]
}
]
},
{
"ID": "20220628205937-hdptx79",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20220628205937-hdptx79",
"updated": "20220628205938"
},
"Children": [
{
"ID": "20220628205937-h9uklhw",
"Type": "NodeParagraph",
"Properties": {
"id": "20220628205937-h9uklhw",
"updated": "20220628205938"
},
"Children": [
{
"Type": "NodeText",
"Data": "删除线"
}
]
}
]
},
{
"ID": "20220628205833-kmfuhsp",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20220628205833-kmfuhsp",
"updated": "20220628205833"
},
"Children": [
{
"ID": "20220628205833-iu4yxrq",
"Type": "NodeParagraph",
"Properties": {
"id": "20220628205833-iu4yxrq",
"updated": "20220628205855"
},
"Children": [
{
"Type": "NodeText",
"Data": "行内代码"
}
]
}
]
},
{
"ID": "20220628205855-jp2ks1q",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20220628205855-jp2ks1q",
"updated": "20220628210128"
},
"Children": [
{
"ID": "20220628205855-1gfuu51",
"Type": "NodeParagraph",
"Properties": {
"id": "20220628205855-1gfuu51",
"updated": "20220628210245"
},
"Children": [
{
"Type": "NodeText",
"Data": "行内公式"
}
]
}
]
},
{
"ID": "20220628210256-w9dx7j4",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20220628210256-w9dx7j4"
},
"Children": [
{
"ID": "20220628210256-1fip7jw",
"Type": "NodeParagraph",
"Properties": {
"id": "20220628210256-1fip7jw",
"updated": "20220628210257"
},
"Children": [
{
"Type": "NodeText",
"Data": "强调"
}
]
}
]
},
{
"ID": "20220628210258-nngjbb4",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20220628210258-nngjbb4",
"updated": "20220628210303"
},
"Children": [
{
"ID": "20220628210258-6vvjp11",
"Type": "NodeParagraph",
"Properties": {
"id": "20220628210258-6vvjp11",
"updated": "20220628210303"
},
"Children": [
{
"Type": "NodeText",
"Data": "加粗"
}
]
}
]
}
]
},
{
"ID": "20220628210000-ives8vm",
"Type": "NodeParagraph",
"Properties": {
"id": "20220628210000-ives8vm",
"updated": "20220628210233"
},
"Children": [
{
"Type": "NodeText",
"Data": "另外,对于超链接锚文本和普通文本中的中西文间也会自动插入一个空格。"
}
]
},
{
"ID": "20220628210321-x8cf0vr",
"Type": "NodeHeading",
"HeadingLevel": 2,
"Properties": {
"id": "20220628210321-x8cf0vr",
"updated": "20220628210344"
},
"Children": [
{
"Type": "NodeText",
"Data": "自动备份"
}
]
},
{
"ID": "20220628210345-fsoqtka",
"Type": "NodeParagraph",
"Properties": {
"id": "20220628210345-fsoqtka",
"updated": "20220628214153"
},
"Children": [
{
"Type": "NodeText",
"Data": "在实际执行优化排版之前,思源会自动备份一次原有的文档,这样如果优化结果不满意也能够通过"
},
{
"Type": "NodeBlockRef",
"Data": "span",
"Children": [
{
"Type": "NodeOpenParen"
},
{
"Type": "NodeOpenParen"
},
{
"Type": "NodeBlockRefID",
"Data": "20210615211733-v6rzowm"
},
{
"Type": "NodeBlockRefSpace"
},
{
"Type": "NodeBlockRefText",
"Data": "数据历史"
},
{
"Type": "NodeCloseParen"
},
{
"Type": "NodeCloseParen"
}
]
},
{
"Type": "NodeText",
"Data": "进行回滚。"
}
]
}
]
}

View file

@ -4,7 +4,7 @@
"Properties": {
"id": "20210615211733-v6rzowm",
"title": "数据历史",
"updated": "20220625231706"
"updated": "20220628203857"
},
"Children": [
{
@ -193,7 +193,7 @@
"ListData": {},
"Properties": {
"id": "20210403160319-ufy7jta",
"updated": "20220501135036"
"updated": "20220628203857"
},
"Children": [
{
@ -494,7 +494,7 @@
},
"Properties": {
"id": "20220501134920-qb6wh0b",
"updated": "20220501135036"
"updated": "20220628203857"
},
"Children": [
{
@ -502,7 +502,7 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20220501134920-k403n1r",
"updated": "20220501135036"
"updated": "20220628203857"
},
"Children": [
{
@ -510,18 +510,18 @@
"Data": "使用 "
},
{
"Type": "NodeCodeSpan",
"Data": "code",
"Type": "NodeKbd",
"Data": "kbd",
"Children": [
{
"Type": "NodeCodeSpanOpenMarker"
"Type": "NodeKbdOpenMarker"
},
{
"Type": "NodeCodeSpanContent",
"Data": "中西文间插入空格"
"Type": "NodeText",
"Data": "优化排版"
},
{
"Type": "NodeCodeSpanCloseMarker"
"Type": "NodeKbdCloseMarker"
}
]
},

View file

@ -13,14 +13,16 @@
"20211226120508-yzh70eh": 6,
"20211226120802-77aj0is": 7,
"20211226120854-dr1jfx2": 2,
"20211226120933-vnjgwwh": 3,
"20211226121109-f060fkg": 4,
"20211226121203-rjjngpz": 5,
"20211226121232-23s79xr": 6,
"20211226120933-vnjgwwh": 4,
"20211226121109-f060fkg": 5,
"20211226121203-rjjngpz": 6,
"20211226121232-23s79xr": 7,
"20211226121319-emrk2yy": 1,
"20211226121332-irgblss": 5,
"20211226121413-nznc7x0": 4,
"20211226121438-xaafdo8": 3,
"20211226121503-k3jma6m": 1,
"20211227210109-0f92zh2": 2,
"20220105101348-corstqc": 6
"20220105101348-corstqc": 6,
"20220628204420-ui79vkt": 2
}

View file

@ -0,0 +1,406 @@
{
"ID": "20220628204420-ui79vkt",
"Type": "NodeDocument",
"Properties": {
"id": "20220628204420-ui79vkt",
"title": "優化排版",
"updated": "20220628215521"
},
"Children": [
{
"ID": "20220628215506-jnvjuaa",
"Type": "NodeHeading",
"HeadingLevel": 2,
"Properties": {
"id": "20220628215506-jnvjuaa",
"updated": "20220628215506"
},
"Children": [
{
"Type": "NodeText",
"Data": "概述"
}
]
},
{
"ID": "20220628215506-karsxdt",
"Type": "NodeParagraph",
"Properties": {
"id": "20220628215506-karsxdt",
"updated": "20220628215506"
},
"Children": [
{
"Type": "NodeText",
"Data": "為了快速記錄內容,我們時常會忽略一些排版細節,比如行內代碼前後或者加粗前後缺少空格、中文和西文之間缺少空格。"
}
]
},
{
"ID": "20220628215506-7m1gd1c",
"Type": "NodeParagraph",
"Properties": {
"id": "20220628215506-7m1gd1c",
"updated": "20220628215506"
},
"Children": [
{
"Type": "NodeText",
"Data": "這樣會導致內容排版看上去不夠精緻,以後瀏覽該內容時也有一定視覺干擾。當然,這只是我們的感觸,也許這並不是問題,甚至本來就需要這樣緊湊排版。"
}
]
},
{
"ID": "20220628215506-9htzcqy",
"Type": "NodeHeading",
"HeadingLevel": 2,
"Properties": {
"id": "20220628215506-9htzcqy",
"updated": "20220628215506"
},
"Children": [
{
"Type": "NodeText",
"Data": "使用方式"
}
]
},
{
"ID": "20220628215506-xbslfaz",
"Type": "NodeParagraph",
"Properties": {
"id": "20220628215506-xbslfaz",
"updated": "20220628215506"
},
"Children": [
{
"Type": "NodeText",
"Data": "在編輯器右上角 "
},
{
"Type": "NodeKbd",
"Data": "kbd",
"Children": [
{
"Type": "NodeKbdOpenMarker"
},
{
"Type": "NodeText",
"Data": "..."
},
{
"Type": "NodeKbdCloseMarker"
}
]
},
{
"Type": "NodeText",
"Data": " 菜單中選擇 "
},
{
"Type": "NodeKbd",
"Data": "kbd",
"Children": [
{
"Type": "NodeKbdOpenMarker"
},
{
"Type": "NodeText",
"Data": "優化排版"
},
{
"Type": "NodeKbdCloseMarker"
}
]
},
{
"Type": "NodeText",
"Data": ",處理完成後文檔中的如下元素前後會被自動插入一個空格:"
}
]
},
{
"ID": "20220628215506-srlvfe0",
"Type": "NodeList",
"ListData": {},
"Properties": {
"id": "20220628215506-srlvfe0",
"updated": "20220628215506"
},
"Children": [
{
"ID": "20220628215506-ejyq8wg",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20220628215506-ejyq8wg",
"updated": "20220628215506"
},
"Children": [
{
"ID": "20220628215506-r7011ik",
"Type": "NodeParagraph",
"Properties": {
"id": "20220628215506-r7011ik",
"updated": "20220628215506"
},
"Children": [
{
"Type": "NodeText",
"Data": "標籤"
}
]
}
]
},
{
"ID": "20220628215506-9n4aatw",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20220628215506-9n4aatw",
"updated": "20220628215506"
},
"Children": [
{
"ID": "20220628215506-lvi8wwl",
"Type": "NodeParagraph",
"Properties": {
"id": "20220628215506-lvi8wwl",
"updated": "20220628215506"
},
"Children": [
{
"Type": "NodeText",
"Data": "高亮"
}
]
}
]
},
{
"ID": "20220628215506-tqblhzr",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20220628215506-tqblhzr",
"updated": "20220628215506"
},
"Children": [
{
"ID": "20220628215506-apql9i8",
"Type": "NodeParagraph",
"Properties": {
"id": "20220628215506-apql9i8",
"updated": "20220628215506"
},
"Children": [
{
"Type": "NodeText",
"Data": "刪除線"
}
]
}
]
},
{
"ID": "20220628215506-tfhl45j",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20220628215506-tfhl45j",
"updated": "20220628215506"
},
"Children": [
{
"ID": "20220628215506-c6atyjn",
"Type": "NodeParagraph",
"Properties": {
"id": "20220628215506-c6atyjn",
"updated": "20220628215506"
},
"Children": [
{
"Type": "NodeText",
"Data": "行內代碼"
}
]
}
]
},
{
"ID": "20220628215506-258fpgt",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20220628215506-258fpgt",
"updated": "20220628215506"
},
"Children": [
{
"ID": "20220628215506-3twrnze",
"Type": "NodeParagraph",
"Properties": {
"id": "20220628215506-3twrnze",
"updated": "20220628215506"
},
"Children": [
{
"Type": "NodeText",
"Data": "行內公式"
}
]
}
]
},
{
"ID": "20220628215506-gwxg0sp",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20220628215506-gwxg0sp",
"updated": "20220628215506"
},
"Children": [
{
"ID": "20220628215506-dzqlgm9",
"Type": "NodeParagraph",
"Properties": {
"id": "20220628215506-dzqlgm9",
"updated": "20220628215506"
},
"Children": [
{
"Type": "NodeText",
"Data": "強調"
}
]
}
]
},
{
"ID": "20220628215506-gwo2byo",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20220628215506-gwo2byo",
"updated": "20220628215506"
},
"Children": [
{
"ID": "20220628215506-z9h8d47",
"Type": "NodeParagraph",
"Properties": {
"id": "20220628215506-z9h8d47",
"updated": "20220628215506"
},
"Children": [
{
"Type": "NodeText",
"Data": "加粗"
}
]
}
]
}
]
},
{
"ID": "20220628215506-iixm6ws",
"Type": "NodeParagraph",
"Properties": {
"id": "20220628215506-iixm6ws",
"updated": "20220628215506"
},
"Children": [
{
"Type": "NodeText",
"Data": "另外,對於超鏈接錨文本和普通文本中的中西文間也會自動插入一個空格。"
}
]
},
{
"ID": "20220628215506-9zzliru",
"Type": "NodeHeading",
"HeadingLevel": 2,
"Properties": {
"id": "20220628215506-9zzliru",
"updated": "20220628215506"
},
"Children": [
{
"Type": "NodeText",
"Data": "自動備份"
}
]
},
{
"ID": "20220628215506-ciqq3oq",
"Type": "NodeParagraph",
"Properties": {
"id": "20220628215506-ciqq3oq",
"updated": "20220628215521"
},
"Children": [
{
"Type": "NodeText",
"Data": "在實際執行優化排版之前,思源會自動備份一次原有的文檔,這樣如果優化結果不滿意也能夠通過"
},
{
"Type": "NodeBlockRef",
"Data": "span",
"Children": [
{
"Type": "NodeOpenParen"
},
{
"Type": "NodeOpenParen"
},
{
"Type": "NodeBlockRefID",
"Data": "20211226122707-8cr09co"
},
{
"Type": "NodeBlockRefSpace"
},
{
"Type": "NodeBlockRefText",
"Data": "數據歷史"
},
{
"Type": "NodeCloseParen"
},
{
"Type": "NodeCloseParen"
}
]
},
{
"Type": "NodeText",
"Data": "進行回滾。"
}
]
}
]
}

View file

@ -4,7 +4,7 @@
"Properties": {
"id": "20211226122707-8cr09co",
"title": "數據歷史",
"updated": "20220625231923"
"updated": "20220628203918"
},
"Children": [
{
@ -193,7 +193,7 @@
"ListData": {},
"Properties": {
"id": "20220501135134-p6jpw7s",
"updated": "20220501135220"
"updated": "20220628203918"
},
"Children": [
{
@ -474,7 +474,7 @@
},
"Properties": {
"id": "20220501135134-6k05zq3",
"updated": "20220501135134"
"updated": "20220628203918"
},
"Children": [
{
@ -482,7 +482,7 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20220501135134-o33eejl",
"updated": "20220501135134"
"updated": "20220628203918"
},
"Children": [
{
@ -490,18 +490,18 @@
"Data": "使用 "
},
{
"Type": "NodeCodeSpan",
"Data": "code",
"Type": "NodeKbd",
"Data": "kbd",
"Children": [
{
"Type": "NodeCodeSpanOpenMarker"
"Type": "NodeKbdOpenMarker"
},
{
"Type": "NodeCodeSpanContent",
"Data": "中西文間插入空格"
"Type": "NodeText",
"Data": "優化排版"
},
{
"Type": "NodeCodeSpanCloseMarker"
"Type": "NodeKbdCloseMarker"
}
]
},

View file

@ -213,7 +213,7 @@ export class Breadcrumb {
}
}).element);
window.siyuan.menus.menu.append(new MenuItem({
label: window.siyuan.languages.spaceInZE,
label: window.siyuan.languages.optimizeTypography,
click: () => {
fetchPost("/api/format/autoSpace", {
id: protyle.block.rootID

File diff suppressed because one or more lines are too long

View file

@ -7,7 +7,7 @@ require (
github.com/88250/css v0.1.2
github.com/88250/flock v0.8.2
github.com/88250/gulu v1.2.3-0.20220623112232-c502d9016360
github.com/88250/lute v1.7.4-0.20220624073109-a79c7a5c9c9d
github.com/88250/lute v1.7.4-0.20220628102902-e32443650b1c
github.com/88250/melody v0.0.0-20201115062536-c0b3394adcd1
github.com/88250/pdfcpu v0.3.13
github.com/88250/protyle v0.0.0-20220519012506-0a2c8dc24397

View file

@ -51,8 +51,8 @@ github.com/88250/gulu v1.2.0/go.mod h1:ZhEJ98UjR2y7j2toGj4/b+1rRELcZFQAPq/Yjyin2
github.com/88250/gulu v1.2.3-0.20220623112232-c502d9016360 h1:afQ0cjIA/tzwvIDFy9Jf0jFCb1FvWwKuG1QidEMMi4M=
github.com/88250/gulu v1.2.3-0.20220623112232-c502d9016360/go.mod h1:I1qBzsksFL2ciGSuqDE7R3XW4BUMrfDgOvSXEk7FsAI=
github.com/88250/lute v1.7.4-0.20220426011157-34c9bfa2e148/go.mod h1:Bdu9LRNjQhtL3TftbtpjIWTwDVAXoS7AD8QsZQPk7zo=
github.com/88250/lute v1.7.4-0.20220624073109-a79c7a5c9c9d h1:nGN2jBHT5fMnzCBrUsXqTDA+hAsCudvxvXdNbf1sZDc=
github.com/88250/lute v1.7.4-0.20220624073109-a79c7a5c9c9d/go.mod h1:Bdu9LRNjQhtL3TftbtpjIWTwDVAXoS7AD8QsZQPk7zo=
github.com/88250/lute v1.7.4-0.20220628102902-e32443650b1c h1:lM3ChAFl8eNrW08JNwKOWnsFjqiX9sl+y7B2rfdDynE=
github.com/88250/lute v1.7.4-0.20220628102902-e32443650b1c/go.mod h1:Bdu9LRNjQhtL3TftbtpjIWTwDVAXoS7AD8QsZQPk7zo=
github.com/88250/melody v0.0.0-20201115062536-c0b3394adcd1 h1:9Cb+iN639vUI2OcIBc+4oGwml9/0J6bL6dWNb8Al+1s=
github.com/88250/melody v0.0.0-20201115062536-c0b3394adcd1/go.mod h1:jH6MMPr8G7AMzaVmWHXZQiB1DKO3giWbcWZ7UoJ1teI=
github.com/88250/pdfcpu v0.3.13 h1:touMWMZkCGalMIbEg9bxYp7rETM+zwb9hXjwhqi4I7Q=

View file

@ -110,7 +110,7 @@ func GetBlockKramdown(id string) (ret string) {
return
}
addBlockIALNodes(tree)
addBlockIALNodes(tree, false)
node := treenode.GetNodeInTree(tree, id)
luteEngine := NewLute()
ret, _ = lute.FormatNodeSync(node, luteEngine.ParseOptions, luteEngine.RenderOptions)

View file

@ -372,10 +372,21 @@ func ContentWordCount(content string) (runeCount, wordCount int) {
}
func BlocksWordCount(ids []string) (runeCount, wordCount int) {
trees := map[string]*parse.Tree{} // 缓存
for _, id := range ids {
tree, _ := loadTreeByBlockID(id)
bt := treenode.GetBlockTree(id)
if nil == bt {
util.LogWarnf("block tree not found [%s]", id)
continue
}
tree := trees[bt.RootID]
if nil == tree {
return
tree, _ = LoadTree(bt.BoxID, bt.Path)
if nil == tree {
continue
}
trees[bt.RootID] = tree
}
node := treenode.GetNodeInTree(tree, id)

View file

@ -17,7 +17,6 @@
package model
import (
"bytes"
"os"
"path/filepath"
@ -41,35 +40,39 @@ func AutoSpace(rootID string) (err error) {
generateFormatHistory(tree)
var blocks []*ast.Node
var rootIAL [][]string
// 添加 block ial后面格式化渲染需要
luteEngine := NewLute()
// 合并相邻的同类行级节点
ast.Walk(tree.Root, func(n *ast.Node, entering bool) ast.WalkStatus {
if !entering || !n.IsBlock() {
return ast.WalkContinue
}
if ast.NodeDocument == n.Type {
rootIAL = n.KramdownIAL
return ast.WalkContinue
}
if ast.NodeBlockQueryEmbed == n.Type {
if script := n.ChildByType(ast.NodeBlockQueryEmbedScript); nil != script {
script.Tokens = bytes.ReplaceAll(script.Tokens, []byte("\n"), []byte(" "))
if entering {
switch n.Type {
case ast.NodeStrong, ast.NodeEmphasis, ast.NodeStrikethrough, ast.NodeUnderline:
luteEngine.MergeSameSpan(n, n.Type)
}
}
if 0 < len(n.KramdownIAL) {
blocks = append(blocks, n)
}
return ast.WalkContinue
})
for _, block := range blocks {
block.InsertAfter(&ast.Node{Type: ast.NodeKramdownBlockIAL, Tokens: parse.IAL2Tokens(block.KramdownIAL)})
// 合并相邻的文本节点
for {
var unlinks []*ast.Node
ast.Walk(tree.Root, func(n *ast.Node, entering bool) ast.WalkStatus {
if entering && ast.NodeText == n.Type && nil != n.Next && ast.NodeText == n.Next.Type {
n.Tokens = append(n.Tokens, n.Next.Tokens...)
unlinks = append(unlinks, n.Next)
}
return ast.WalkContinue
})
for _, n := range unlinks {
n.Unlink()
}
if 1 > len(unlinks) {
break
}
}
luteEngine := NewLute()
rootIAL := tree.Root.KramdownIAL
addBlockIALNodes(tree, false)
luteEngine.SetAutoSpace(true)
formatRenderer := render.NewFormatRenderer(tree, luteEngine.RenderOptions)
md := formatRenderer.Render()

View file

@ -95,8 +95,7 @@ func DocSaveAsTemplate(id string, overwrite bool) (code int, err error) {
return
}
// 添加 block ial后面格式化渲染需要
addBlockIALNodes(tree)
addBlockIALNodes(tree, true)
luteEngine := NewLute()
formatRenderer := render.NewFormatRenderer(tree, luteEngine.RenderOptions)
@ -259,7 +258,7 @@ func appendRefTextRenderResultForBlockRef(blockRef *ast.Node) {
blockRef.AppendChild(&ast.Node{Type: ast.NodeBlockRefDynamicText, Tokens: gulu.Str.ToBytes(text)})
}
func addBlockIALNodes(tree *parse.Tree) {
func addBlockIALNodes(tree *parse.Tree, removeUpdated bool) {
var blocks []*ast.Node
ast.Walk(tree.Root, func(n *ast.Node, entering bool) ast.WalkStatus {
if !entering || !n.IsBlock() {
@ -272,7 +271,7 @@ func addBlockIALNodes(tree *parse.Tree) {
}
} else if ast.NodeHTMLBlock == n.Type {
n.Tokens = bytes.TrimSpace(n.Tokens)
// 使用 <div> 包裹,否则后续解析模板时会识别为行级 HTML https://github.com/siyuan-note/siyuan/issues/4244
// 使用 <div> 包裹,否则后续解析时会识别为行级 HTML https://github.com/siyuan-note/siyuan/issues/4244
if !bytes.HasPrefix(n.Tokens, []byte("<div>")) {
n.Tokens = append([]byte("<div>\n"), n.Tokens...)
}
@ -281,7 +280,9 @@ func addBlockIALNodes(tree *parse.Tree) {
}
}
n.RemoveIALAttr("updated")
if removeUpdated {
n.RemoveIALAttr("updated")
}
if 0 < len(n.KramdownIAL) {
blocks = append(blocks, n)
}