Skip to content

Commit 7e34906

Browse files
committed
Permit code-block-bg: true and code-block-border-left: true
Additionally, document these options for pdf / html
1 parent 27cc2d5 commit 7e34906

File tree

5 files changed

+173
-3
lines changed

5 files changed

+173
-3
lines changed

src/resources/editor/tools/vs-code.mjs

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10938,6 +10938,44 @@ var require_yaml_intelligence_resources = __commonJS({
1093810938
long: "Include a code tools menu (for hiding and showing code).\nUse `true` or `false` to enable or disable the standard code \ntools menu. Specify sub-properties `source`, `toggle`, and\n`caption` to customize the behavior and appearnce of code tools.\n"
1093910939
}
1094010940
},
10941+
{
10942+
name: "code-block-border-left",
10943+
tags: {
10944+
formats: [
10945+
"$html-doc",
10946+
"$pdf-all"
10947+
]
10948+
},
10949+
schema: {
10950+
anyOf: [
10951+
"string",
10952+
"boolean"
10953+
]
10954+
},
10955+
description: {
10956+
short: "Show a thick left border on code blocks.",
10957+
long: "Specifies to apply a left border on code blocks. Provide a hex color to specify that the border is\nenabled as well as the color of the border.=\n"
10958+
}
10959+
},
10960+
{
10961+
name: "code-block-bg",
10962+
tags: {
10963+
formats: [
10964+
"$html-doc",
10965+
"$pdf-all"
10966+
]
10967+
},
10968+
schema: {
10969+
anyOf: [
10970+
"string",
10971+
"boolean"
10972+
]
10973+
},
10974+
description: {
10975+
short: "Show a background color for code blocks.",
10976+
long: "Specifies to apply a background color on code blocks. Provide a hex color to specify that the background color is\nenabled as well as the color of the background.\n"
10977+
}
10978+
},
1094110979
{
1094210980
name: "highlight-style",
1094310981
tags: {
@@ -17491,6 +17529,7 @@ var require_yaml_intelligence_resources = __commonJS({
1749117529
"The family name.",
1749217530
"The given name.",
1749317531
"Abstract of the item (e.g. the abstract of a journal article)",
17532+
"A url to the abstract for this item.",
1749417533
"Date the item has been accessed.",
1749517534
{
1749617535
short: "Short markup, decoration, or annotation to the item (e.g., to\nindicate items included in a review).",
@@ -17550,6 +17589,7 @@ var require_yaml_intelligence_resources = __commonJS({
1755017589
short: "Number of a preceding note containing the first reference to the\nitem.",
1755117590
long: "Number of a preceding note containing the first reference to the\nitem\nAssigned by the CSL processor; Empty in non-note-based styles or when\nthe item hasn\u2019t been cited in any preceding notes in a document"
1755217591
},
17592+
"A url to the full text for this item.",
1755317593
{
1755417594
short: "Type, class, or subtype of the item",
1755517595
long: "Type, class, or subtype of the item (e.g. \u201CDoctoral dissertation\u201D for\na PhD thesis; \u201CNIH Publication\u201D for an NIH technical report);\nDo not use for topical descriptions or categories (e.g. \u201Cadventure\u201D\nfor an adventure movie)"
@@ -17607,6 +17647,7 @@ var require_yaml_intelligence_resources = __commonJS({
1760717647
"PubMed reference number.",
1760817648
"Printing number of the item or container holding the item.",
1760917649
"Producer (e.g. of a television or radio broadcast).",
17650+
"A public url for this item.",
1761017651
"The publisher of the item.",
1761117652
"The geographic location of the publisher.",
1761217653
"Recipient (e.g. of a letter).",
@@ -17862,6 +17903,14 @@ var require_yaml_intelligence_resources = __commonJS({
1786217903
short: "Include a code tools menu (for hiding and showing code).",
1786317904
long: "Include a code tools menu (for hiding and showing code). Use\n<code>true</code> or <code>false</code> to enable or disable the\nstandard code tools menu. Specify sub-properties <code>source</code>,\n<code>toggle</code>, and <code>caption</code> to customize the behavior\nand appearnce of code tools."
1786417905
},
17906+
{
17907+
short: "Show a thick left border on code blocks.",
17908+
long: "Specifies to apply a left border on code blocks. Provide a hex color\nto specify that the border is enabled as well as the color of the\nborder.="
17909+
},
17910+
{
17911+
short: "Show a background color for code blocks.",
17912+
long: "Specifies to apply a background color on code blocks. Provide a hex\ncolor to specify that the background color is enabled as well as the\ncolor of the background."
17913+
},
1786517914
{
1786617915
short: "Specifies the coloring style to be used in highlighted source\ncode.",
1786717916
long: "Specifies the coloring style to be used in highlighted source\ncode.\nInstead of a <em>STYLE</em> name, a JSON file with extension\n<code>.theme</code> may be supplied. This will be parsed as a KDE syntax\nhighlighting theme and (if valid) used as the highlighting style."

src/resources/editor/tools/yaml/web-worker.js

Lines changed: 49 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/resources/editor/tools/yaml/yaml-intelligence-resources.json

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3917,6 +3917,44 @@
39173917
"long": "Include a code tools menu (for hiding and showing code).\nUse `true` or `false` to enable or disable the standard code \ntools menu. Specify sub-properties `source`, `toggle`, and\n`caption` to customize the behavior and appearnce of code tools.\n"
39183918
}
39193919
},
3920+
{
3921+
"name": "code-block-border-left",
3922+
"tags": {
3923+
"formats": [
3924+
"$html-doc",
3925+
"$pdf-all"
3926+
]
3927+
},
3928+
"schema": {
3929+
"anyOf": [
3930+
"string",
3931+
"boolean"
3932+
]
3933+
},
3934+
"description": {
3935+
"short": "Show a thick left border on code blocks.",
3936+
"long": "Specifies to apply a left border on code blocks. Provide a hex color to specify that the border is\nenabled as well as the color of the border.=\n"
3937+
}
3938+
},
3939+
{
3940+
"name": "code-block-bg",
3941+
"tags": {
3942+
"formats": [
3943+
"$html-doc",
3944+
"$pdf-all"
3945+
]
3946+
},
3947+
"schema": {
3948+
"anyOf": [
3949+
"string",
3950+
"boolean"
3951+
]
3952+
},
3953+
"description": {
3954+
"short": "Show a background color for code blocks.",
3955+
"long": "Specifies to apply a background color on code blocks. Provide a hex color to specify that the background color is\nenabled as well as the color of the background.\n"
3956+
}
3957+
},
39203958
{
39213959
"name": "highlight-style",
39223960
"tags": {
@@ -10470,6 +10508,7 @@
1047010508
"The family name.",
1047110509
"The given name.",
1047210510
"Abstract of the item (e.g.&nbsp;the abstract of a journal article)",
10511+
"A url to the abstract for this item.",
1047310512
"Date the item has been accessed.",
1047410513
{
1047510514
"short": "Short markup, decoration, or annotation to the item (e.g., to\nindicate items included in a review).",
@@ -10529,6 +10568,7 @@
1052910568
"short": "Number of a preceding note containing the first reference to the\nitem.",
1053010569
"long": "Number of a preceding note containing the first reference to the\nitem\nAssigned by the CSL processor; Empty in non-note-based styles or when\nthe item hasn’t been cited in any preceding notes in a document"
1053110570
},
10571+
"A url to the full text for this item.",
1053210572
{
1053310573
"short": "Type, class, or subtype of the item",
1053410574
"long": "Type, class, or subtype of the item (e.g.&nbsp;“Doctoral dissertation” for\na PhD thesis; “NIH Publication” for an NIH technical report);\nDo not use for topical descriptions or categories (e.g.&nbsp;“adventure”\nfor an adventure movie)"
@@ -10586,6 +10626,7 @@
1058610626
"PubMed reference number.",
1058710627
"Printing number of the item or container holding the item.",
1058810628
"Producer (e.g.&nbsp;of a television or radio broadcast).",
10629+
"A public url for this item.",
1058910630
"The publisher of the item.",
1059010631
"The geographic location of the publisher.",
1059110632
"Recipient (e.g.&nbsp;of a letter).",
@@ -10841,6 +10882,14 @@
1084110882
"short": "Include a code tools menu (for hiding and showing code).",
1084210883
"long": "Include a code tools menu (for hiding and showing code). Use\n<code>true</code> or <code>false</code> to enable or disable the\nstandard code tools menu. Specify sub-properties <code>source</code>,\n<code>toggle</code>, and <code>caption</code> to customize the behavior\nand appearnce of code tools."
1084310884
},
10885+
{
10886+
"short": "Show a thick left border on code blocks.",
10887+
"long": "Specifies to apply a left border on code blocks. Provide a hex color\nto specify that the border is enabled as well as the color of the\nborder.="
10888+
},
10889+
{
10890+
"short": "Show a background color for code blocks.",
10891+
"long": "Specifies to apply a background color on code blocks. Provide a hex\ncolor to specify that the background color is enabled as well as the\ncolor of the background."
10892+
},
1084410893
{
1084510894
"short": "Specifies the coloring style to be used in highlighted source\ncode.",
1084610895
"long": "Specifies the coloring style to be used in highlighted source\ncode.\nInstead of a <em>STYLE</em> name, a JSON file with extension\n<code>.theme</code> may be supplied. This will be parsed as a KDE syntax\nhighlighting theme and (if valid) used as the highlighting style."

src/resources/filters/layout/meta.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ function layoutMetaInject()
4444

4545
-- figure out the shadecolor
4646
local shadeColor = nil
47-
if useCodeBlockBorder and meta[kCodeBlockBorderLeft] then
47+
if useCodeBlockBorder and meta[kCodeBlockBorderLeft] and type(meta[kCodeBlockBorderLeft]) ~= "boolean" then
4848
shadeColor = latexXColor(meta[kCodeBlockBorderLeft])
49-
elseif useCodeBlockBg and meta[kCodeBlockBackground] then
49+
elseif useCodeBlockBg and meta[kCodeBlockBackground] and type(meta[kCodeBlockBackground]) ~= "boolean" then
5050
shadeColor = latexXColor(meta[kCodeBlockBackground])
5151
end
5252

src/resources/schema/document-code.yml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,30 @@
5454
Use `true` or `false` to enable or disable the standard code
5555
tools menu. Specify sub-properties `source`, `toggle`, and
5656
`caption` to customize the behavior and appearnce of code tools.
57-
57+
- name: code-block-border-left
58+
tags:
59+
formats: [$html-doc, $pdf-all]
60+
schema:
61+
anyOf:
62+
- string
63+
- boolean
64+
description:
65+
short: "Show a thick left border on code blocks."
66+
long: |
67+
Specifies to apply a left border on code blocks. Provide a hex color to specify that the border is
68+
enabled as well as the color of the border.=
69+
- name: code-block-bg
70+
tags:
71+
formats: [$html-doc, $pdf-all]
72+
schema:
73+
anyOf:
74+
- string
75+
- boolean
76+
description:
77+
short: "Show a background color for code blocks."
78+
long: |
79+
Specifies to apply a background color on code blocks. Provide a hex color to specify that the background color is
80+
enabled as well as the color of the background.
5881
- name: highlight-style
5982
tags:
6083
formats: [$html-all, docx, ms, $pdf-all]

0 commit comments

Comments
 (0)