Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions i18n/en/code.json
Original file line number Diff line number Diff line change
Expand Up @@ -812,5 +812,13 @@
"Databend runs the same in Cloud, Docker, or `pip install`.": {
"message": "Databend runs the same in Cloud, Docker, or `pip install`.",
"description": "Description for unified deployment feature"
},
"Ask questions about this page": {
"message": "Ask questions about this page",
"description": "Ask questions about this page"
},
"Open in": {
"message": "Open in",
"description": "Open in"
}
}
30 changes: 19 additions & 11 deletions i18n/zh/code.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"description": "The first paragraph of the 404 page"
},
"theme.NotFound.p2": {
"message": "请联系原始链接来源网站的所有者,并告知他们链接已损坏。",
"message": "请联系原始链接来源网站的所有者并告知他们链接已损坏。",
"description": "The 2nd paragraph of the 404 page"
},
"theme.admonition.note": {
Expand Down Expand Up @@ -138,7 +138,7 @@
"description": "The label used to tell the user that he's browsing an unreleased doc version"
},
"theme.docs.versions.unmaintainedVersionLabel": {
"message": "此为 {siteTitle} {versionLabel} 版的文档,现已不再积极维护。",
"message": "此为 {siteTitle} {versionLabel} 版的文档现已不再积极维护。",
"description": "The label used to tell the user that he's browsing an unmaintained doc version"
},
"theme.docs.versions.latestVersionSuggestionLabel": {
Expand Down Expand Up @@ -414,7 +414,7 @@
"description": "Thanks for voting!"
},
"Did this page help you?": {
"message": "指出文档中的错误或问题,我们将会赠予您专属纪念 T 恤一件!",
"message": "指出文档中的错误或问题我们将会赠予您专属纪念 T 恤一件!",
"description": "Did this page help you?"
},
"Explore Databend Cloud for FREE": {
Expand Down Expand Up @@ -470,15 +470,15 @@
"description": "Cloud Data Analytics"
},
"Databend - Your best alternative to Snowflake. Cost-effective and simple for massive-scale analytics.": {
"message": "Databend - 替代 Snowflake 的最佳方案。高性价比且简单易用,适用于大规模数据分析。",
"message": "Databend - 替代 Snowflake 的最佳方案。高性价比且简单易用适用于大规模数据分析。",
"description": "Databend - Your best alternative to Snowflake. Cost-effective and simple for massive-scale analytics."
},
"PAGE NOT FOUND": {
"message": "页面未找到",
"description": "PAGE NOT FOUND"
},
"Please check your link or head Home to regroup.": {
"message": "页面地址可能有所变更或者不存在,请检查您的链接或返回到操作指南。",
"message": "页面地址可能有所变更或者不存在请检查您的链接或返回到操作指南。",
"description": "Either you're out of bounds or that page doesn't exist. Please check your link or head Home to regroup."
},
"BACK TO HOME": {
Expand Down Expand Up @@ -554,7 +554,7 @@
"description": "所有工具的链接文字"
},
"Databend offers connectors and plugins for integrating with major data import tools, ensuring efficient data synchronization.": {
"message": "Databend 提供主流导入工具的连接器与插件,保障高效同步。",
"message": "Databend 提供主流导入工具的连接器与插件保障高效同步。",
"description": "AI & BI & 可视化 & 笔记本 部分的描述"
},
"Continuous Data Pipelines": {
Expand Down Expand Up @@ -614,15 +614,15 @@
"description": "Databend Cloud 产品的标题"
},
"Fully-managed cloud service. No setup required.": {
"message": "全托管云服务,开箱即可使用。",
"message": "全托管云服务开箱即可使用。",
"description": "Databend Cloud 产品的描述"
},
"Databend Enterprise": {
"message": "Databend 企业版",
"description": "Databend Enterprise 产品的标题"
},
"Self-hosted with enterprise features and support.": {
"message": "自主部署,配备企业级功能与支持。",
"message": "自主部署配备企业级功能与支持。",
"description": "Databend Enterprise 产品的描述"
},
"Databend Community": {
Expand Down Expand Up @@ -766,7 +766,7 @@
"description": "Start with Databend Cloud"
},
"Get started in minutes with our fully-managed cloud service. No setup required.": {
"message": "几分钟即可启用全托管云服务,无需任何额外配置。",
"message": "几分钟即可启用全托管云服务无需任何额外配置。",
"description": "Get started in minutes with our fully-managed cloud service. No setup required."
},
"What you need to know:": {
Expand All @@ -790,7 +790,7 @@
"description": "Deploy Your Own Instance"
},
"Install Databend on your infrastructure for complete control and customization.": {
"message": "在自有基础设施上安装 Databend,配置完全可控。",
"message": "在自有基础设施上安装 Databend配置完全可控。",
"description": "Install Databend on your infrastructure for complete control and customization."
},
"5-Minute Quick Start": {
Expand All @@ -810,7 +810,7 @@
"description": "Copy Page"
},
"Copy page as Markdown for LLMs": {
"message": "复制为 Markdown 格式,供大语言模型使用",
"message": "复制为 Markdown 格式供大语言模型使用",
"description": "Copy page as Markdown for LLMs"
},
"View as Markdown": {
Expand Down Expand Up @@ -840,5 +840,13 @@
"Search & Geo Native": {
"message": "原生搜索与地理",
"description": "Headline for search native feature"
},
"Ask questions about this page": {
"message": "询问关于此页面的问题",
"description": "Ask questions about this page"
},
"Open in": {
"message": "打开",
"description": "Open in"
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"prism-react-renderer": "^2.3.0",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react-icons": "^5.5.0",
"react-markdown": "^9.0.1",
"react-scroll-progress-bar": "^2.0.3",
"react-slick": "^0.31.0",
Expand Down
49 changes: 42 additions & 7 deletions src/components/CopyPageButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@ import React, { useState, useMemo, useCallback } from "react";
import { Button, Dropdown, Flex, Spin } from "antd";
import styles from "./styles.module.scss";
import DownArrow from "@site/static/icons/down.svg";
import MarkdownSvg from "@site/static/icons/markdown.svg";
import CopySvg from "@site/static/icons/copy.svg";
import CopiedSvg from "@site/static/icons/copied.svg";
import { useDoc } from "@docusaurus/plugin-content-docs/client";
import axios from "axios";
import $t from "@site/src/utils/tools";
import TurndownService from "turndown";
import { LiaMarkdown } from "react-icons/lia";
import { RiOpenaiFill } from "react-icons/ri";
import { RiClaudeFill } from "react-icons/ri";
import { SiPerplexity } from "react-icons/si";
import { LuCopy } from "react-icons/lu";
import { LuCopyCheck } from "react-icons/lu";

const SPECIAL_LINKS = [
"/guides/",
"/guides/products/dc/platforms",
Expand Down Expand Up @@ -83,16 +87,34 @@ const CopyDropdownButton: React.FC = () => {
const items = [
{
key: "copy",
icon: <CopySvg width={16} height={16} />,
icon: <LuCopy size={18} />,
label: $t("Copy Page"),
description: $t("Copy page as Markdown for LLMs"),
},
{
key: "markdown",
icon: <MarkdownSvg width={18} height={18} />,
icon: <LiaMarkdown size={18} />,
label: $t("View as Markdown"),
description: $t("View this page as plain text"),
},
{
key: "gpt",
icon: <RiOpenaiFill size={18} />,
label: `${$t("Open in")} ChatGPT`,
description: $t("Ask questions about this page"),
},
{
key: "claude",
icon: <RiClaudeFill size={18} />,
label: `${$t("Open in")} Claude`,
description: $t("Ask questions about this page"),
},
{
key: "perplexity",
icon: <SiPerplexity size={18} />,
label: `${$t("Open in")} Perplexity`,
description: $t("Ask questions about this page"),
},
];

return {
Expand All @@ -109,6 +131,19 @@ const CopyDropdownButton: React.FC = () => {
onClick: ({ key }: { key: string }) => {
if (key === "copy") handleCopy(sourceUrl);
if (key === "markdown") window.open(sourceUrl, "_blank");
if (key === "gpt")
window.open(
`https://chat.openai.com/?hints=search&q=Read from ${window.location.href} so I can ask questions about it.`
);
if (key === "claude")
window.open(
`https://claude.ai/new?q=Read from ${window.location.href} so I can ask questions about it.`
);
if (key === "perplexity") {
window.open(
`https://www.perplexity.ai/search/new?q=Read from ${window.location.href} so I can ask questions about it`
);
}
},
};
}, [sourceUrl, handleCopy]);
Expand All @@ -118,9 +153,9 @@ const CopyDropdownButton: React.FC = () => {
{loading ? (
<Spin size="small" />
) : isCopied ? (
<CopiedSvg width={16} height={16} />
<LuCopyCheck size={18} />
) : (
<CopySvg width={16} height={16} />
<LuCopy size={18} />
)}
<span className={styles.buttonText}>
{loading ? $t("Copying...") : $t("Copy Page")}
Expand Down
4 changes: 2 additions & 2 deletions src/components/CopyPageButton/styles.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
}

.buttonText {
svg > path {
fill: var(--color-text-0) !important;
svg {
color: var(--color-text-0) !important;
}
span {
color: var(--color-text-1);
Expand Down
23 changes: 9 additions & 14 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5271,20 +5271,10 @@ caniuse-api@^3.0.0:
lodash.memoize "^4.1.2"
lodash.uniq "^4.5.0"

caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001599, caniuse-lite@^1.0.30001640, caniuse-lite@^1.0.30001688, caniuse-lite@^1.0.30001702:
version "1.0.30001715"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001715.tgz"
integrity sha512-7ptkFGMm2OAOgvZpwgA4yjQ5SQbrNVGdRjzH0pBdy1Fasvcr+KAeECmbCAECzTuDuoX0FCY8KzUxjf9+9kfZEw==

caniuse-lite@^1.0.30001716:
version "1.0.30001718"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001718.tgz#dae13a9c80d517c30c6197515a96131c194d8f82"
integrity sha512-AflseV1ahcSunK53NfEs9gFWgOEmzr0f+kaMFA4xiLZlr9Hzt7HxcSpIFcnNCUkz6R6dWKa54rUz3HUmI3nVcw==

caniuse-lite@^1.0.30001726:
version "1.0.30001727"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001727.tgz#22e9706422ad37aa50556af8c10e40e2d93a8b85"
integrity sha512-pB68nIHmbN6L/4C6MH1DokyR3bYqFwjaSs/sWDHGj4CTcFtQUQMuJftVwWkXq7mNWOybD3KhUv3oWHoGxgP14Q==
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001599, caniuse-lite@^1.0.30001640, caniuse-lite@^1.0.30001688, caniuse-lite@^1.0.30001702, caniuse-lite@^1.0.30001716, caniuse-lite@^1.0.30001726:
version "1.0.30001753"
resolved "https://registry.npmmirror.com/caniuse-lite/-/caniuse-lite-1.0.30001753.tgz"
integrity sha512-Bj5H35MD/ebaOV4iDLqPEtiliTN29qkGtEHCwawWn4cYm+bPJM2NsaP30vtZcnERClMzp52J4+aw2UNbK4o+zw==

ccount@^2.0.0:
version "2.0.1"
Expand Down Expand Up @@ -10722,6 +10712,11 @@ react-fast-compare@^3.2.0, react-fast-compare@^3.2.2:
react-fast-compare "^3.2.0"
shallowequal "^1.1.0"

react-icons@^5.5.0:
version "5.5.0"
resolved "https://registry.npmmirror.com/react-icons/-/react-icons-5.5.0.tgz#8aa25d3543ff84231685d3331164c00299cdfaf2"
integrity sha512-MEFcXdkP3dLo8uumGI5xN3lDFNsRtrjbOEKDLD7yv76v4wpnEq2Lt2qeHaQOr34I/wPN3s3+N08WkQ+CW37Xiw==

react-is@^16.13.1, react-is@^16.6.0, react-is@^16.7.0:
version "16.13.1"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
Expand Down
Loading