Skip to content

Commit

Permalink
Merge pull request #38 from chaseadamsio/addAsciiDocHighlighting
Browse files Browse the repository at this point in the history
add initial asciidoc tokens
  • Loading branch information
chaseadamsio authored Apr 24, 2020
2 parents fcb214b + 4a69235 commit 2dec81a
Show file tree
Hide file tree
Showing 9 changed files with 89 additions and 12 deletions.
3 changes: 1 addition & 2 deletions .github/actions/check/action.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: "Check"
description: "Checks code"
runs:
runs:
using: "docker"
image: "Dockerfile"
entrypiont: "./entrypoint.sh"
3 changes: 2 additions & 1 deletion .github/actions/check/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
#!/bin/sh -l

set -e
yarn install && yarn test:check-code
4 changes: 2 additions & 2 deletions .github/actions/publish/action.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "Publish to VSCE"
description: "Checks code"
runs:
runs:
using: "docker"
image: "Dockerfile"
entrypiont: "./entrypoint.sh"
entrypoint: "./entrypoint.sh"
3 changes: 2 additions & 1 deletion .github/actions/publish/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh
#!/bin/sh -l

yarn install \
&& yarn prepublish \
&& yarn vscode:publish
3 changes: 1 addition & 2 deletions .github/actions/release/action.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: "Create Release"
description: "Create Release"
runs:
runs:
using: "docker"
image: "Dockerfile"
entrypiont: "./entrypoint.sh"
3 changes: 2 additions & 1 deletion .github/actions/release/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
#!/bin/sh -l

yarn install \
&& yarn run release
14 changes: 14 additions & 0 deletions demo/asciidoc.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
= Neon Night: level-0 title

== level-1 title
This is some *bold* text.
This is _italic_ text.
This is a `monospace` text.

=== level-2 title

[source,shell]
----
GPG_TTY=$(tty)
export GPG_TTY
----
7 changes: 4 additions & 3 deletions src/generate-theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ const generateTheme = (
...require(`./colors/integrated-terminal`)(palette),
...require(`./colors/debug`)(palette),
...require(`./colors/git`)(palette),
...require(`./colors/breadcrumbs`)(palette)
...require(`./colors/breadcrumbs`)(palette),
},
tokenColors: [
...require(`./token-colors/base`)(palette, fontStyleEnabled),
...require(`./token-colors/asciidoc`)(palette, fontStyleEnabled),
...require(`./token-colors/clojure`)(palette, fontStyleEnabled),
...require(`./token-colors/css`)(palette, fontStyleEnabled),
...require(`./token-colors/docker`)(palette, fontStyleEnabled),
Expand All @@ -49,8 +50,8 @@ const generateTheme = (
...require(`./token-colors/json`)(palette, fontStyleEnabled),
...require(`./token-colors/makefile`)(palette),
...require(`./token-colors/markdown`)(palette, fontStyleEnabled),
...require(`./token-colors/yaml`)(palette)
]
...require(`./token-colors/yaml`)(palette),
],
});

module.exports = generateTheme;
61 changes: 61 additions & 0 deletions src/token-colors/asciidoc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// @flow

/* ::
import type {Palette, FontStyles} from '../types'
*/

const asciidoc = (
palette /*: Palette */,
fontStyleEnabled /*: FontStyles */
) => [
{
name: `AsciiDoc - Heading 0-6`,
scope: [
`markup.heading.heading-0.asciidoc`,
`markup.heading.heading-1.asciidoc`,
`markup.heading.heading-2.asciidoc`,
`markup.heading.heading-3.asciidoc`,
`markup.heading.heading-4.asciidoc`,
`markup.heading.heading-5.asciidoc`,
`markup.heading.heading-6.asciidoc`,
],
settings: {
foreground: palette.magenta,
},
},
{
name: `AsciiDoc - Fenced Bode Block`,
scope: [
`text.asciidoc markup.code markup.heading`,
`text.asciidoc markup.code markup.heading entity.name.function`,
],
settings: {
foreground: palette.blue,
},
},
{
name: `AsciiDoc - Bold`,
scope: [`markup.bold.asciidoc`],
settings: {
fontStyle: `bold`,
},
},
{
name: `AsciiDoc - Italic`,
scope: [`markup.italic.asciidoc`],
settings: {
fontStyle: `italic`,
},
},

{
name: `AsciiDoc - Italic`,
scope: [`markup.raw.monospace.asciidoc`],
settings: {
fontStyle: `bold`,
foreground: palette.blue,
},
},
];

module.exports = asciidoc;

0 comments on commit 2dec81a

Please sign in to comment.