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';
|
||||
|
||||
.quickrun {
|
||||
padding-top: $spacer;
|
||||
padding-top: $spacer * 4;
|
||||
padding-bottom: $spacer * 2.5;
|
||||
text-align: center;
|
||||
|
||||
pre {
|
||||
> div {
|
||||
text-align: left;
|
||||
margin-top: $spacer / $line-height;
|
||||
}
|
||||
@ -29,19 +29,19 @@
|
||||
max-width: none;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
> pre,
|
||||
> div,
|
||||
> article {
|
||||
flex: 0 0 48%;
|
||||
margin: 0 !important; // stylelint-disable-line
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
pre {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: 0;
|
||||
|
||||
> code {
|
||||
padding: $spacer / $line-height;
|
||||
code {
|
||||
padding: $spacer / 1.1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -50,6 +50,9 @@
|
||||
.tldr {
|
||||
display: block;
|
||||
margin-bottom: $spacer / 2;
|
||||
color: $brand-grey-light;
|
||||
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 { Link, StaticQuery, graphql } from 'gatsby'
|
||||
import RepositoryList from './RepositoryList'
|
||||
import QuickRun from './QuickRun'
|
||||
import styles from './index.module.scss'
|
||||
|
||||
const query = graphql`
|
||||
@ -32,8 +31,6 @@ const Repositories = () => (
|
||||
|
||||
return (
|
||||
<div className={styles.repositories}>
|
||||
<QuickRun name="barge" />
|
||||
|
||||
<header>
|
||||
<h1 className={styles.repositoriesTitle}>
|
||||
Repositories
|
||||
|
@ -7,6 +7,7 @@ import Layout from '../components/Layout'
|
||||
import Content from '../components/Content'
|
||||
import HeaderHome from '../components/HeaderHome'
|
||||
import Repositories from '../components/Repositories'
|
||||
import QuickRun from '../components/QuickRun'
|
||||
import { ReactComponent as Arrow } from '../images/arrow.svg'
|
||||
import styles from './index.module.scss'
|
||||
|
||||
@ -73,6 +74,8 @@ const IndexPage = ({ data, location }) => (
|
||||
))}
|
||||
</ul>
|
||||
|
||||
<QuickRun />
|
||||
|
||||
<Repositories />
|
||||
</Content>
|
||||
</Layout>
|
||||
|
@ -44,6 +44,7 @@ pre {
|
||||
overflow: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
max-height: 800px;
|
||||
width: 100%;
|
||||
|
||||
code {
|
||||
background: none;
|
||||
|
Loading…
Reference in New Issue
Block a user