diff --git a/docs/.gitignore b/docs/.gitignore index b2d6de30..68475e42 100755 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -1,3 +1,6 @@ +# Project +theme-og + # Dependencies /node_modules diff --git a/docs/docs/introduction.mdx b/docs/docs/introduction.mdx index ab253ecc..c3a94085 100644 --- a/docs/docs/introduction.mdx +++ b/docs/docs/introduction.mdx @@ -7,7 +7,7 @@ description: Welcome to hyperglass import Link from "@docusaurus/Link"; import useBaseUrl from "@docusaurus/useBaseUrl"; -import classnames from "classnames"; +import clsx from "clsx"; import styles from "./styles.module.css"; ## What is hyperglass? @@ -44,7 +44,7 @@ hyperglass was created with the lofty goal of benefiting the internet community - Browser-based DNS-over-HTTPS resolution of FQDN queries ( - - - -); diff --git a/docs/src/components/ColorModeToggle/Sun.js b/docs/src/components/ColorModeToggle/Sun.js deleted file mode 100644 index f2c0231f..00000000 --- a/docs/src/components/ColorModeToggle/Sun.js +++ /dev/null @@ -1,21 +0,0 @@ -import * as React from "react"; - -export const Sun = ({ color, size = "1.5rem", ...props }) => ( - - - -); diff --git a/docs/src/components/ColorModeToggle/index.js b/docs/src/components/ColorModeToggle/index.js deleted file mode 100644 index dd698a89..00000000 --- a/docs/src/components/ColorModeToggle/index.js +++ /dev/null @@ -1,30 +0,0 @@ -import * as React from "react"; -import classnames from "classnames"; -import { Sun } from "./Sun"; -import { Moon } from "./Moon"; -import styles from "./styles.module.css"; - -const iconMap = { true: Moon, false: Sun }; - -export const ColorModeToggle = ({ isDark, toggle, ...props }) => { - const Icon = iconMap[isDark]; - const handleToggle = () => { - if (isDark) { - return toggle(false); - } else { - return toggle(true); - } - }; - const label = `${isDark ? "Hurt" : "Rest"} your eyes`; - return ( - - ); -}; diff --git a/docs/src/components/ColorModeToggle/styles.module.css b/docs/src/components/ColorModeToggle/styles.module.css deleted file mode 100644 index d7a3d90f..00000000 --- a/docs/src/components/ColorModeToggle/styles.module.css +++ /dev/null @@ -1,40 +0,0 @@ -.colorModeToggle { - color: var(--ifm-color-black); - box-sizing: border-box; - background-color: transparent; - border-radius: var(--ifm-button-border-radius); - border: 1px solid transparent; - transition: color var(--ifm-button-transition-duration) - cubic-bezier(0.08, 0.52, 0.52, 1), - background var(--ifm-button-transition-duration) - cubic-bezier(0.08, 0.52, 0.52, 1), - border-color var(--ifm-button-transition-duration) - cubic-bezier(0.08, 0.52, 0.52, 1); - cursor: pointer; - display: inline-flex; - font-size: calc(0.875rem * var(--ifm-button-size-multiplier)); - line-height: 1.5; - outline: 0; - text-align: center; - text-decoration: none; - user-select: none; - vertical-align: middle; - white-space: nowrap; - padding: 6px 12px; - margin-left: 0.5rem; - margin-right: 0.5rem; -} - -.colorModeToggle:hover { - border: 1px solid var(--ifm-color-black); - color: var(--ifm-color-gray-700); -} - -html[data-theme="dark"] .colorModeToggle { - color: var(--ifm-color-white); -} - -html[data-theme="dark"] .colorModeToggle:hover { - border: 1px solid var(--ifm-color-gray-500); - color: var(--ifm-color-gray-500); -} diff --git a/docs/src/components/Font.js b/docs/src/components/Font.js index e1e297ae..510c0bdc 100644 --- a/docs/src/components/Font.js +++ b/docs/src/components/Font.js @@ -1,12 +1,12 @@ import React from "react"; -import classnames from "classnames"; +import clsx from "clsx"; import styles from "./fonts.module.css"; export default ({ name }) => { - const fontClass = { Nunito: "fontBody", "Fira Code": "fontMono" }; - return ( - - {name} - - ); + const fontClass = { Nunito: "fontBody", "Fira Code": "fontMono" }; + return ( + + {name} + + ); }; diff --git a/docs/src/components/GithubButton/index.js b/docs/src/components/GithubButton/index.js deleted file mode 100644 index 120b75dc..00000000 --- a/docs/src/components/GithubButton/index.js +++ /dev/null @@ -1,47 +0,0 @@ -import * as React from "react"; -import classnames from "classnames"; -import useThemeContext from "@theme/hooks/useThemeContext"; - -import styles from "./styles.module.css"; - -const Icon = ({ color, size = "1.5rem", ...props }) => ( - - - -); - -export const GithubButton = ({ href, ...props }) => { - const { isDarkTheme } = useThemeContext(); - return ( - - - - ); -}; diff --git a/docs/src/components/GithubButton/styles.module.css b/docs/src/components/GithubButton/styles.module.css deleted file mode 100644 index f9494d9f..00000000 --- a/docs/src/components/GithubButton/styles.module.css +++ /dev/null @@ -1,46 +0,0 @@ -/* @media screen and (max-width: 997px) { - .githubButton { - display: none !important; - } -} */ - -.githubButton { - color: var(--ifm-color-black); - box-sizing: border-box; - background-color: transparent; - border-radius: var(--ifm-button-border-radius); - border: 1px solid transparent; - transition: color var(--ifm-button-transition-duration) - cubic-bezier(0.08, 0.52, 0.52, 1), - background var(--ifm-button-transition-duration) - cubic-bezier(0.08, 0.52, 0.52, 1), - border-color var(--ifm-button-transition-duration) - cubic-bezier(0.08, 0.52, 0.52, 1); - cursor: pointer; - display: inline-flex; - font-size: calc(0.875rem * var(--ifm-button-size-multiplier)); - line-height: 1.5; - outline: 0; - text-align: center; - text-decoration: none; - user-select: none; - vertical-align: middle; - white-space: nowrap; - padding: 6px 12px; - margin-left: 0.5rem; - margin-right: 0.5rem; -} - -.githubButton:hover { - border: 1px solid var(--ifm-color-black); - color: var(--ifm-color-gray-700); -} - -html[data-theme="dark"] .githubButton { - color: var(--ifm-color-white); -} - -html[data-theme="dark"] .githubButton:hover { - border: 1px solid var(--ifm-color-gray-500); - color: var(--ifm-color-gray-500); -} diff --git a/docs/src/css/custom.css b/docs/src/css/custom.css index e7668680..b55689c4 100755 --- a/docs/src/css/custom.css +++ b/docs/src/css/custom.css @@ -32,6 +32,9 @@ --ifm-font-family-monospace: "Fira Code", SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; --ifm-code-padding-vertical: 0.05rem; + --hgd-footer-link-color: var(--ifm-color-emphasis-700); + --hgd-link-hover-color: var(--ifm-color-secondary-darker); + --ifm-link-color: var(--ifm-color-secondary); } :root { @@ -54,6 +57,12 @@ html[data-theme="dark"]:root { --ifm-navbar-background-color: var(--ifm-background-color); --ifm-menu-color-active: var(--ifm-color-primary); --ifm-blockquote-color: var(--ifm-color-emphasis-400); + --ifm-link-color: var(--ifm-color-primary); + --hgd-footer-link-color: var(--ifm-color-emphasis-400); + --hgd-link-hover-color: var(--ifm-color-primary-darker); + --ifm-code-background: rgba(255, 255, 255, 0.08); + --ifm-code-color: var(--ifm-color-secondary-lightest); + --ifm-footer-link-color: ; } .admonition.alert { @@ -92,11 +101,6 @@ html[data-theme="dark"]:root .admonition.alert.admonition-note { opacity: 0.9; } -html[data-theme="dark"] .footer.footer--dark { - --ifm-footer-color: var(--ifm-color-emphasis-400); - --ifm-navbar-background-color: var(--ifm-background-color); -} - .footer.footer--dark { --ifm-footer-color: var(--ifm-color-emphasis-600); --ifm-footer-link-color: var(--ifm-footer-color); @@ -108,14 +112,8 @@ html[data-theme="dark"] .footer.footer--dark { font-size: 0.8rem; } -html[data-theme="dark"] { - --ifm-code-background: rgba(255, 255, 255, 0.08); - --ifm-code-color: var(--ifm-color-secondary-lightest); - --ifm-footer-link-color: ; - /* #ace8cd - #b6a7e2 - #dc7381 - */ +.footer .footer__items .footer__item .footer__link-item { + color: var(--hgd-footer-link-color); } .admonition { @@ -167,20 +165,13 @@ h6 code { color: var(--ifm-color-primary); } -a { - color: var(--ifm-color-secondary); -} .contents a.contents__link--active[class] { color: var(--ifm-color-secondary); font-weight: bold; } a:hover { - color: var(--ifm-color-secondary-darker); -} - -html[data-theme="dark"] a { - color: var(--ifm-color-primary); + color: var(--hgd-link-hover-color); } html[data-theme="dark"] .contents a.contents__link--active[class] { @@ -188,14 +179,14 @@ html[data-theme="dark"] .contents a.contents__link--active[class] { font-weight: bold; } -html[data-theme="dark"] a:hover { - color: var(--ifm-color-primary-light); -} - html[data-theme="dark"] .navbar .navbar__items a.navbar__brand { color: var(--ifm-color-primary); } +nav.navbar.navbar--fixed-top { + border-bottom: 1px solid var(--ifm-toc-border-color); +} + .navbar .navbar__items a.navbar__brand { color: var(--ifm-color-black); } @@ -211,6 +202,9 @@ html[data-theme="dark"] .navbar .navbar__items a.navbar__brand { width: 100%; display: block; } + .navbar .navbar__inner .navbar__items a.navbar__brand img.logo-at-home { + display: none; + } } .navbar .navbar__search .navbar__search-input { @@ -250,3 +244,41 @@ html[data-theme="dark"] .table-of-contents .table-of-contents__link { color: var(--ifm-font-color-base); } + +.table-of-contents .table-of-contents__link:hover { + color: var(--hgd-link-hover-color); +} + +.footer .footer__col:first-child { + text-align: left; +} + +.footer .footer__col:not(:first-child):not(:last-child) { + text-align: center; +} + +.footer .footer__col:last-child { + text-align: right; +} + +.header-github-link { + transition: opacity 0.2s ease-in-out; +} + +.header-github-link:hover { + opacity: 0.75; +} + +.header-github-link:before { + content: ""; + width: 24px; + height: 24px; + display: flex; + background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E") + no-repeat; +} + +html[data-theme="dark"] .header-github-link:before { + background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='white' d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E") + no-repeat; +} diff --git a/docs/src/hooks/index.ts b/docs/src/hooks/index.ts new file mode 100644 index 00000000..f07999ed --- /dev/null +++ b/docs/src/hooks/index.ts @@ -0,0 +1 @@ +export * from "./useLogoSrc"; diff --git a/docs/src/hooks/useLogoSrc.ts b/docs/src/hooks/useLogoSrc.ts new file mode 100644 index 00000000..c83612ea --- /dev/null +++ b/docs/src/hooks/useLogoSrc.ts @@ -0,0 +1,38 @@ +import { useMemo } from "react"; +import useBaseUrl from "@docusaurus/useBaseUrl"; +import { useLocation } from "@docusaurus/router"; +import useMedia from "use-media"; + +type UseLogoSrc = { + sources: { light: string; dark: string }; + className: string | null; +}; + +export function useLogoSrc(): UseLogoSrc { + let className = null; + const { pathname } = useLocation(); + const isSmall = useMedia({ maxWidth: "997px" }); + if (pathname === "/") { + className = "logo-at-home"; + } + const sourcesIcon = { + light: useBaseUrl("/static/hyperglass-icon-light.svg"), + dark: useBaseUrl("/static/hyperglass-icon-dark.svg"), + }; + + const sourcesFull = { + light: useBaseUrl("/static/hyperglass-light.svg"), + dark: useBaseUrl("/static/hyperglass-dark.svg"), + }; + + const sources = useMemo(() => { + if (isSmall) { + return sourcesFull; + } + if (!isSmall && pathname === "/") { + return sourcesIcon; + } + return sourcesFull; + }, [isSmall, pathname]); + return { sources, className }; +} diff --git a/docs/src/pages/index.js b/docs/src/pages/index.js index 19536211..17100214 100644 --- a/docs/src/pages/index.js +++ b/docs/src/pages/index.js @@ -1,5 +1,5 @@ import React from "react"; -import classnames from "classnames"; +import clsx from "clsx"; import Layout from "@theme/Layout"; import Link from "@docusaurus/Link"; import useBaseUrl from "@docusaurus/useBaseUrl"; @@ -27,12 +27,10 @@ function Home() { "reactjs", ]} > -
+
-

