@docubook/create 1.13.5 → 1.13.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +8 -4
- package/src/dist/.eslintrc.json +19 -0
- package/src/dist/app/docs/[[...slug]]/page.tsx +1 -1
- package/src/dist/app/page.tsx +1 -1
- package/src/dist/components/Sponsor.tsx +65 -5
- package/src/dist/components/leftbar.tsx +2 -2
- package/src/dist/components/markdown/ButtonMdx.tsx +0 -2
- package/src/dist/components/markdown/mdx-provider.tsx +1 -1
- package/src/dist/components/mob-toc.tsx +1 -1
- package/src/dist/components/search.tsx +2 -2
- package/src/dist/components/sublink.tsx +0 -3
- package/src/dist/components/toc-observer.tsx +3 -13
- package/src/dist/components/ui/icon-cloud.tsx +1 -1
- package/src/dist/components/ui/input.tsx +1 -2
- package/src/dist/components/ui/interactive-hover-button.tsx +1 -2
- package/src/dist/contents/docs/changelog/version-1/index.mdx +12 -0
- package/src/dist/contents/docs/getting-started/project-structure/index.mdx +1 -1
- package/src/dist/contents/docs/getting-started/theme-colors/coffee/index.mdx +0 -2
- package/src/dist/contents/docs/getting-started/theme-colors/default/index.mdx +0 -3
- package/src/dist/contents/docs/getting-started/theme-colors/freshlime/index.mdx +0 -3
- package/src/dist/contents/docs/getting-started/theme-colors/llms/index.mdx +12 -1
- package/src/dist/lib/markdown.ts +38 -12
- package/src/dist/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# DocuBook
|
|
1
|
+
# DocuBook CLI
|
|
2
2
|
|
|
3
3
|
**DocuBook** is a documentation web project designed to provide a simple and user-friendly interface for accessing various types of documentation. This site is crafted for developers and teams who need quick access to references, guides, and essential documents.
|
|
4
4
|
|
package/package.json
CHANGED
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docubook/create",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.9",
|
|
4
|
+
"description": "CLI to create DocuBook projects",
|
|
4
5
|
"main": "src/index.js",
|
|
5
6
|
"type": "module",
|
|
6
7
|
"bin": {
|
|
7
8
|
"create": "./src/index.js"
|
|
8
9
|
},
|
|
9
10
|
"keywords": [
|
|
10
|
-
"
|
|
11
|
-
"
|
|
11
|
+
"docs",
|
|
12
|
+
"markdown",
|
|
13
|
+
"react-template",
|
|
14
|
+
"nextjs-template",
|
|
12
15
|
"documentation"
|
|
13
16
|
],
|
|
17
|
+
"homepage": "https://docubook.pro/",
|
|
18
|
+
"repository": "github:DocuBook/docubook",
|
|
14
19
|
"author": "wildan.nrs",
|
|
15
20
|
"license": "MIT",
|
|
16
|
-
"description": "CLI to create DocuBook projects",
|
|
17
21
|
"dependencies": {
|
|
18
22
|
"boxen": "^8.0.1",
|
|
19
23
|
"chalk": "^5.3.0",
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": [
|
|
3
|
+
"next/core-web-vitals",
|
|
4
|
+
"next/typescript",
|
|
5
|
+
"plugin:@typescript-eslint/recommended"
|
|
6
|
+
],
|
|
7
|
+
"rules": {
|
|
8
|
+
"@typescript-eslint/no-explicit-any": "warn",
|
|
9
|
+
"@typescript-eslint/no-unused-vars": [
|
|
10
|
+
"warn",
|
|
11
|
+
{
|
|
12
|
+
"argsIgnorePattern": "^_",
|
|
13
|
+
"varsIgnorePattern": "^_",
|
|
14
|
+
"caughtErrorsIgnorePattern": "^_"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"@typescript-eslint/no-empty-object-type": "off"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -68,7 +68,7 @@ export default async function DocsPage({ params: { slug = [] } }: PageProps) {
|
|
|
68
68
|
|
|
69
69
|
if (!res) notFound();
|
|
70
70
|
|
|
71
|
-
const { title, description, image, date } = res.frontmatter;
|
|
71
|
+
const { title, description, image: _image, date } = res.frontmatter;
|
|
72
72
|
|
|
73
73
|
// File path for edit link
|
|
74
74
|
const filePath = `contents/docs/${slug.join("/") || ""}/index.mdx`;
|
package/src/dist/app/page.tsx
CHANGED
|
@@ -25,7 +25,7 @@ export default function Home() {
|
|
|
25
25
|
)}
|
|
26
26
|
>
|
|
27
27
|
<AnimatedShinyText className="inline-flex items-center justify-center px-4 py-1 transition ease-out hover:text-neutral-100 hover:duration-300 hover:dark:text-neutral-200">
|
|
28
|
-
<span>🚀 New Version - Release v1.13.
|
|
28
|
+
<span>🚀 New Version - Release v1.13.9</span>
|
|
29
29
|
<ArrowRightIcon className="ml-1 size-3 transition-transform duration-300 ease-in-out group-hover:translate-x-0.5" />
|
|
30
30
|
</AnimatedShinyText>
|
|
31
31
|
</div>
|
|
@@ -10,16 +10,76 @@ interface SponsorItem {
|
|
|
10
10
|
description?: string;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
interface NavbarConfig {
|
|
14
|
+
title?: string;
|
|
15
|
+
logo?: {
|
|
16
|
+
light?: string;
|
|
17
|
+
dark?: string;
|
|
18
|
+
};
|
|
19
|
+
links?: Array<{
|
|
20
|
+
title: string;
|
|
21
|
+
href: string;
|
|
22
|
+
external?: boolean;
|
|
23
|
+
}>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
interface FooterConfig {
|
|
27
|
+
text?: string;
|
|
28
|
+
links?: Array<{
|
|
29
|
+
title: string;
|
|
30
|
+
href: string;
|
|
31
|
+
external?: boolean;
|
|
32
|
+
}>;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
interface MetaConfig {
|
|
36
|
+
title?: string;
|
|
37
|
+
description?: string;
|
|
38
|
+
favicon?: string;
|
|
39
|
+
socialBanner?: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
interface RepositoryConfig {
|
|
43
|
+
url: string;
|
|
44
|
+
editUrl?: string;
|
|
45
|
+
branch?: string;
|
|
46
|
+
directory?: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
interface RouteItem {
|
|
50
|
+
title: string;
|
|
51
|
+
href: string;
|
|
52
|
+
noLink?: boolean;
|
|
53
|
+
context?: {
|
|
54
|
+
icon: string;
|
|
55
|
+
description: string;
|
|
56
|
+
title: string;
|
|
57
|
+
};
|
|
58
|
+
items?: RouteItem[];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
interface RouteConfig {
|
|
62
|
+
title: string;
|
|
63
|
+
href: string;
|
|
64
|
+
noLink?: boolean;
|
|
65
|
+
context?: {
|
|
66
|
+
icon: string;
|
|
67
|
+
description: string;
|
|
68
|
+
title: string;
|
|
69
|
+
};
|
|
70
|
+
items?: RouteItem[];
|
|
71
|
+
}
|
|
72
|
+
|
|
13
73
|
interface DocuConfig {
|
|
14
74
|
sponsor?: {
|
|
15
75
|
title?: string;
|
|
16
76
|
item?: SponsorItem;
|
|
17
77
|
};
|
|
18
|
-
navbar:
|
|
19
|
-
footer:
|
|
20
|
-
meta:
|
|
21
|
-
repository:
|
|
22
|
-
routes:
|
|
78
|
+
navbar: NavbarConfig;
|
|
79
|
+
footer: FooterConfig;
|
|
80
|
+
meta: MetaConfig;
|
|
81
|
+
repository: RepositoryConfig;
|
|
82
|
+
routes: RouteConfig[];
|
|
23
83
|
}
|
|
24
84
|
|
|
25
85
|
// Type assertion for docu.json
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "@/components/ui/sheet";
|
|
10
10
|
import { Logo, NavMenu } from "@/components/navbar";
|
|
11
11
|
import { Button } from "@/components/ui/button";
|
|
12
|
-
import {
|
|
12
|
+
import { LayoutGrid, PanelLeftClose, PanelLeftOpen } from "lucide-react";
|
|
13
13
|
import { DialogTitle, DialogDescription } from "@/components/ui/dialog";
|
|
14
14
|
import { ScrollArea } from "@/components/ui/scroll-area";
|
|
15
15
|
import DocsMenu from "@/components/docs-menu";
|
|
@@ -70,7 +70,7 @@ export function SheetLeftbar() {
|
|
|
70
70
|
<Sheet>
|
|
71
71
|
<SheetTrigger asChild>
|
|
72
72
|
<Button variant="ghost" size="icon" className="max-lg:flex hidden">
|
|
73
|
-
<
|
|
73
|
+
<LayoutGrid />
|
|
74
74
|
</Button>
|
|
75
75
|
</SheetTrigger>
|
|
76
76
|
<SheetContent className="flex flex-col gap-4 px-0" side="left">
|
|
@@ -7,7 +7,7 @@ import { useRef, useMemo } from "react";
|
|
|
7
7
|
import { usePathname } from "next/navigation";
|
|
8
8
|
import { Button } from "./ui/button";
|
|
9
9
|
import { motion, AnimatePresence } from "framer-motion";
|
|
10
|
-
import {
|
|
10
|
+
import { useActiveSection } from "@/hooks";
|
|
11
11
|
import { TocItem } from "@/lib/toc";
|
|
12
12
|
|
|
13
13
|
interface MobTocProps {
|
|
@@ -132,10 +132,10 @@ export default function Search() {
|
|
|
132
132
|
<div className="relative flex-1 cursor-pointer max-w-[140px]">
|
|
133
133
|
<div className="flex items-center">
|
|
134
134
|
<div className="md:hidden p-2 -ml-2">
|
|
135
|
-
<SearchIcon className="h-5 w-5 text-
|
|
135
|
+
<SearchIcon className="h-5 w-5 text-muted-foreground" />
|
|
136
136
|
</div>
|
|
137
137
|
<div className="hidden md:block w-full">
|
|
138
|
-
<SearchIcon className="absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-
|
|
138
|
+
<SearchIcon className="absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground" />
|
|
139
139
|
<Input
|
|
140
140
|
className="w-full rounded-full dark:bg-background/95 bg-background border h-9 pl-10 pr-0 sm:pr-4 text-sm shadow-sm overflow-ellipsis"
|
|
141
141
|
placeholder="Search"
|
|
@@ -32,9 +32,6 @@ export default function SubLink({
|
|
|
32
32
|
// Full path including parent's href
|
|
33
33
|
const fullHref = `${parentHref}${href}`;
|
|
34
34
|
|
|
35
|
-
// Check if current path exactly matches this link's href
|
|
36
|
-
const isExactActive = useMemo(() => path === fullHref, [path, fullHref]);
|
|
37
|
-
|
|
38
35
|
// Check if any child is active (for parent items)
|
|
39
36
|
const hasActiveChild = useMemo(() => {
|
|
40
37
|
if (!items) return false;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import { getDocsTocs } from "@/lib/markdown";
|
|
4
3
|
import clsx from "clsx";
|
|
5
4
|
import Link from "next/link";
|
|
6
5
|
import { useState, useRef, useEffect, useCallback } from "react";
|
|
@@ -110,7 +109,6 @@ export default function TocObserver({
|
|
|
110
109
|
|
|
111
110
|
// Calculate scroll progress for the active section
|
|
112
111
|
const [scrollProgress, setScrollProgress] = useState(0);
|
|
113
|
-
const [activeSectionIndex, setActiveSectionIndex] = useState(0);
|
|
114
112
|
|
|
115
113
|
useEffect(() => {
|
|
116
114
|
const handleScroll = () => {
|
|
@@ -137,15 +135,6 @@ export default function TocObserver({
|
|
|
137
135
|
return () => window.removeEventListener('scroll', handleScroll);
|
|
138
136
|
}, [activeId]);
|
|
139
137
|
|
|
140
|
-
// Update active section index when activeId changes
|
|
141
|
-
useEffect(() => {
|
|
142
|
-
if (activeId) {
|
|
143
|
-
const index = data.findIndex(item => item.href.slice(1) === activeId);
|
|
144
|
-
if (index !== -1) {
|
|
145
|
-
setActiveSectionIndex(index);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}, [activeId, data]);
|
|
149
138
|
|
|
150
139
|
return (
|
|
151
140
|
<div className="relative">
|
|
@@ -155,8 +144,9 @@ export default function TocObserver({
|
|
|
155
144
|
const id = href.slice(1);
|
|
156
145
|
const isActive = activeId === id;
|
|
157
146
|
const indent = level > 1 ? (level - 1) * 20 : 0;
|
|
158
|
-
|
|
159
|
-
const
|
|
147
|
+
// Prefix with underscore to indicate intentionally unused
|
|
148
|
+
const _isParent = hasChildren(id, level);
|
|
149
|
+
const _isLastInLevel = index === data.length - 1 || data[index + 1].level <= level;
|
|
160
150
|
|
|
161
151
|
return (
|
|
162
152
|
<div key={href} className="relative">
|
|
@@ -24,7 +24,7 @@ function easeOutCubic(t: number): number {
|
|
|
24
24
|
export function IconCloud({ icons, images }: IconCloudProps) {
|
|
25
25
|
const canvasRef = useRef<HTMLCanvasElement>(null);
|
|
26
26
|
const [iconPositions, setIconPositions] = useState<Icon[]>([]);
|
|
27
|
-
const [rotation
|
|
27
|
+
const [rotation] = useState({ x: 0, y: 0 });
|
|
28
28
|
const [isDragging, setIsDragging] = useState(false);
|
|
29
29
|
const [lastMousePos, setLastMousePos] = useState({ x: 0, y: 0 });
|
|
30
30
|
const [mousePos, setMousePos] = useState({ x: 0, y: 0 });
|
|
@@ -2,8 +2,7 @@ import * as React from "react"
|
|
|
2
2
|
|
|
3
3
|
import { cn } from "@/lib/utils"
|
|
4
4
|
|
|
5
|
-
export
|
|
6
|
-
extends React.InputHTMLAttributes<HTMLInputElement> {}
|
|
5
|
+
export type InputProps = React.InputHTMLAttributes<HTMLInputElement>;
|
|
7
6
|
|
|
8
7
|
const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
|
9
8
|
({ className, type, ...props }, ref) => {
|
|
@@ -2,8 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { ArrowRight } from "lucide-react";
|
|
3
3
|
import { cn } from "@/lib/utils";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
extends React.ButtonHTMLAttributes<HTMLButtonElement> {}
|
|
5
|
+
type InteractiveHoverButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
7
6
|
|
|
8
7
|
export const InteractiveHoverButton = React.forwardRef<
|
|
9
8
|
HTMLButtonElement,
|
|
@@ -8,6 +8,18 @@ date: 24-05-2025
|
|
|
8
8
|
This changelog contains a list of all the changes made to the DocuBook template. It will be updated with each new release and will include information about new features, bug fixes, and other improvements.
|
|
9
9
|
</Note>
|
|
10
10
|
|
|
11
|
+
<div className="sr-only">
|
|
12
|
+
### v 1.13.6
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<Release version="1.13.6" date="2025-06-01" title="Improve sheet leftbar and search icon">
|
|
16
|
+
<Changes type="improved">
|
|
17
|
+
- Improve sheet leftbar and search icon
|
|
18
|
+
- color scheme for sheet leftbar
|
|
19
|
+
- color scheme for search icon
|
|
20
|
+
</Changes>
|
|
21
|
+
</Release>
|
|
22
|
+
|
|
11
23
|
<div className="sr-only">
|
|
12
24
|
### v 1.13.5
|
|
13
25
|
</div>
|
|
@@ -6,7 +6,7 @@ date: 29-11-2024
|
|
|
6
6
|
|
|
7
7
|
## app
|
|
8
8
|
|
|
9
|
-
This folder contains the main application code for Next.js, managing layouts, routing, and specific content pages. It is organized to support both the `docs`
|
|
9
|
+
This folder contains the main application code for Next.js, managing layouts, routing, and specific content pages. It is organized to support both the `docs` sections, with dedicated pages and layouts for each section.
|
|
10
10
|
|
|
11
11
|
```
|
|
12
12
|
app // Main Next.js application folder
|
|
@@ -6,8 +6,6 @@ date: 2025-05-30
|
|
|
6
6
|
|
|
7
7
|
## Styles
|
|
8
8
|
|
|
9
|
-
DocuBook comes with a carefully designed color system that ensures consistency and accessibility across your documentation. The theme includes both light and dark modes, automatically adapting to the user's system preferences.
|
|
10
|
-
|
|
11
9
|
<Note type="note" title="note">
|
|
12
10
|
You can override the default styles by adding your own CSS variables in the `globals.css` and `syntax.css` files.
|
|
13
11
|
</Note>
|
|
@@ -5,9 +5,6 @@ date: 2025-05-20
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
## Styles
|
|
8
|
-
|
|
9
|
-
DocuBook comes with a carefully designed color system that ensures consistency and accessibility across your documentation. The theme includes both light and dark modes, automatically adapting to the user's system preferences.
|
|
10
|
-
|
|
11
8
|
<Note type="note" title="note">
|
|
12
9
|
You can override the default styles by adding your own CSS variables in the `globals.css` and `syntax.css` files.
|
|
13
10
|
</Note>
|
|
@@ -5,9 +5,6 @@ date: 2025-05-30
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
## Styles
|
|
8
|
-
|
|
9
|
-
DocuBook comes with a carefully designed color system that ensures consistency and accessibility across your documentation. The theme includes both light and dark modes, automatically adapting to the user's system preferences.
|
|
10
|
-
|
|
11
8
|
<Note type="note" title="note">
|
|
12
9
|
You can override the default styles by adding your own CSS variables in the `globals.css` and `syntax.css` files.
|
|
13
10
|
</Note>
|
|
@@ -7,6 +7,14 @@ date: 2025-05-31
|
|
|
7
7
|
## Introduction
|
|
8
8
|
This document explains how to create and implement custom color themes using AI with LLMS context. The context includes a consistent color palette for both light and dark modes, along with syntax highlighting colors for code.
|
|
9
9
|
|
|
10
|
+
## File Structure
|
|
11
|
+
<Files>
|
|
12
|
+
<Folder name="styles">
|
|
13
|
+
<File name="globals.css" />
|
|
14
|
+
<File name="syntax.css" />
|
|
15
|
+
</Folder>
|
|
16
|
+
</Files>
|
|
17
|
+
|
|
10
18
|
## Generate New Theme
|
|
11
19
|
|
|
12
20
|
<Stepper>
|
|
@@ -24,11 +32,14 @@ This document explains how to create and implement custom color themes using AI
|
|
|
24
32
|
|
|
25
33
|
```markdown
|
|
26
34
|
Create a new color theme based on the provided context with the following requirements:
|
|
27
|
-
1. Different primary color
|
|
35
|
+
1. Different primary color #2281E3
|
|
28
36
|
2. Maintain good contrast for accessibility
|
|
29
37
|
3. Include variants for both light and dark modes
|
|
30
38
|
4. Keep the same structure as the provided context
|
|
31
39
|
```
|
|
40
|
+
<Note type="danger" title="Colors example">
|
|
41
|
+
changes the value of Hex color `#2281E3` into your brand colors.
|
|
42
|
+
</Note>
|
|
32
43
|
</StepperItem>
|
|
33
44
|
</Stepper>
|
|
34
45
|
|
package/src/dist/lib/markdown.ts
CHANGED
|
@@ -8,8 +8,26 @@ import rehypeSlug from "rehype-slug";
|
|
|
8
8
|
import rehypeCodeTitles from "rehype-code-titles";
|
|
9
9
|
import { page_routes, ROUTES } from "./routes-config";
|
|
10
10
|
import { visit } from "unist-util-visit";
|
|
11
|
+
import type { Node } from "unist";
|
|
11
12
|
import matter from "gray-matter";
|
|
12
13
|
|
|
14
|
+
// Type definitions for unist-util-visit
|
|
15
|
+
interface Element extends Node {
|
|
16
|
+
type: string;
|
|
17
|
+
tagName?: string;
|
|
18
|
+
properties?: Record<string, unknown> & {
|
|
19
|
+
raw?: string;
|
|
20
|
+
};
|
|
21
|
+
children?: Node[];
|
|
22
|
+
value?: string;
|
|
23
|
+
raw?: string; // For internal use in processing
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
interface TextNode extends Node {
|
|
27
|
+
type: 'text';
|
|
28
|
+
value: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
13
31
|
// custom components imports
|
|
14
32
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
|
15
33
|
import Pre from "@/components/markdown/PreMdx";
|
|
@@ -139,11 +157,11 @@ function justGetFrontmatterFromMD<Frontmatter>(rawMd: string): Frontmatter {
|
|
|
139
157
|
}
|
|
140
158
|
|
|
141
159
|
export async function getAllChilds(pathString: string) {
|
|
142
|
-
const items = pathString.split("/").filter((it) => it
|
|
160
|
+
const items = pathString.split("/").filter((it) => it !== "");
|
|
143
161
|
let page_routes_copy = ROUTES;
|
|
144
162
|
|
|
145
163
|
let prevHref = "";
|
|
146
|
-
for (
|
|
164
|
+
for (const it of items) {
|
|
147
165
|
const found = page_routes_copy.find((innerIt) => innerIt.href == `/${it}`);
|
|
148
166
|
if (!found) break;
|
|
149
167
|
prevHref += found.href;
|
|
@@ -170,20 +188,28 @@ export async function getAllChilds(pathString: string) {
|
|
|
170
188
|
}
|
|
171
189
|
|
|
172
190
|
// for copying the code in pre
|
|
173
|
-
const preProcess = () => (tree:
|
|
174
|
-
visit(tree, (node) => {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
191
|
+
const preProcess = () => (tree: Node) => {
|
|
192
|
+
visit(tree, (node: Node) => {
|
|
193
|
+
const element = node as Element;
|
|
194
|
+
if (element?.type === "element" && element?.tagName === "pre" && element.children) {
|
|
195
|
+
const [codeEl] = element.children as Element[];
|
|
196
|
+
if (codeEl.tagName !== "code" || !codeEl.children?.[0]) return;
|
|
197
|
+
|
|
198
|
+
const textNode = codeEl.children[0] as TextNode;
|
|
199
|
+
if (textNode.type === 'text' && textNode.value) {
|
|
200
|
+
element.raw = textNode.value;
|
|
201
|
+
}
|
|
179
202
|
}
|
|
180
203
|
});
|
|
181
204
|
};
|
|
182
205
|
|
|
183
|
-
const postProcess = () => (tree:
|
|
184
|
-
visit(tree, "element", (node) => {
|
|
185
|
-
|
|
186
|
-
|
|
206
|
+
const postProcess = () => (tree: Node) => {
|
|
207
|
+
visit(tree, "element", (node: Node) => {
|
|
208
|
+
const element = node as Element;
|
|
209
|
+
if (element?.type === "element" && element?.tagName === "pre") {
|
|
210
|
+
if (element.properties && element.raw) {
|
|
211
|
+
element.properties.raw = element.raw;
|
|
212
|
+
}
|
|
187
213
|
}
|
|
188
214
|
});
|
|
189
215
|
};
|