Skip to content

Commit aed1eee

Browse files
authored
Merge pull request #230 from code-hike/next
v0.7.0
2 parents d83ab72 + 803d5c1 commit aed1eee

30 files changed

+2712
-893
lines changed

.github/workflows/bundle_analysis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ jobs:
1818
steps:
1919
- uses: actions/checkout@v2
2020

21-
- name: Use Node.js 14.x
21+
- name: Use Node.js 16.x
2222
uses: actions/setup-node@v1
2323
with:
24-
node-version: 14.x
24+
node-version: 16.x
2525

2626
- name: Cache node modules
2727
uses: actions/cache@v1

.github/workflows/release.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313
- name: Prepare repository
1414
run: git fetch --unshallow --tags
1515

16-
- name: Use Node.js 14.x
16+
- name: Use Node.js 16.x
1717
uses: actions/setup-node@v1
1818
with:
19-
node-version: 14.x
19+
node-version: 16.x
2020

2121
- name: Cache node modules
2222
uses: actions/cache@v1

examples/docusaurus/docs/intro.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
sidebar_position: 1
33
---
44

5-
### Lorem ipsum
5+
# Introduction
6+
7+
## Lorem ipsum
68

79
```python hello.py
810
# mark[22:30]

examples/docusaurus/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
},
1616
"dependencies": {
1717
"@code-hike/mdx": "^0.6.2",
18-
"@docusaurus/core": "2.0.0-beta.18",
19-
"@docusaurus/preset-classic": "2.0.0-beta.18",
18+
"@docusaurus/core": "2.0.0-rc.1",
19+
"@docusaurus/preset-classic": "2.0.0-rc.1",
2020
"@mdx-js/react": "^2.1.1",
2121
"clsx": "^1.1.1",
22-
"docusaurus-theme-mdx-v2": "^0.1.1",
22+
"docusaurus-theme-mdx-v2": "^0.1.2",
2323
"prism-react-renderer": "^1.3.1",
2424
"react": "^17.0.2",
2525
"react-dom": "^17.0.2"

examples/nextjs/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Next.js + Code Hike
2+
3+
See [this guide](https://codehike.org/docs/installation/nextjs) or try it on [Stackblitz](https://stackblitz.com/github/code-hike/codehike/tree/main/examples/nextjs).

examples/nextjs/pages/_app.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import "@code-hike/mdx/styles"
22

33
function MyApp({ Component, pageProps }) {
4-
return <Component {...pageProps} />
4+
return (
5+
<article style={{ maxWidth: 768, margin: "0 auto" }}>
6+
<Component {...pageProps} />
7+
</article>
8+
)
59
}
610

711
export default MyApp

examples/nextjs/pages/index.js

-9
This file was deleted.

examples/nextjs/pages/my.md renamed to examples/nextjs/pages/index.mdx

+2
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ print("Rendered with Code Hike")
77
```
88

99
Lorem ipsum dolor sit amet.
10+
11+
See also [Scrollycoding page](/scrollycoding).

examples/nextjs/pages/scrolly.mdx renamed to examples/nextjs/pages/scrollycoding.mdx

+59-69
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Scrollycoding with preview
1+
# Scrollycoding
22

33
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilities morbi tempus. Praesent elementum facilisis leo vel fringilla. Congue mauris rhoncus aenean vel. Egestas sed tempus urna et pharetra pharetra massa massa ultricies.
44

55
Consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilities morbi tempus. Praesent elementum facilisis leo vel fringilla. Congue mauris rhoncus aenean vel. Egestas sed tempus urna et pharetra pharetra massa massa ultricies.
66

7-
<CH.Scrollycoding preset="https://codesandbox.io/s/w5wfe">
7+
<CH.Scrollycoding>
88

99
## Step 1
1010

@@ -14,23 +14,35 @@ Lorem ipsum dolor sit amet, consectetur adipiscing something about points, sed d
1414
> ad diffusa illis voluisti fidensque coniugiale laniata curam. Aras rivus
1515
> eripuit, qua fistula haec partus; serpens, negat.
1616
17-
Consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget.
18-
1917
Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilities morbi tempus.
2018

