mirror of
https://github.com/oceanprotocol/docs.git
synced 2024-11-26 19:49:26 +01:00
unify quickstart code example syntax highlighting
This commit is contained in:
parent
2fb17b3459
commit
f4c142d49e
6
data/quickrun.md
Normal file
6
data/quickrun.md
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
```bash
|
||||||
|
git clone https://github.com/oceanprotocol/barge.git
|
||||||
|
cd barge/
|
||||||
|
|
||||||
|
./start_ocean.sh
|
||||||
|
```
|
46
src/components/QuickRun.jsx
Normal file
46
src/components/QuickRun.jsx
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import { Link, StaticQuery, graphql } from 'gatsby'
|
||||||
|
import Repository from './Repositories/Repository'
|
||||||
|
import styles from './QuickRun.module.scss'
|
||||||
|
|
||||||
|
const QuickRun = () => (
|
||||||
|
<StaticQuery
|
||||||
|
query={graphql`
|
||||||
|
query {
|
||||||
|
allMarkdownRemark(
|
||||||
|
filter: { fields: { slug: { eq: "/quickrun/" } } }
|
||||||
|
) {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
html
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`}
|
||||||
|
render={data => (
|
||||||
|
<aside className={styles.quickrun}>
|
||||||
|
<header className={styles.header}>
|
||||||
|
<h1 className={styles.tldr}>TL;DR</h1>
|
||||||
|
<strong>
|
||||||
|
Wanna quickly get an Ocean network with all{' '}
|
||||||
|
<Link to="/concepts/components/">core components</Link>{' '}
|
||||||
|
running on your machine?
|
||||||
|
</strong>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<div className={styles.docker}>
|
||||||
|
<div
|
||||||
|
dangerouslySetInnerHTML={{
|
||||||
|
__html: data.allMarkdownRemark.edges[0].node.html
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Repository name={'barge'} />
|
||||||
|
</div>
|
||||||
|
</aside>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
|
||||||
|
export default QuickRun
|
@ -1,11 +1,11 @@
|
|||||||
@import 'variables';
|
@import 'variables';
|
||||||
|
|
||||||
.quickrun {
|
.quickrun {
|
||||||
padding-top: $spacer;
|
padding-top: $spacer * 4;
|
||||||
padding-bottom: $spacer * 2.5;
|
padding-bottom: $spacer * 2.5;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
pre {
|
> div {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
margin-top: $spacer / $line-height;
|
margin-top: $spacer / $line-height;
|
||||||
}
|
}
|
||||||
@ -29,19 +29,19 @@
|
|||||||
max-width: none;
|
max-width: none;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
> pre,
|
> div,
|
||||||
> article {
|
> article {
|
||||||
flex: 0 0 48%;
|
flex: 0 0 48%;
|
||||||
margin: 0 !important; // stylelint-disable-line
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
pre {
|
pre {
|
||||||
display: flex;
|
margin: 0;
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
> code {
|
code {
|
||||||
padding: $spacer / $line-height;
|
padding: $spacer / 1.1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -50,6 +50,9 @@
|
|||||||
.tldr {
|
.tldr {
|
||||||
display: block;
|
display: block;
|
||||||
margin-bottom: $spacer / 2;
|
margin-bottom: $spacer / 2;
|
||||||
color: $brand-grey-light;
|
|
||||||
font-size: $font-size-h4;
|
font-size: $font-size-h4;
|
||||||
|
|
||||||
|
+ strong {
|
||||||
|
color: $brand-grey-light;
|
||||||
|
}
|
||||||
}
|
}
|
@ -1,40 +0,0 @@
|
|||||||
import React from 'react'
|
|
||||||
import PropTypes from 'prop-types'
|
|
||||||
import { Link } from 'gatsby'
|
|
||||||
import Repository from './Repository'
|
|
||||||
import styles from './QuickRun.module.scss'
|
|
||||||
|
|
||||||
const QuickRun = ({ name }) => (
|
|
||||||
<aside className={styles.quickrun}>
|
|
||||||
<header className={styles.header}>
|
|
||||||
<h1 className={styles.tldr}>TL;DR</h1>
|
|
||||||
<strong>
|
|
||||||
Wanna quickly get an Ocean network with all{' '}
|
|
||||||
<Link to="/concepts/components/">core components</Link> running
|
|
||||||
on your machine?
|
|
||||||
</strong>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<div className={styles.docker}>
|
|
||||||
<pre className="language-bash">
|
|
||||||
<code className="language-bash">
|
|
||||||
<span className="token function">git</span> clone
|
|
||||||
https://github.com/oceanprotocol/barge.git
|
|
||||||
<br />
|
|
||||||
<span className="token function">cd</span> barge/
|
|
||||||
<br />
|
|
||||||
<br />
|
|
||||||
./start_ocean.sh
|
|
||||||
</code>
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
<Repository name={name} />
|
|
||||||
</div>
|
|
||||||
</aside>
|
|
||||||
)
|
|
||||||
|
|
||||||
QuickRun.propTypes = {
|
|
||||||
name: PropTypes.string.isRequired
|
|
||||||
}
|
|
||||||
|
|
||||||
export default QuickRun
|
|
@ -1,7 +1,6 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { Link, StaticQuery, graphql } from 'gatsby'
|
import { Link, StaticQuery, graphql } from 'gatsby'
|
||||||
import RepositoryList from './RepositoryList'
|
import RepositoryList from './RepositoryList'
|
||||||
import QuickRun from './QuickRun'
|
|
||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
|
|
||||||
const query = graphql`
|
const query = graphql`
|
||||||
@ -32,8 +31,6 @@ const Repositories = () => (
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.repositories}>
|
<div className={styles.repositories}>
|
||||||
<QuickRun name="barge" />
|
|
||||||
|
|
||||||
<header>
|
<header>
|
||||||
<h1 className={styles.repositoriesTitle}>
|
<h1 className={styles.repositoriesTitle}>
|
||||||
Repositories
|
Repositories
|
||||||
|
@ -7,6 +7,7 @@ import Layout from '../components/Layout'
|
|||||||
import Content from '../components/Content'
|
import Content from '../components/Content'
|
||||||
import HeaderHome from '../components/HeaderHome'
|
import HeaderHome from '../components/HeaderHome'
|
||||||
import Repositories from '../components/Repositories'
|
import Repositories from '../components/Repositories'
|
||||||
|
import QuickRun from '../components/QuickRun'
|
||||||
import { ReactComponent as Arrow } from '../images/arrow.svg'
|
import { ReactComponent as Arrow } from '../images/arrow.svg'
|
||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
|
|
||||||
@ -73,6 +74,8 @@ const IndexPage = ({ data, location }) => (
|
|||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
<QuickRun />
|
||||||
|
|
||||||
<Repositories />
|
<Repositories />
|
||||||
</Content>
|
</Content>
|
||||||
</Layout>
|
</Layout>
|
||||||
|
@ -44,6 +44,7 @@ pre {
|
|||||||
overflow: auto;
|
overflow: auto;
|
||||||
-webkit-overflow-scrolling: touch;
|
-webkit-overflow-scrolling: touch;
|
||||||
max-height: 800px;
|
max-height: 800px;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
code {
|
code {
|
||||||
background: none;
|
background: none;
|
||||||
|
Loading…
Reference in New Issue
Block a user