1
0
mirror of https://github.com/oceanprotocol/docs.git synced 2024-06-29 00:58:02 +02:00

embed any file's content from GitHub

This commit is contained in:
Matthias Kretschmann 2018-11-12 20:21:12 +01:00
parent f5bc1ae68a
commit 2b570b4726
Signed by: m
GPG Key ID: 606EEEF3C479A91F
5 changed files with 25 additions and 2 deletions

View File

@ -377,3 +377,14 @@ Resulting in:
<repo name="aquarius" readme="true"></repo>
### Embedding File Contents from GitHub
You can embed any file contents like so, note that the language needs to be defined manually to get proper syntax highlighting:
```text
GITHUB-EMBED https://github.com/oceanprotocol/squid-js/blob/develop/src/keeper/Web3Provider.ts js GITHUB-EMBED
```
Resulting in:
GITHUB-EMBED https://github.com/oceanprotocol/squid-js/blob/develop/src/keeper/Web3Provider.ts js GITHUB-EMBED

View File

@ -73,6 +73,17 @@ module.exports = {
showCaptions: true
}
},
{
resolve: 'gatsby-remark-github',
options: {
marker: 'GITHUB-EMBED',
insertEllipsisComments: true,
ellipsisPhrase: '...',
useCache: true,
cacheKey: 'gatsby-remark-github-v1',
token: process.env.GITHUB_TOKEN
}
},
'gatsby-remark-smartypants',
'gatsby-remark-embed-video',
'gatsby-remark-responsive-iframe',

View File

@ -38,6 +38,7 @@
"gatsby-remark-component": "^1.1.3",
"gatsby-remark-copy-linked-files": "^2.0.6",
"gatsby-remark-embed-video": "^1.4.0",
"gatsby-remark-github": "^1.0.1",
"gatsby-remark-images": "^2.0.6",
"gatsby-remark-prismjs": "^3.0.3",
"gatsby-remark-responsive-iframe": "^2.0.6",

View File

@ -18,7 +18,7 @@ const HeaderSection = ({ title }) => (
)
HeaderSection.propTypes = {
title: PropTypes.array
title: PropTypes.PropTypes.oneOfType([PropTypes.array, PropTypes.string])
}
export default HeaderSection

View File

@ -174,7 +174,7 @@ const Repository = ({ name, links, readme }) => (
Repository.propTypes = {
name: PropTypes.string.isRequired,
links: PropTypes.array,
readme: PropTypes.bool
readme: PropTypes.oneOfType([PropTypes.bool, PropTypes.string])
}
export default Repository