- hyperglass -

-

+

hyperglass

+

the network looking glass{" "} that tries to @@ -43,7 +41,7 @@ function Home() {

-
+
-
+
-
+
diff --git a/docs/src/pages/screenshots.js b/docs/src/pages/screenshots.js index 1730a977..272cf302 100644 --- a/docs/src/pages/screenshots.js +++ b/docs/src/pages/screenshots.js @@ -1,5 +1,5 @@ import * as React from "react"; -import classnames from "classnames"; +import clsx from "clsx"; import Layout from "@theme/Layout"; import Link from "@docusaurus/Link"; import useBaseUrl from "@docusaurus/useBaseUrl"; @@ -11,13 +11,11 @@ function Screenshots() { description="hyperglass screenshots" keywords={["hyperglass", "screenshots"]} > -
-
-

- Coming Soon! -

+
+
+

Coming Soon!

-
+
-
+
-
+
diff --git a/docs/src/theme/CodeBlock/dracula.js b/docs/src/prism-dracula.js similarity index 98% rename from docs/src/theme/CodeBlock/dracula.js rename to docs/src/prism-dracula.js index 0a3dc3a6..98310cec 100644 --- a/docs/src/theme/CodeBlock/dracula.js +++ b/docs/src/prism-dracula.js @@ -1,6 +1,6 @@ // @flow -export default { +module.exports = { plain: { color: "rgb(241, 250, 140)", backgroundColor: "#282A36", diff --git a/docs/src/theme/CodeBlock/github.js b/docs/src/theme/CodeBlock/github.js deleted file mode 100644 index acd0352f..00000000 --- a/docs/src/theme/CodeBlock/github.js +++ /dev/null @@ -1,84 +0,0 @@ -// Original: https://raw.githubusercontent.com/PrismJS/prism-themes/master/themes/prism-ghcolors.css -var theme = { - plain: { - color: "#393A34", - backgroundColor: "#f6f8fa", - }, - styles: [ - { - types: ["comment", "prolog", "doctype", "cdata"], - style: { - color: "#999988", - fontStyle: "italic", - }, - }, - { - types: ["namespace"], - style: { - opacity: 0.7, - }, - }, - { - types: ["string", "attr-value"], - style: { - color: "#e3116c", - }, - }, - { - types: ["punctuation", "operator"], - style: { - color: "#393A34", - }, - }, - { - types: [ - "entity", - "url", - "symbol", - "number", - "boolean", - "variable", - "constant", - "property", - "regex", - "inserted", - ], - style: { - color: "#36acaa", - }, - }, - { - types: ["atrule", "keyword", "attr-name", "selector"], - style: { - color: "#00a4db", - }, - }, - { - types: ["function", "deleted", "tag"], - style: { - color: "#d73a49", - }, - }, - { - types: ["function-variable"], - style: { - color: "#6f42c1", - }, - }, - { - types: ["tag", "selector", "keyword"], - style: { - color: "#00009f", - }, - }, - { - types: ["important"], - style: { - color: "#d73a49", - fontStyle: "italic", - }, - }, - ], -}; - -export default theme; diff --git a/docs/src/theme/CodeBlock/index.js b/docs/src/theme/CodeBlock/index.js deleted file mode 100644 index 5fa8764b..00000000 --- a/docs/src/theme/CodeBlock/index.js +++ /dev/null @@ -1,277 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -/* eslint-disable jsx-a11y/no-noninteractive-tabindex */ - -import React, { useEffect, useState, useRef } from "react"; -import classnames from "classnames"; -import Highlight, { defaultProps } from "prism-react-renderer"; -import Prism from "prism-react-renderer/prism"; -import darkTheme from "./dracula"; -import lightTheme from "./github"; -import Clipboard from "clipboard"; -import rangeParser from "parse-numeric-range"; -import useDocusaurusContext from "@docusaurus/useDocusaurusContext"; -import useThemeContext from "@theme/hooks/useThemeContext"; - -import styles from "./styles.module.css"; - -const highlightLinesRangeRegex = /{([\d,-]+)}/; -const getHighlightDirectiveRegex = ( - languages = ["js", "jsBlock", "jsx", "python", "html", "ini"] -) => { - // supported types of comments - const comments = { - js: { - start: "\\/\\/", - end: "", - }, - jsBlock: { - start: "\\/\\*", - end: "\\*\\/", - }, - jsx: { - start: "\\{\\s*\\/\\*", - end: "\\*\\/\\s*\\}", - }, - python: { - start: "#", - end: "", - }, - html: { - start: "", - }, - ini: { start: "#", end: "" }, - }; - // supported directives - const directives = [ - "highlight-next-line", - "highlight-start", - "highlight-end", - ].join("|"); - // to be more reliable, the opening and closing comment must match - const commentPattern = languages - .map( - (lang) => - `(?:${comments[lang].start}\\s*(${directives})\\s*${comments[lang].end})` - ) - .join("|"); - // white space is allowed, but otherwise it should be on it's own line - return new RegExp(`^\\s*(?:${commentPattern})\\s*$`); -}; -// select comment styles based on language -const highlightDirectiveRegex = (lang) => { - switch (lang) { - case "js": - case "javascript": - case "ts": - case "typescript": - return getHighlightDirectiveRegex(["js", "jsBlock"]); - - case "jsx": - case "tsx": - return getHighlightDirectiveRegex(["js", "jsBlock", "jsx"]); - - case "html": - return getHighlightDirectiveRegex(["js", "jsBlock", "html"]); - - case "python": - case "py": - return getHighlightDirectiveRegex(["python"]); - case "ini": - return getHighlightDirectiveRegex(["ini"]); - - default: - // all comment types - return getHighlightDirectiveRegex(); - } -}; -const codeBlockTitleRegex = /title=".*"/; - -export default ({ children, className: languageClassName, metastring }) => { - (typeof global !== "undefined" ? global : window).Prism = Prism; - require("prismjs/components/prism-shell-session"); - require("prismjs/components/prism-nginx"); - require("prismjs/components/prism-ini"); - const { - siteConfig: { - themeConfig: { prism = {} }, - }, - } = useDocusaurusContext(); - - const [showCopied, setShowCopied] = useState(false); - const [mounted, setMounted] = useState(false); - // The Prism theme on SSR is always the default theme but the site theme - // can be in a different mode. React hydration doesn't update DOM styles - // that come from SSR. Hence force a re-render after mounting to apply the - // current relevant styles. There will be a flash seen of the original - // styles seen using this current approach but that's probably ok. Fixing - // the flash will require changing the theming approach and is not worth it - // at this point. - useEffect(() => { - setMounted(true); - }, []); - - const target = useRef(null); - const button = useRef(null); - let highlightLines = []; - let codeBlockTitle = ""; - - const { isDarkTheme } = useThemeContext(); - const lightModeTheme = prism.theme || lightTheme || darkTheme; - const darkModeTheme = prism.darkTheme || darkTheme || lightTheme; - const prismTheme = isDarkTheme ? darkModeTheme : lightModeTheme; - - if (metastring && highlightLinesRangeRegex.test(metastring)) { - const highlightLinesRange = metastring.match(highlightLinesRangeRegex)[1]; - highlightLines = rangeParser - .parse(highlightLinesRange) - .filter((n) => n > 0); - } - - if (metastring && codeBlockTitleRegex.test(metastring)) { - codeBlockTitle = metastring - .match(codeBlockTitleRegex)[0] - .split("title=")[1] - .replace(/"+/g, ""); - } - - useEffect(() => { - let clipboard; - - if (button.current) { - clipboard = new Clipboard(button.current, { - target: () => target.current, - }); - } - - return () => { - if (clipboard) { - clipboard.destroy(); - } - }; - }, [button.current, target.current]); - - let language = - languageClassName && languageClassName.replace(/language-/, ""); - - if (!language && prism.defaultLanguage) { - language = prism.defaultLanguage; - } - - // only declaration OR directive highlight can be used for a block - let code = children.replace(/\n$/, ""); - if (highlightLines.length === 0 && language !== undefined) { - let range = ""; - const directiveRegex = highlightDirectiveRegex(language); - // go through line by line - const lines = children.replace(/\n$/, "").split("\n"); - let blockStart; - // loop through lines - for (let index = 0; index < lines.length; ) { - const line = lines[index]; - // adjust for 0-index - const lineNumber = index + 1; - const match = line.match(directiveRegex); - if (match !== null) { - const directive = match - .slice(1) - .reduce((final, item) => final || item, undefined); - switch (directive) { - case "highlight-next-line": - range += `${lineNumber},`; - break; - - case "highlight-start": - blockStart = lineNumber; - break; - - case "highlight-end": - range += `${blockStart}-${lineNumber - 1},`; - break; - - default: - break; - } - lines.splice(index, 1); - } else { - // lines without directives are unchanged - index += 1; - } - } - highlightLines = rangeParser.parse(range); - code = lines.join("\n"); - } - - const handleCopyCode = () => { - window.getSelection().empty(); - setShowCopied(true); - - setTimeout(() => setShowCopied(false), 2000); - }; - - return ( - - {({ className, style, tokens, getLineProps, getTokenProps }) => ( - <> - {codeBlockTitle && ( -
- {codeBlockTitle} -
- )} -
- {/* */} -
-
- {tokens.map((line, i) => { - if (line.length === 1 && line[0].content === "") { - line[0].content = "\n"; // eslint-disable-line no-param-reassign - } - - const lineProps = getLineProps({ line, key: i }); - - if (highlightLines.includes(i + 1)) { - lineProps.className = `${lineProps.className} docusaurus-highlight-code-line`; - } - - return ( -
- {line.map((token, key) => ( - - ))} -
- ); - })} -
-
-
- - )} -
- ); -}; diff --git a/docs/src/theme/CodeBlock/styles.module.css b/docs/src/theme/CodeBlock/styles.module.css deleted file mode 100644 index dda5cafd..00000000 --- a/docs/src/theme/CodeBlock/styles.module.css +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -.codeBlockContent { - position: relative; -} - -.codeBlockTitle { - font-family: var(--ifm-font-family-monospace); - font-weight: bold; - padding: var(--ifm-pre-padding); - border-bottom: 1px solid var(--ifm-color-emphasis-200); - width: 100%; - border-top-left-radius: var(--ifm-global-radius); - border-top-right-radius: var(--ifm-global-radius); -} - -.codeBlock { - overflow: auto; - border-radius: var(--ifm-global-radius); -} - -.codeBlockWithTitle { - border-top-left-radius: 0; - border-top-right-radius: 0; - border-bottom-left-radius: var(--ifm-global-radius); - border-bottom-right-radius: var(--ifm-global-radius); -} - -.copyButton { - background: rgba(0, 0, 0, 0.3); - border: none; - border-radius: var(--ifm-global-radius); - color: var(--ifm-color-content); - cursor: pointer; - line-height: 12px; - opacity: 0; - outline: none; - padding: 4px 8px; - position: absolute; - right: var(--ifm-pre-padding); - top: var(--ifm-pre-padding); - visibility: hidden; - transition: opacity 200ms ease-in-out, visibility 200ms ease-in-out, - bottom 200ms ease-in-out; -} - -.copyButtonWithTitle { - top: calc(var(--ifm-pre-padding)); -} - -.codeBlockTitle:hover + .codeBlockContent .copyButton, -.codeBlockContent:hover > .copyButton { - visibility: visible; - opacity: 1; -} - -.codeBlockLines { - font-family: var(--ifm-font-family-monospace); - font-size: inherit; - line-height: var(--ifm-pre-line-height); - white-space: pre; - float: left; - min-width: 100%; - padding: var(--ifm-pre-padding); -} diff --git a/docs/src/theme/Footer/index.js b/docs/src/theme/Footer/index.js deleted file mode 100644 index 0113f603..00000000 --- a/docs/src/theme/Footer/index.js +++ /dev/null @@ -1,122 +0,0 @@ -/** - * Copyright (c) 2017-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -import React from "react"; -import classnames from "classnames"; - -import Link from "@docusaurus/Link"; -import useDocusaurusContext from "@docusaurus/useDocusaurusContext"; -import useBaseUrl from "@docusaurus/useBaseUrl"; -import styles from "./styles.module.css"; - -function FooterLink({ to, href, label, ...props }) { - const toUrl = useBaseUrl(to); - return ( - - {label} - - ); -} - -const FooterLogo = ({ url, alt }) => ( - {alt} -); - -function Footer() { - const context = useDocusaurusContext(); - const { siteConfig = {} } = context; - const { themeConfig = {} } = siteConfig; - const { footer } = themeConfig; - - const { copyright, links = [], logo = {} } = footer || {}; - const logoUrl = useBaseUrl(logo.src); - - if (!footer) { - return null; - } - - return ( -
-
- {links && links.length > 0 && ( -
- {links.map((linkItem, i) => ( -
- {linkItem.title != null ? ( -

{linkItem.title}

- ) : null} - {linkItem.items != null && - Array.isArray(linkItem.items) && - linkItem.items.length > 0 ? ( -
    - {linkItem.items.map((item, key) => - item.html ? ( -
  • - ) : ( -
  • - -
  • - ) - )} -
- ) : null} -
- ))} -
- )} - {(logo || copyright) && ( -
- {logo && logo.src && ( -
- {logo.href ? ( - - - - ) : ( - - )} -
- )} - {copyright} -
- )} -
-
- ); -} - -export default Footer; diff --git a/docs/src/theme/Footer/styles.module.css b/docs/src/theme/Footer/styles.module.css deleted file mode 100644 index f56e41fb..00000000 --- a/docs/src/theme/Footer/styles.module.css +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright (c) 2017-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -.footerLogoLink { - opacity: 0.5; - transition: opacity 0.15s ease-in-out; -} - -.footerLogoLink:hover { - opacity: 1; -} - -.footerCol:first-child { - text-align: left; -} - -.footerCol:not(:first-child):not(:last-child) { - text-align: center; -} - -.footerCol:last-child { - text-align: right; -} - -html[data-theme="dark"] .footerLink[class] { - color: var(--ifm-color-emphasis-400); -} - -.footerLink[class] { - color: var(--ifm-color-emphasis-700); -} diff --git a/docs/src/theme/Layout/index.js b/docs/src/theme/Layout/index.js deleted file mode 100644 index 20217ae0..00000000 --- a/docs/src/theme/Layout/index.js +++ /dev/null @@ -1,83 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -import React from "react"; -import Head from "@docusaurus/Head"; -import useDocusaurusContext from "@docusaurus/useDocusaurusContext"; -import useBaseUrl from "@docusaurus/useBaseUrl"; - -import ThemeProvider from "@theme/ThemeProvider"; -import UserPreferencesProvider from "@theme/UserPreferencesProvider"; -import AnnouncementBar from "@theme/AnnouncementBar"; -import Navbar from "../Navbar"; -import Footer from "../Footer"; - -import "./styles.css"; - -function Layout(props) { - const { siteConfig = {} } = useDocusaurusContext(); - const { - favicon, - title: siteTitle, - themeConfig: { image: defaultImage }, - url: siteUrl, - } = siteConfig; - const { - children, - title, - noFooter, - description, - image, - keywords, - permalink, - version, - } = props; - const metaTitle = title ? `${title} | ${siteTitle}` : siteTitle; - const metaImage = image || defaultImage; - const metaImageUrl = useBaseUrl(metaImage, { absolute: true }); - const faviconUrl = useBaseUrl(favicon); - return ( - - - - - {metaTitle && {metaTitle}} - {metaTitle && } - {favicon && } - {description && } - {description && ( - - )} - {version && } - {keywords && keywords.length && ( - - )} - {metaImage && } - {metaImage && } - {metaImage && } - {metaImage && ( - - )} - {metaImage && ( - - )} - {permalink && ( - - )} - {permalink && } - - - - -
{children}
- {!noFooter &&