[1/2] Move docs to brivate (#1640)
This PR moves the docs site to the private repo while keeping the docs content on the public repo. ### Change Type - [x] `documentation`
This commit is contained in:
parent
245f74010c
commit
096df3209b
638 changed files with 64004 additions and 2983 deletions
|
@ -1,27 +0,0 @@
|
|||
import { Article } from '@/types/content-types'
|
||||
import { Icon } from './Icon'
|
||||
|
||||
type ArticleDetailsProps = {
|
||||
article: Article
|
||||
}
|
||||
|
||||
export function ArticleDetails({ article: { sourceUrl, date } }: ArticleDetailsProps) {
|
||||
return (
|
||||
<div className="article__details">
|
||||
<a className="article__details__edit" href={sourceUrl}>
|
||||
<Icon icon="edit" />
|
||||
<span>Edit this page</span>
|
||||
</a>
|
||||
{date && (
|
||||
<div className="article__details__timestamp">
|
||||
Last edited on{' '}
|
||||
{Intl.DateTimeFormat('en-gb', {
|
||||
year: 'numeric',
|
||||
month: 'long',
|
||||
day: 'numeric',
|
||||
}).format(new Date(date))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
import { ArticleLinks } from '@/types/content-types'
|
||||
import Link from 'next/link'
|
||||
import { Icon } from './Icon'
|
||||
|
||||
type ArticleNavLinksProps = {
|
||||
links: ArticleLinks
|
||||
}
|
||||
|
||||
export function ArticleNavLinks({ links: { prev, next } }: ArticleNavLinksProps) {
|
||||
return (
|
||||
<div className="article__links">
|
||||
{prev && (
|
||||
<Link
|
||||
href={`/${prev.sectionId}/${prev.categoryId}/${prev.id}`}
|
||||
className="article__links__link article__links__prev"
|
||||
>
|
||||
<Icon icon="arrow-left" />
|
||||
<span>{prev.title}</span>
|
||||
</Link>
|
||||
)}
|
||||
{next && (
|
||||
<Link
|
||||
href={`/${next.sectionId}/${next.categoryId}/${next.id}`}
|
||||
className="article__links__link article__links__next"
|
||||
>
|
||||
<span>{next.title}</span>
|
||||
<Icon icon="arrow-right" />
|
||||
</Link>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
export function Icon({ icon, className }: { icon: string; className?: string }) {
|
||||
return (
|
||||
<span
|
||||
className={`icon ${className ?? ''}`}
|
||||
style={{
|
||||
mask: `url(/icons/${icon}.svg) center 100% / 100% no-repeat`,
|
||||
WebkitMask: `url(/icons/${icon}.svg) center 100% / 100% no-repeat`,
|
||||
}}
|
||||
/>
|
||||
)
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
import { MDXRemote, MDXRemoteSerializeResult } from 'next-mdx-remote'
|
||||
import { components, scope } from './mdx-components'
|
||||
|
||||
interface MdxProps {
|
||||
mdxSource: MDXRemoteSerializeResult
|
||||
}
|
||||
|
||||
export function Mdx({ mdxSource }: MdxProps) {
|
||||
return <MDXRemote {...mdxSource} scope={scope} components={components as any} />
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
import Head from 'next/head'
|
||||
|
||||
interface MetaHeadProps {
|
||||
title: string
|
||||
description?: string | null
|
||||
hero?: string | null
|
||||
}
|
||||
|
||||
export function MetaHead({ title, description, hero }: MetaHeadProps) {
|
||||
const TITLE = `${title} - tldraw docs`
|
||||
|
||||
return (
|
||||
<Head>
|
||||
<title>{TITLE}</title>
|
||||
{description && <meta name="description" content={description} />}
|
||||
|
||||
<meta name="twitter:title" content={title} />
|
||||
{description && <meta name="twitter:description" content={description} />}
|
||||
{hero && <meta name="twitter:image" content={hero} />}
|
||||
|
||||
<meta property="og:title" content={TITLE} key="title" />
|
||||
{description && <meta property="og:description" content={description} />}
|
||||
{hero && <meta property="og:image" content={hero} />}
|
||||
</Head>
|
||||
)
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
import { useTheme } from 'next-themes'
|
||||
import { Icon } from './Icon'
|
||||
|
||||
export function ThemeSwitcher() {
|
||||
const { theme, setTheme } = useTheme()
|
||||
|
||||
return (
|
||||
<button
|
||||
className="sidebar__button icon-button"
|
||||
onClick={() => setTheme(theme === 'light' ? 'dark' : 'light')}
|
||||
>
|
||||
<Icon icon="light" />
|
||||
</button>
|
||||
)
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
export {}
|
|
@ -1,27 +0,0 @@
|
|||
import { ReactNode } from 'react'
|
||||
|
||||
export function ParametersTable({ children }: { children: ReactNode }) {
|
||||
return (
|
||||
<table className="parametersTable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>{children}</tbody>
|
||||
</table>
|
||||
)
|
||||
}
|
||||
|
||||
export function ParametersTableRow({ children }: { children: ReactNode }) {
|
||||
return <tr className="parametersTable-row">{children}</tr>
|
||||
}
|
||||
|
||||
export function ParametersTableName({ children }: { children: ReactNode }) {
|
||||
return <td className="parametersTable-name">{children}</td>
|
||||
}
|
||||
|
||||
export function ParametersTableDescription({ children }: { children: ReactNode }) {
|
||||
return <td className="parametersTable-description">{children}</td>
|
||||
}
|
|
@ -1,132 +0,0 @@
|
|||
/* ---------------------- Lists --------------------- */
|
||||
|
||||
import React from 'react'
|
||||
|
||||
export const UnorderedList = (props: any) => {
|
||||
return <ul {...props} />
|
||||
}
|
||||
|
||||
export const OrderedList = (props: any) => {
|
||||
return <ol {...props} />
|
||||
}
|
||||
|
||||
export const ListItem = (props: any) => {
|
||||
return <li {...props} />
|
||||
}
|
||||
|
||||
/* ------------------- Typography ------------------- */
|
||||
|
||||
type Heading = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'
|
||||
|
||||
function heading(heading: Heading, props: any) {
|
||||
const Element = ({ ...props }) => React.createElement(heading, props)
|
||||
if (props.id) {
|
||||
return (
|
||||
<Element {...props}>
|
||||
<a href={`#${props.id}`}>{props.children}</a>
|
||||
</Element>
|
||||
)
|
||||
}
|
||||
|
||||
return <Element {...props} />
|
||||
}
|
||||
|
||||
export const Heading1 = (props: any) => {
|
||||
return heading('h1', props)
|
||||
}
|
||||
|
||||
export const Heading2 = (props: any) => {
|
||||
return heading('h2', props)
|
||||
}
|
||||
|
||||
export const Heading3 = (props: any) => {
|
||||
return heading('h3', props)
|
||||
}
|
||||
|
||||
export const Heading4 = (props: any) => {
|
||||
return heading('h4', props)
|
||||
}
|
||||
|
||||
export const Heading5 = (props: any) => {
|
||||
return heading('h5', props)
|
||||
}
|
||||
|
||||
export const Heading6 = (props: any) => {
|
||||
return heading('h6', props)
|
||||
}
|
||||
|
||||
export const Paragraph = (props: any) => {
|
||||
return <p {...props} />
|
||||
}
|
||||
|
||||
export const A = (props: any) => {
|
||||
return <a {...props} />
|
||||
}
|
||||
|
||||
export const Divider = (props: any) => {
|
||||
return <hr {...props} />
|
||||
}
|
||||
|
||||
export const Blockquote = (props: any) => {
|
||||
return <blockquote {...props} />
|
||||
}
|
||||
|
||||
export const Small = (props: any) => {
|
||||
return (
|
||||
<p className="article__small">
|
||||
<small {...props} />
|
||||
</p>
|
||||
)
|
||||
}
|
||||
|
||||
/* --------------------- Tables --------------------- */
|
||||
|
||||
export const Table = (props: any) => {
|
||||
return <table {...props} />
|
||||
}
|
||||
|
||||
export const THead = (props: any) => {
|
||||
return <thead {...props} />
|
||||
}
|
||||
|
||||
export const TR = (props: any) => {
|
||||
return <tr {...props} />
|
||||
}
|
||||
|
||||
export const TD = (props: any) => {
|
||||
return <td {...props} />
|
||||
}
|
||||
|
||||
/* --------------------- Media --------------------- */
|
||||
|
||||
export const Image = (props: any) => {
|
||||
return (
|
||||
<span className="artcle__image">
|
||||
<img alt={props.title} {...props} />
|
||||
{props.caption && <span className="article__caption">{props.caption}</span>}
|
||||
</span>
|
||||
)
|
||||
}
|
||||
|
||||
export const Video = (props: any) => {
|
||||
return (
|
||||
<span className="artcle__video">
|
||||
<video alt={props.title} {...props} />
|
||||
{props.caption && <span className="article__caption">{props.caption}</span>}
|
||||
</span>
|
||||
)
|
||||
}
|
||||
|
||||
/* ------------------- Code Blocks ------------------ */
|
||||
|
||||
export const Pre = (props: any) => {
|
||||
return <pre {...props} />
|
||||
}
|
||||
|
||||
export const Code = (props: any) => {
|
||||
return <code {...props} />
|
||||
}
|
||||
|
||||
export const Footnotes = (props: any) => {
|
||||
return <div {...props} />
|
||||
}
|
|
@ -1,53 +0,0 @@
|
|||
import * as customComponents from '../article-components'
|
||||
import * as apiComponents from './api-docs'
|
||||
import {
|
||||
A,
|
||||
Blockquote,
|
||||
Divider,
|
||||
Heading1,
|
||||
Heading2,
|
||||
Heading3,
|
||||
Heading4,
|
||||
Heading5,
|
||||
Heading6,
|
||||
Image,
|
||||
ListItem,
|
||||
OrderedList,
|
||||
Paragraph,
|
||||
Small,
|
||||
Table,
|
||||
TD,
|
||||
THead,
|
||||
TR,
|
||||
UnorderedList,
|
||||
Video,
|
||||
} from './generic'
|
||||
|
||||
export const scope = {}
|
||||
|
||||
export const components = {
|
||||
h1: Heading1,
|
||||
h2: Heading2,
|
||||
h3: Heading3,
|
||||
h4: Heading4,
|
||||
h5: Heading5,
|
||||
h6: Heading6,
|
||||
blockquote: Blockquote,
|
||||
hr: Divider,
|
||||
a: A,
|
||||
p: Paragraph,
|
||||
table: Table,
|
||||
thead: THead,
|
||||
tr: TR,
|
||||
td: TD,
|
||||
video: Video,
|
||||
ol: OrderedList,
|
||||
ul: UnorderedList,
|
||||
li: ListItem,
|
||||
img: Image,
|
||||
Small: Small,
|
||||
Image,
|
||||
Video,
|
||||
...customComponents,
|
||||
...apiComponents,
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue