Skip to content

Commit

Permalink
Try to see if this new tests work
Browse files Browse the repository at this point in the history
  • Loading branch information
JuanM04 committed Feb 5, 2022
1 parent af8e6c8 commit 321a468
Show file tree
Hide file tree
Showing 29 changed files with 290 additions and 100 deletions.
107 changes: 7 additions & 100 deletions packages/astro/test/astro-markdown-shiki.test.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const riGrammar = JSON.parse(
String.raw`{"name":"rinfo","patterns":[{"include":"#lf-rinfo"}],"repository":{"lf-rinfo":{"patterns":[{"include":"#control"},{"include":"#operator"},{"include":"#strings"},{"include":"#number"},{"include":"#comment"},{"include":"#literal"}]},"control":{"patterns":[{"name":"keyword.control.ri","match":"\\b(si|mientras|repetir)\\b"},{"name":"keyword.other.ri","match":"\\b(programa|robots|areas|variables|comenzar|fin)\\b"},{"name":"support.function.other.ri","match":"\\b(tomarFlor|HayFlorEnLaBolsa|HayFlorEnLaEsquina|depositarFlor|HayPapelEnLaBolsa|HayPapelEnLaEsquina|tomarPapel|depositarPapel)\\b"}]},"operator":{"comment":"Captures operators and also puts them in different sub-groups that further describe them","patterns":[{"match":"\\+|-|\\*|/","name":"keyword.operator.arithmetic.ri"},{"match":"<|>|<=|>=|=|<>|!=","name":"keyword.operator.comparison.ri"},{"match":"\\b(Pos|Informar|Leer|Iniciar|AsignarArea|AreaC)\\b","name":"support.function.arithmetic.ri"},{"match":":=","name":"keyword.operator.assign.ri"},{"match":"(&|~)","name":"support.function.logical.ri"}]},"strings":{"name":"string.quoted.double.ri","beginCaptures":{"0":{"name":"string.quoted.double.begin.ri"}},"endCaptures":{"0":{"name":"string.quoted.double.end.ri"}},"begin":"\"","end":"\"","patterns":[{"name":"constant.character.escape.ri","match":"\\\\."}]},"comment":{"patterns":[{"name":"comment.block.ri","begin":"{","end":"}","patterns":[{"include":"#comment"}]}]},"literal":{"patterns":[{"name":"constant.language.ri","match":"\\b(verdadero|falso|boolean|numero)\\b"}]},"number":{"patterns":[{"comment":"Captures decimal numbers, with the negative sign being considered an operator","match":"(-)?(?:((?:\\b\\d+(?:\\.\\d*)?|\\.\\d+)(?:\\b|e-?\\d+\\b)%?)|(\\$[0-9]+\\b))","captures":{"1":{"name":"keyword.operator.arithmetic.ri"},"2":{"name":"constant.numeric.decimal.ri"},"3":{"name":"constant.numeric.hex.ri"}}}]}},"scopeName":"source.rinfo"}`
);

export default {
markdownOptions: {
render: [
"@astrojs/markdown-remark",
{
syntaxHighlight: 'shiki',
shikiConfig: {
langs: [
{
id: 'rinfo',
scopeName: 'source.rinfo',
grammar: riGrammar,
aliases: ['ri'],
},
],
},
},
],
},
buildOptions: {
sitemap: false,
},
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export default {
markdownOptions: {
render: ['@astrojs/markdown-remark', { syntaxHighlight: 'shiki' }],
},
buildOptions: {
sitemap: false,
},
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export default {
markdownOptions: {
render: ["@astrojs/markdown-remark", { syntaxHighlight: 'shiki', shikiConfig: { theme: 'github-light' } }],
},
buildOptions: {
sitemap: false,
},
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<html>
<head>
<!-- Head Stuff -->
</head>
<body>
<div class="container">
<slot></slot>
</div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
import { Markdown } from 'astro/components';
import Layout from '../layouts/content.astro';
---

<Layout>
<Markdown>
# Hello world

```js
console.log('JavaScript')
```
</Markdown>
</Layout>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
layout: ../layouts/content.astro
---

# Hello world

```yaml
apiVersion: v3
kind: Pod
metadata:
name: rss-site
labels:
app: web
spec:
containers:
- name: front-end
image: nginx
ports:
- containerPort: 80
- name: rss-reader
image: nickchase/rss-php-nginx:v1
ports:
- containerPort: 88
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export default {
markdownOptions: {
render: ['@astrojs/markdown-remark', { syntaxHighlight: 'shiki', shikiConfig: { wrap: false } }],
},
buildOptions: {
sitemap: false,
},
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<html>
<head>
<!-- Head Stuff -->
</head>
<body>
<div class="container">
<slot></slot>
</div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
import { Markdown } from 'astro/components';
import Layout from '../layouts/content.astro';
---

<Layout>
<Markdown>
# Hello world

```
plaintext
```

```js
console.log('JavaScript')
```
</Markdown>
</Layout>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
layout: ../layouts/content.astro
---

# Hello world

```yaml
apiVersion: v3
kind: Pod
metadata:
name: rss-site
labels:
app: web
spec:
containers:
- name: front-end
image: nginx
ports:
- containerPort: 80
- name: rss-reader
image: nickchase/rss-php-nginx:v1
ports:
- containerPort: 88
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export default {
markdownOptions: {
render: ['@astrojs/markdown-remark', { syntaxHighlight: 'shiki', shikiConfig: { wrap: null } }],
},
buildOptions: {
sitemap: false,
},
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<html>
<head>
<!-- Head Stuff -->
</head>
<body>
<div class="container">
<slot></slot>
</div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
import { Markdown } from 'astro/components';
import Layout from '../layouts/content.astro';
---

<Layout>
<Markdown>
# Hello world

```
plaintext
```

```js
console.log('JavaScript')
```
</Markdown>
</Layout>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
layout: ../layouts/content.astro
---

# Hello world

```yaml
apiVersion: v3
kind: Pod
metadata:
name: rss-site
labels:
app: web
spec:
containers:
- name: front-end
image: nginx
ports:
- containerPort: 80
- name: rss-reader
image: nickchase/rss-php-nginx:v1
ports:
- containerPort: 88
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export default {
markdownOptions: {
render: ['@astrojs/markdown-remark', { syntaxHighlight: 'shiki', shikiConfig: { wrap: true } }],
},
buildOptions: {
sitemap: false,
},
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<html>
<head>
<!-- Head Stuff -->
</head>
<body>
<div class="container">
<slot></slot>
</div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
import { Markdown } from 'astro/components';
import Layout from '../layouts/content.astro';
---

<Layout>
<Markdown>
# Hello world

```
plaintext
```

```js
console.log('JavaScript')
```
</Markdown>
</Layout>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
layout: ../layouts/content.astro
---

# Hello world

```yaml
apiVersion: v3
kind: Pod
metadata:
name: rss-site
labels:
app: web
spec:
containers:
- name: front-end
image: nginx
ports:
- containerPort: 80
- name: rss-reader
image: nickchase/rss-php-nginx:v1
ports:
- containerPort: 88
```

0 comments on commit 321a468

Please sign in to comment.