Skip to content

Commit 923b2c4

Browse files
authored
Merge pull request #364 from code-hike/next
v0.8.3
2 parents eeeab58 + b43560f commit 923b2c4

File tree

20 files changed

+1208
-88
lines changed

20 files changed

+1208
-88
lines changed

examples/nextra/package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
},
1010
"dependencies": {
1111
"@code-hike/mdx": "^0.8.2",
12-
"next": "13.1.2",
13-
"nextra": "2.2.3",
14-
"nextra-theme-docs": "2.2.3",
12+
"next": "13.3.4",
13+
"nextra": "2.4.2",
14+
"nextra-theme-docs": "2.4.2",
1515
"react": "^18.1.0",
16-
"react-dom": "^18.1.0"
16+
"react-dom": "^18.1.0",
17+
"shiki": "^0.10.1"
1718
}
1819
}

packages/mdx/dev/content/autolink.mdx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
```py
2+
import requests
3+
4+
# URL: https://api.example.com/data
5+
# Invalid URL: http://invalid_domain.123
6+
urls = ["https://typicode.com/todos/1", "https://typicode.com/todos/2"]
7+
responses = [requests.get(url) for url in urls]
8+
```
9+
10+
<CH.Code lineNumbers={true} autoLink={false}>
11+
12+
```ruby mark=3:5
13+
require 'net/http'
14+
15+
url = URI.parse('https://www.ruby-lang.org/en/')
16+
url = URI.parse 'https://www.ruby-lang.org/en/'
17+
url = URI.parse 'https://www.ruby-lang.org/en/'asdasd;
18+
response = Net::HTTP.get_response(url)
19+
puts response.body
20+
```
21+
22+
</CH.Code>

packages/mdx/dev/content/comment-annotations.mdx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ console.log("hey")
2323
Same with other annotations like `mark` and `box`.
2424

2525
```js
26-
// mark(1:2)
27-
function foo() {
26+
// hey
27+
// mark(1)
28+
function foobarloremipsumfoobarloremipsumsitametfoobarloremipsumfoobarloremipsumsitamet() {
2829
// mark[6:9] mark-box
2930
console.log("hover me")
3031
return 8
@@ -88,7 +89,7 @@ function lorem(ipsum, dolor = 1) {
8889
# mark[3:7]
8990
local sit=0
9091
# label something something
91-
dolor=$((sit - amet(dolor)))
92+
dolor=$((sit - amet(dolor))
9293
# link[19:29] https://github.com/code-hike/codehike
9394
return $sit and consectetur(ipsum) or []
9495
}

packages/mdx/dev/files.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import fs from "fs"
22
import { remarkCodeHike } from "../src/index"
33
import { compile } from "@mdx-js/mdx"
4-
import theme from "shiki/themes/rose-pine-moon.json"
4+
import theme from "./theme.js"
55
import { withDebugger } from "mdx-debugger"
66

77
export async function getFiles() {
@@ -36,6 +36,7 @@ export async function getCode(file: any, config = {}) {
3636
autoImport: false,
3737
skipLanguages: ["", "mermaid"],
3838
showCopyButton: true,
39+
autoLink: true,
3940
theme,
4041
...config,
4142
},

0 commit comments

Comments
 (0)