Skip to content

Commit 2dec81a

Browse files
authored
Merge pull request #38 from chaseadamsio/addAsciiDocHighlighting
add initial asciidoc tokens
2 parents fcb214b + 4a69235 commit 2dec81a

File tree

9 files changed

+89
-12
lines changed

9 files changed

+89
-12
lines changed

.github/actions/check/action.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name: "Check"
22
description: "Checks code"
3-
runs:
3+
runs:
44
using: "docker"
55
image: "Dockerfile"
6-
entrypiont: "./entrypoint.sh"

.github/actions/check/entrypoint.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/sh -l
2+
23
set -e
34
yarn install && yarn test:check-code

.github/actions/publish/action.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: "Publish to VSCE"
22
description: "Checks code"
3-
runs:
3+
runs:
44
using: "docker"
55
image: "Dockerfile"
6-
entrypiont: "./entrypoint.sh"
6+
entrypoint: "./entrypoint.sh"

.github/actions/publish/entrypoint.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/bin/sh
1+
#!/bin/sh -l
2+
23
yarn install \
34
&& yarn prepublish \
45
&& yarn vscode:publish

.github/actions/release/action.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name: "Create Release"
22
description: "Create Release"
3-
runs:
3+
runs:
44
using: "docker"
55
image: "Dockerfile"
6-
entrypiont: "./entrypoint.sh"

.github/actions/release/entrypoint.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/sh -l
2+
23
yarn install \
34
&& yarn run release

demo/asciidoc.adoc

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
= Neon Night: level-0 title
2+
3+
== level-1 title
4+
This is some *bold* text.
5+
This is _italic_ text.
6+
This is a `monospace` text.
7+
8+
=== level-2 title
9+
10+
[source,shell]
11+
----
12+
GPG_TTY=$(tty)
13+
export GPG_TTY
14+
----

src/generate-theme.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,11 @@ const generateTheme = (
3636
...require(`./colors/integrated-terminal`)(palette),
3737
...require(`./colors/debug`)(palette),
3838
...require(`./colors/git`)(palette),
39-
...require(`./colors/breadcrumbs`)(palette)
39+
...require(`./colors/breadcrumbs`)(palette),
4040
},
4141
tokenColors: [
4242
...require(`./token-colors/base`)(palette, fontStyleEnabled),
43+
...require(`./token-colors/asciidoc`)(palette, fontStyleEnabled),
4344
...require(`./token-colors/clojure`)(palette, fontStyleEnabled),
4445
...require(`./token-colors/css`)(palette, fontStyleEnabled),
4546
...require(`./token-colors/docker`)(palette, fontStyleEnabled),
@@ -49,8 +50,8 @@ const generateTheme = (
4950
...require(`./token-colors/json`)(palette, fontStyleEnabled),
5051
...require(`./token-colors/makefile`)(palette),
5152
...require(`./token-colors/markdown`)(palette, fontStyleEnabled),
52-
...require(`./token-colors/yaml`)(palette)
53-
]
53+
...require(`./token-colors/yaml`)(palette),
54+
],
5455
});
5556

5657
module.exports = generateTheme;

src/token-colors/asciidoc.js

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
// @flow
2+
3+
/* ::
4+
import type {Palette, FontStyles} from '../types'
5+
*/
6+
7+
const asciidoc = (
8+
palette /*: Palette */,
9+
fontStyleEnabled /*: FontStyles */
10+
) => [
11+
{
12+
name: `AsciiDoc - Heading 0-6`,
13+
scope: [
14+
`markup.heading.heading-0.asciidoc`,
15+
`markup.heading.heading-1.asciidoc`,
16+
`markup.heading.heading-2.asciidoc`,
17+
`markup.heading.heading-3.asciidoc`,
18+
`markup.heading.heading-4.asciidoc`,
19+
`markup.heading.heading-5.asciidoc`,
20+
`markup.heading.heading-6.asciidoc`,
21+
],
22+
settings: {
23+
foreground: palette.magenta,
24+
},
25+
},
26+
{
27+
name: `AsciiDoc - Fenced Bode Block`,
28+
scope: [
29+
`text.asciidoc markup.code markup.heading`,
30+
`text.asciidoc markup.code markup.heading entity.name.function`,
31+
],
32+
settings: {
33+
foreground: palette.blue,
34+
},
35+
},
36+
{
37+
name: `AsciiDoc - Bold`,
38+
scope: [`markup.bold.asciidoc`],
39+
settings: {
40+
fontStyle: `bold`,
41+
},
42+
},
43+
{
44+
name: `AsciiDoc - Italic`,
45+
scope: [`markup.italic.asciidoc`],
46+
settings: {
47+
fontStyle: `italic`,
48+
},
49+
},
50+
51+
{
52+
name: `AsciiDoc - Italic`,
53+
scope: [`markup.raw.monospace.asciidoc`],
54+
settings: {
55+
fontStyle: `bold`,
56+
foreground: palette.blue,
57+
},
58+
},
59+
];
60+
61+
module.exports = asciidoc;

0 commit comments

Comments
 (0)