Skip to content

Commit 32f8358

Browse files
committed
feat: add lint command in nextra-theme-docs
1 parent 049a781 commit 32f8358

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+6416
-415
lines changed

apps/web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
"@graphql-codegen/typescript-operations": "^4.2.0",
7676
"@graphql-codegen/typescript-react-query": "^6.1.0",
7777
"@packages/eslint-config": "workspace:*",
78+
"@packages/nextra-theme-docs": "workspace:*",
7879
"@packages/tsconfig": "workspace:*",
7980
"@svgr/cli": "^8.0.1",
8081
"@testing-library/react": "^14.0.0",

apps/web/src/app/books/layout.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import BookEditLayout from '@/features/bookEdit/layout/BookEditLayout'
2+
3+
type Props = {
4+
children: React.ReactNode
5+
}
6+
7+
function page({ children }: Props) {
8+
return <BookEditLayout>{children}</BookEditLayout>
9+
}
10+
11+
export default page

apps/web/src/app/books/page.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// import Aside from '@/features/bookEdit/components/Aside'
2+
3+
function page() {
4+
return (
5+
<>
6+
{/* <Aside /> */}
7+
hello
8+
</>
9+
)
10+
}
11+
12+
export default page
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.block {
2+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import Aside from './Aside'
2+
import { render } from '@testing-library/react'
3+
4+
describe('Aside', () => {
5+
it('renders successfully', () => {
6+
render(<Aside />)
7+
})
8+
})
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
'use client'
2+
3+
import styles from './Aside.module.css'
4+
import { bindClassNames } from '@/lib/styles/bindClassNames'
5+
// import { Navbar } from '@packages/nextra-theme-docs'
6+
7+
const cx = bindClassNames(styles)
8+
9+
function Aside() {
10+
return <div className={cx('block')}>{/* <Navbar flatDirectories={} /> */}</div>
11+
}
12+
13+
export default Aside
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default } from './Aside'
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.block {
2+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import Header from './Header'
2+
import { render } from '@testing-library/react'
3+
4+
describe('Header', () => {
5+
it('renders successfully', () => {
6+
render(<Header />)
7+
})
8+
})
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
'use client'
2+
3+
import styles from './Header.module.css'
4+
import { bindClassNames } from '@/lib/styles/bindClassNames'
5+
6+
const cx = bindClassNames(styles)
7+
8+
type Props = {}
9+
10+
function Header({}: Props) {
11+
return <div className={cx('block')}></div>
12+
}
13+
14+
export default Header
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default } from './Header'
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.block {
2+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import BookEditLayout from './BookEditLayout'
2+
import { render } from '@testing-library/react'
3+
4+
describe('BookEditLayout', () => {
5+
it('renders successfully', () => {
6+
render(<BookEditLayout />)
7+
})
8+
})
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
'use client'
2+
3+
import styles from './BookEditLayout.module.css'
4+
import { bindClassNames } from '@/lib/styles/bindClassNames'
5+
6+
const cx = bindClassNames(styles)
7+
8+
type Props = {
9+
children: React.ReactNode
10+
}
11+
12+
function BookEditLayout({ children }: Props) {
13+
return <div className={cx('block')}>{children}</div>
14+
}
15+
16+
export default BookEditLayout
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default } from './BookEditLayout'

packages/nextra-theme-docs/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Shu Ding
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

