diff --git a/config.js b/config.js index 92aba4c9..5ccc0486 100644 --- a/config.js +++ b/config.js @@ -39,6 +39,14 @@ module.exports = { { from: '/tutorials/wallets/', to: '/concepts/wallets/' + }, + { + from: '/references/squid-py/', + to: 'https://squid-py.readthedocs.io/en/latest/' + }, + { + from: '/references/squid-java/', + to: 'https://www.javadoc.io/doc/com.oceanprotocol/squid/' } ] } diff --git a/content/references/squid-java.md b/content/references/squid-java.md deleted file mode 100644 index 53ccff64..00000000 --- a/content/references/squid-java.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -title: Squid-Java API Reference ---- - -Coming soon. For now, please see the squid-java source code on GitHub. - - diff --git a/content/references/squid-py.md b/content/references/squid-py.md deleted file mode 100644 index ca6c773b..00000000 --- a/content/references/squid-py.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: Squid-py API Reference ---- - -ReadTheDocs hosts the [squid-py API Reference Docs](https://squid-py.readthedocs.io/en/latest/). diff --git a/data/repositories.yml b/data/repositories.yml index 81255445..3df65e65 100644 --- a/data/repositories.yml +++ b/data/repositories.yml @@ -26,11 +26,11 @@ - name: squid-py links: - name: API reference - url: /references/squid-py/ + url: https://squid-py.readthedocs.io/en/latest/ - name: squid-java links: - name: API reference - url: /references/squid-java/ + url: https://www.javadoc.io/doc/com.oceanprotocol/squid/ - name: Plecos - group: OceanDB diff --git a/data/sidebars/references.yml b/data/sidebars/references.yml index eae63aa7..0b5eb7f3 100644 --- a/data/sidebars/references.yml +++ b/data/sidebars/references.yml @@ -21,9 +21,9 @@ - group: squid-py items: - title: API Reference - link: /references/squid-py/ + link: https://squid-py.readthedocs.io/en/latest/ - group: squid-java items: - title: API Reference - link: /references/squid-java/ + link: https://www.javadoc.io/doc/com.oceanprotocol/squid/ diff --git a/gatsby-node.js b/gatsby-node.js index 6684049a..08250dad 100755 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -152,51 +152,50 @@ exports.createPages = ({ graphql, actions }) => { // // Create pages from swagger json files // + const swaggerSpecs = [ + './data/aquarius.json', + './data/brizo.json' + ] const apiSwaggerTemplate = path.resolve( './src/templates/Swagger/index.jsx' ) + swaggerSpecs.forEach(spec => { + const api = require(spec) // eslint-disable-line + const name = path + .basename(spec) + .split('.json') + .join('') + const slug = `/references/${name}/` + + createPage({ + path: slug, + component: apiSwaggerTemplate, + context: { + slug, + api + } + }) + }) + + // Swagger Pet Store example, fetch from remote const petStoreSlug = '/references/petstore/' try { - const spec = await getSpec() + const api = await getSpec() createPage({ path: petStoreSlug, component: apiSwaggerTemplate, context: { slug: petStoreSlug, - api: spec + api } }) } catch (error) { console.log(error) } - const aquariusSpecs = require('./data/aquarius.json') - const aquariusSlug = '/references/aquarius/' - - createPage({ - path: aquariusSlug, - component: apiSwaggerTemplate, - context: { - slug: aquariusSlug, - api: aquariusSpecs - } - }) - - const brizoSpecs = require('./data/brizo.json') - const brizoSlug = '/references/brizo/' - - createPage({ - path: brizoSlug, - component: apiSwaggerTemplate, - context: { - slug: brizoSlug, - api: brizoSpecs - } - }) - // // Create pages from TypeDoc json files // diff --git a/package.json b/package.json index 03cafc9f..1952d6f8 100644 --- a/package.json +++ b/package.json @@ -26,15 +26,15 @@ "@oceanprotocol/art": "^2.2.0", "axios": "^0.18.0", "classnames": "^2.2.6", - "gatsby": "^2.2.8", - "gatsby-image": "^2.0.34", + "gatsby": "^2.3.2", + "gatsby-image": "^2.0.35", "gatsby-plugin-catch-links": "^2.0.13", - "gatsby-plugin-google-analytics": "^2.0.17", + "gatsby-plugin-google-analytics": "^2.0.18", "gatsby-plugin-manifest": "^2.0.24", "gatsby-plugin-offline": "^2.0.25", - "gatsby-plugin-react-helmet": "^3.0.10", + "gatsby-plugin-react-helmet": "^3.0.11", "gatsby-plugin-sass": "^2.0.11", - "gatsby-plugin-sharp": "^2.0.30", + "gatsby-plugin-sharp": "^2.0.31", "gatsby-plugin-sitemap": "^2.0.10", "gatsby-plugin-svgr": "^2.0.2", "gatsby-remark-autolink-headers": "^2.0.16", @@ -50,13 +50,14 @@ "gatsby-source-graphql": "^2.0.15", "gatsby-transformer-remark": "^2.3.8", "gatsby-transformer-sharp": "^2.1.17", - "gatsby-transformer-yaml": "^2.1.10", + "gatsby-transformer-xml": "^2.0.9", + "gatsby-transformer-yaml": "^2.1.11", "giphy-js-sdk-core": "^1.0.6", "intersection-observer": "^0.5.1", "node-sass": "^4.11.0", - "prismjs": "^1.15.0", - "react": "^16.8.4", - "react-dom": "^16.8.4", + "prismjs": "^1.16.0", + "react": "^16.8.5", + "react-dom": "^16.8.5", "react-helmet": "^5.2.0", "react-scrollspy": "^3.4.0", "rehype-react": "^3.1.0", @@ -64,7 +65,7 @@ "remark-github-plugin": "^1.3.1", "remark-react": "^5.0.1", "slugify": "^1.3.4", - "smoothscroll-polyfill": "^0.4.3", + "smoothscroll-polyfill": "^0.4.4", "swagger-client": "^3.8.25" }, "devDependencies": { @@ -74,7 +75,7 @@ "eslint-config-oceanprotocol": "^1.3.0", "eslint-config-prettier": "^4.1.0", "eslint-plugin-prettier": "^3.0.1", - "markdownlint-cli": "^0.14.0", + "markdownlint-cli": "^0.14.1", "npm-run-all": "^4.1.5", "ora": "^3.2.0", "prettier": "^1.16.4", diff --git a/src/components/Sidebar.jsx b/src/components/Sidebar.jsx index 7b019a05..86079029 100644 --- a/src/components/Sidebar.jsx +++ b/src/components/Sidebar.jsx @@ -1,6 +1,7 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' import { Link } from 'gatsby' +import { ReactComponent as External } from '../images/external.svg' import styles from './Sidebar.module.scss' const SidebarLink = ({ link, title, linkClasses }) => { @@ -13,7 +14,7 @@ const SidebarLink = ({ link, title, linkClasses }) => { target="_blank" rel="noopener noreferrer" > - {title} + {title} ) } else { diff --git a/src/components/Sidebar.module.scss b/src/components/Sidebar.module.scss index 3b2ea2f4..008f5cc5 100644 --- a/src/components/Sidebar.module.scss +++ b/src/components/Sidebar.module.scss @@ -152,3 +152,10 @@ border-left-color: $green; } } + +.external { + fill: $brand-grey-light; + display: inline-block; + width: $font-size-mini; + height: $font-size-mini; +} diff --git a/src/images/external.svg b/src/images/external.svg new file mode 100644 index 00000000..a199250a --- /dev/null +++ b/src/images/external.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/templates/Doc.module.scss b/src/templates/Doc.module.scss index 6e8e7a9e..e5e7eb6d 100644 --- a/src/templates/Doc.module.scss +++ b/src/templates/Doc.module.scss @@ -54,3 +54,14 @@ font-family: $font-family-monospace; color: $brand-grey-light; } + +.pathName { + font-size: $font-size-h3; + border-bottom: 1px solid $brand-grey-lighter; + padding-bottom: $spacer / 2; + margin-top: $spacer * 2; + margin-bottom: $spacer / $line-height; + overflow-wrap: break-word; + word-wrap: break-word; + word-break: break-all; +} diff --git a/src/templates/Swagger/Paths.jsx b/src/templates/Swagger/Paths.jsx index a7c078c3..1a3f9b25 100644 --- a/src/templates/Swagger/Paths.jsx +++ b/src/templates/Swagger/Paths.jsx @@ -3,6 +3,7 @@ import PropTypes from 'prop-types' import slugify from 'slugify' import { cleanPathKey } from './utils' import styles from './Paths.module.scss' +import stylesDoc from '../Doc.module.scss' const ParameterExample = ({ properties }) => ( // @@ -146,7 +147,7 @@ Method.propTypes = { const Paths = ({ paths }) => Object.entries(paths).map(([key, value]) => (
-

+

{cleanPathKey(key)}

diff --git a/src/templates/Swagger/Paths.module.scss b/src/templates/Swagger/Paths.module.scss index 9c48a7c4..35d9fa67 100644 --- a/src/templates/Swagger/Paths.module.scss +++ b/src/templates/Swagger/Paths.module.scss @@ -1,18 +1,5 @@ @import 'variables'; -.pathName { - font-size: $font-size-h3; - border-bottom: 1px solid $brand-grey-lighter; - padding-bottom: $spacer / 2; - margin-top: $spacer * 2; - margin-bottom: $spacer; - - code { - // stylelint-disable-next-line - background: none !important; - } -} - .pathMethod { font-size: $font-size-base; font-family: $font-family-monospace; diff --git a/src/templates/Typedoc/Entities.module.scss b/src/templates/Typedoc/Entities.module.scss index 3455e215..a9f58261 100644 --- a/src/templates/Typedoc/Entities.module.scss +++ b/src/templates/Typedoc/Entities.module.scss @@ -1,18 +1,8 @@ @import 'variables'; .entityName { + composes: pathName from '../Doc.module.scss'; font-size: $font-size-h2; - border-bottom: 1px solid $brand-grey-lighter; - padding-bottom: $spacer / 2; - margin-top: $spacer * 2; - margin-bottom: $spacer; - - code { - // stylelint-disable declaration-no-important - background: none !important; - padding: 0 !important; - // stylelint-enable declaration-no-important - } } .entityDescription {