21-
```jsx src/App.js
22-
import { motion } from "framer-motion"
23-
24-
export default function App() {
25-
const bg = "hsl(20, 100%, 50%)"
26-
return (
27-
<motion.div
28-
className="swatch"
29-
animate={{ backgroundColor: bg }}
30-
transition={{ duration: 1 }}
31-
/>
32-
)
33-
}
19+
```js app.js focus=3:10
20+
const { lorem, ipsum } = dolor({
21+
sit: {
22+
amet: 1,
23+
consectetur: 2,
24+
adipiscing: (elit) => ({
25+
sed: elit,
26+
}),
27+
eiusmod: (tempor) => ({
28+
incididunt: tempor,
29+
}),
30+
ut: (labore) => ({
31+
et: labore,
32+
dolore: labore + 1,
33+
}),
34+
magna: (aliqua) => ({
35+
ut: aliqua,
36+
}),
37+
nostrud: (elit) => ({
38+
exercitation: elit,
39+
ullamco: elit,
40+
}),
41+
laboris: (elit) => ({
42+
nisi: elit,
43+
}),
44+
},
45+
})
3446
```
3547

3648
---
@@ -45,19 +57,8 @@ Id aliquet risus feugiat in ante metus dictum at tempor. Sed blandit libero volu
4557

4658
Morbi quis commodo.
4759

48-
```jsx src/App.js focus=1,4,6:10
49-
import { motion } from "framer-motion"
50-
51-
export default function App() {
52-
const bg = "hsl(110, 100%, 50%)"
53-
return (
54-
<motion.div
55-
className="swatch"
56-
animate={{ backgroundColor: bg }}
57-
transition={{ duration: 1 }}
58-
/>
59-
)
60-
}
60+
```js app.js focus=11:17
61+
6162
```
6263

6364
---
@@ -72,19 +73,30 @@ Id aliquet risus feugiat in ante metus dictum at tempor. Sed blandit libero volu
7273

7374
Ut consequat semper viverra. Fringilla ut morbi tincidunt augue interdum velit euismod.
7475

75-
```jsx src/App.js focus=1,4,6:10
76-
import { motion } from "framer-motion"
77-
78-
export default function App() {
79-
const bg = "hsl(200, 100%, 50%)"
80-
return (
81-
<motion.div
82-
className="swatch"
83-
animate={{ backgroundColor: bg }}
84-
transition={{ duration: 1 }}
85-
/>
86-
)
87-
}
76+
```js app.js focus=11:14
77+
const { lorem, ipsum } = dolor({
78+
sit: {
79+
amet: 1,
80+
consectetur: 2,
81+
adipiscing: (elit) => ({
82+
sed: elit,
83+
}),
84+
eiusmod: (tempor) => ({
85+
incididunt: tempor,
86+
}),
87+
ut: (labore) => ({
88+
et: lorem(labore * ipsum),
89+
dolore: lorem(labore + 1),
90+
}),
91+
nostrud: (elit) => ({
92+
exercitation: elit,
93+
ullamco: elit,
94+
}),
95+
laboris: (elit) => ({
96+
nisi: elit,
97+
}),
98+
},
99+
})
88100
```
89101

90102
---
@@ -100,19 +112,8 @@ Sed blandit libero volutpat sed cras.
100112

101113
Gravida in fermentum et sollicitudin ac orci phasellus egestas tellus. Volutpat consequat mauris nunc congue nisi vitae.
102114

103-
```jsx src/App.js focus=1,4,6:10
104-
import { motion } from "framer-motion"
105-
106-
export default function App() {
107-
const bg = "hsl(290, 100%, 50%)"
108-
return (
109-
<motion.div
110-
className="swatch"
111-
animate={{ backgroundColor: bg }}
112-
transition={{ duration: 1 }}
113-
/>
114-
)
115-
}
115+
```js app.js focus=15:21
116+
116117
```
117118

118119
---
@@ -132,19 +133,8 @@ Mi bibendum neque egestas congue quisque egestas diam in arcu. Nisi lacus sed vi
132133

133134
Morbi quis commodo.
134135

135-
```jsx src/App.js focus=1,4,6:10
136-
import { motion } from "framer-motion"
137-
138-
export default function App() {
139-
const bg = "hsl(10, 100%, 50%)"
140-
return (
141-
<motion.div
142-
className="swatch"
143-
animate={{ backgroundColor: bg }}
144-
transition={{ duration: 1 }}
145-
/>
146-
)
147-
}
136+
```js app.js
137+
148138
```
149139

150140
</CH.Scrollycoding>

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"scripts": {
1212
"build": "lerna run --stream build",
1313
"build:lib": "lerna run --stream --scope @*/mdx build",
14+
"watch": "lerna run --stream --scope @*/mdx watch",
1415
"build:playground": "lerna run --stream --scope playground build",
1516
"test": "lerna run --stream test",
1617
"dev": "lerna run --stream --scope @*/mdx dev",

0 commit comments

Comments
 (0)