mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-27 10:26:35 +03:00
Support Google Sheets embeds in docs (#9861)
This commit is contained in:
parent
800737b416
commit
ba0fa7a64e
|
@ -3,6 +3,7 @@ import PropTypes from 'prop-types'
|
||||||
import classNames from 'classnames'
|
import classNames from 'classnames'
|
||||||
|
|
||||||
import Link from './link'
|
import Link from './link'
|
||||||
|
import Button from './button'
|
||||||
import { InlineCode } from './code'
|
import { InlineCode } from './code'
|
||||||
import { markdownToReact } from './util'
|
import { markdownToReact } from './util'
|
||||||
|
|
||||||
|
@ -104,4 +105,23 @@ const Image = ({ src, alt, title, ...props }) => {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export { YouTube, SoundCloud, Iframe, Image }
|
const GoogleSheet = ({ id, link, height, button = 'View full table' }) => {
|
||||||
|
return (
|
||||||
|
<figure className={classes.root}>
|
||||||
|
<iframe
|
||||||
|
title={id}
|
||||||
|
scrolling="no"
|
||||||
|
className={classes.googleSheet}
|
||||||
|
height={height}
|
||||||
|
src={`https://docs.google.com/spreadsheets/d/e/${id}/pubhtml?widget=true&headers=false`}
|
||||||
|
/>
|
||||||
|
{link && (
|
||||||
|
<Button href={`https://docs.google.com/spreadsheets/d/${link}/view`}>
|
||||||
|
{button}
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
</figure>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export { YouTube, SoundCloud, Iframe, Image, GoogleSheet }
|
||||||
|
|
|
@ -32,3 +32,7 @@
|
||||||
|
|
||||||
.image-link
|
.image-link
|
||||||
display: block
|
display: block
|
||||||
|
|
||||||
|
.google-sheet
|
||||||
|
width: 100%
|
||||||
|
margin-bottom: 1rem
|
||||||
|
|
|
@ -29,7 +29,7 @@ import Aside from '../components/aside'
|
||||||
import Button from '../components/button'
|
import Button from '../components/button'
|
||||||
import Tag from '../components/tag'
|
import Tag from '../components/tag'
|
||||||
import Grid from '../components/grid'
|
import Grid from '../components/grid'
|
||||||
import { YouTube, SoundCloud, Iframe, Image } from '../components/embed'
|
import { YouTube, SoundCloud, Iframe, Image, GoogleSheet } from '../components/embed'
|
||||||
import Alert from '../components/alert'
|
import Alert from '../components/alert'
|
||||||
import Search from '../components/search'
|
import Search from '../components/search'
|
||||||
import Project from '../widgets/project'
|
import Project from '../widgets/project'
|
||||||
|
@ -72,6 +72,7 @@ const scopeComponents = {
|
||||||
YouTube,
|
YouTube,
|
||||||
SoundCloud,
|
SoundCloud,
|
||||||
Iframe,
|
Iframe,
|
||||||
|
GoogleSheet,
|
||||||
Abbr,
|
Abbr,
|
||||||
Tag,
|
Tag,
|
||||||
Accordion,
|
Accordion,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user