packages/nextra-theme-docs/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# nextra-theme-docs
2+
3+
A documentation site theme for [Nextra](https://github.com/shuding/nextra).
4+
5+
## Example
6+
7+
[nextra.vercel.app](https://nextra.vercel.app/)
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
.nextra-hamburger svg {
2+
g {
3+
@apply nx-origin-center;
4+
transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1);
5+
}
6+
path {
7+
opacity: 1;
8+
transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1) 0.2s, opacity 0.2s ease 0.2s;
9+
}
10+
11+
&.open {
12+
path {
13+
transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1), opacity 0s ease 0.2s;
14+
}
15+
g {
16+
transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1) 0.2s;
17+
}
18+
}
19+
20+
&.open > {
21+
path {
22+
@apply nx-opacity-0;
23+
}
24+
g:nth-of-type(1) {
25+
@apply nx-rotate-45;
26+
path {
27+
transform: translate3d(0, 6px, 0);
28+
}
29+
}
30+
g:nth-of-type(2) {
31+
@apply -nx-rotate-45;
32+
path {
33+
transform: translate3d(0, -6px, 0);
34+
}
35+
}
36+
}
37+
}
Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
@import 'tailwindcss/base';
2+
@import 'tailwindcss/components';
3+
@import 'tailwindcss/utilities';
4+
@import 'nextra/styles/variables.css';
5+
@import 'nextra/styles/code-block.css';
6+
@import 'nextra/styles/subheading-anchor.css';
7+
@import 'nextra/styles/scrollbar.css';
8+
@import 'nextra/styles/steps.css';
9+
@import 'nextra/styles/cards.css';
10+
@import './hamburger.css';
11+
@import './typesetting-article.css';
12+
13+
html {
14+
@apply nx-antialiased nx-text-base nx-scroll-pt-[--nextra-navbar-height];
15+
font-feature-settings: 'rlig' 1, 'calt' 1, 'ss01' 1;
16+
-webkit-tap-highlight-color: transparent;
17+
}
18+
19+
body {
20+
@apply nx-w-full nx-bg-white dark:nx-bg-dark dark:nx-text-gray-100;
21+
}
22+
23+
a,
24+
summary,
25+
button,
26+
input,
27+
[tabindex]:not([tabindex='-1']) {
28+
@apply nx-outline-none;
29+
&:focus-visible {
30+
@apply nx-ring-2 nx-ring-primary-200 nx-ring-offset-1 nx-ring-offset-primary-300 dark:nx-ring-primary-800 dark:nx-ring-offset-primary-700;
31+
}
32+
}
33+
34+
a,
35+
summary {
36+
@apply nx-rounded;
37+
}
38+
39+
.nextra-content {
40+
@apply nx-text-slate-700 dark:nx-text-slate-200;
41+
}
42+
43+
@media (max-width: 767px) {
44+
.nextra-sidebar-container {
45+
@apply nx-fixed nx-pt-[calc(var(--nextra-navbar-height))] nx-top-0 nx-w-full nx-bottom-0 nx-z-[15] nx-overscroll-contain nx-bg-white dark:nx-bg-dark;
46+
transition: transform 0.8s cubic-bezier(0.52, 0.16, 0.04, 1);
47+
will-change: transform, opacity;
48+
contain: layout style;
49+
backface-visibility: hidden;
50+
51+
& > .nextra-scrollbar {
52+
mask-image: linear-gradient(to bottom, transparent, #000 20px),
53+
linear-gradient(to left, #000 10px, transparent 10px);
54+
}
55+
}
56+
57+
.nextra-banner-container ~ div {
58+
.nextra-sidebar-container {
59+
@apply nx-pt-[6.5rem];
60+
}
61+
&.nextra-nav-container {
62+
@apply nx-top-10 md:nx-top-0;
63+
}
64+
}
65+
.nextra-banner-hidden {
66+
.nextra-banner-container ~ div .nextra-sidebar-container {
67+
@apply nx-pt-16;
68+
}
69+
.nextra-nav-container {
70+
@apply !nx-top-0;
71+
}
72+
}
73+
.nextra-search .excerpt {
74+
@apply nx-overflow-hidden nx-text-ellipsis;
75+
display: -webkit-box;
76+
line-clamp: 1;
77+
-webkit-line-clamp: 1;
78+
-webkit-box-orient: vertical;
79+
}
80+
}
81+
82+
@media (prefers-reduced-motion: reduce) and (max-width: 767px) {
83+
article:before,
84+
.nextra-sidebar-container,
85+
.nextra-sidebar-container.open,
86+
body.resizing .nextra-sidebar-container {
87+
@apply nx-transition-none;
88+
}
89+
}
90+
91+
/* Content Typography */
92+
article details > summary {
93+
&::-webkit-details-marker {
94+
@apply nx-hidden;
95+
}
96+
&::before {
97+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='h-5 w-5' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z' clip-rule='evenodd' /%3E%3C/svg%3E");
98+
height: 1.2em;
99+
width: 1.2em;
100+
vertical-align: -4px;
101+
}
102+
}
103+
104+
@media (min-width: 768px) {
105+
.nextra-toc > .div,
106+
.nextra-sidebar-container {
107+
mask-image: linear-gradient(to bottom, transparent, #000 20px),
108+
linear-gradient(to left, #000 10px, transparent 10px);
109+
}
110+
}
111+
112+
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
113+
.nextra-search ul {
114+
@apply nx-backdrop-blur-lg nx-bg-white/70 dark:nx-bg-dark/80;
115+
}
116+
.nextra-nav-container-blur {
117+
@apply nx-backdrop-blur-md nx-bg-white/[.85] dark:!nx-bg-dark/80;
118+
}
119+
}
120+
121+
input[type='search'] {
122+
&::-webkit-search-decoration,
123+
&::-webkit-search-cancel-button,
124+
&::-webkit-search-results-button,
125+
&::-webkit-search-results-decoration {
126+
-webkit-appearance: none;
127+
}
128+
}
129+
130+
.contains-task-list {
131+
@apply nx-ml-0 nx-list-none;
132+
input[type='checkbox'] {
133+
@apply nx-mr-1;
134+
}
135+
}
136+
137+
.nextra-banner-hidden .nextra-banner-container {
138+
@apply nx-hidden;
139+
}
140+
141+
.nextra-sidebar-container {
142+
[data-toggle-animation='show'] button {
143+
opacity: 0;
144+
animation: nextra-fadein 1s ease 0.2s forwards;
145+
}
146+
[data-toggle-animation='hide'] button {
147+
opacity: 0;
148+
animation: nextra-fadein2 1s ease 0.2s forwards;
149+
}
150+
}
151+
152+
.footnotes a[data-footnote-backref] {
153+
font-family: initial;
154+
}
155+
156+
@keyframes nextra-fadein {
157+
0% {
158+
opacity: 0;
159+
}
160+
100% {
161+
opacity: 1;
162+
}
163+
}
164+
165+
@keyframes nextra-fadein2 {
166+
0% {
167+
opacity: 0;
168+
}
169+
100% {
170+
opacity: 1;
171+
}
172+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
article.nextra-body-typesetting-article {
2+
font-size: 17px;
3+
font-feature-settings: 'rlig' 1, 'calt' 1;
4+
h1 {
5+
@apply nx-mt-6 nx-mb-4 nx-text-center;
6+
font-size: 2.5rem;
7+
}
8+
h2 {
9+
@apply nx-border-none;
10+
}
11+
a {
12+
@apply nx-no-underline hover:nx-underline;
13+
}
14+
p {
15+
@apply nx-leading-8;
16+
}
17+
code {
18+
@apply nx-border-none dark:nx-bg-neutral-700;
19+
}
20+
pre code {
21+
@apply dark:nx-bg-transparent;
22+
}
23+
.subheading-anchor + a {
24+
@apply nx-no-underline hover:nx-no-underline after:nx-hidden;
25+
}
26+
}

0 commit comments

Comments
 (0)