diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..27d2dae --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +*/node_modules +*.log diff --git a/.gitignore b/.gitignore index 88f21de..c94c6c2 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,9 @@ node_modules yarn-error.log + # Build directory /public +build .DS_Store .idea diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d369844 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM node:8.11.4 + +WORKDIR /app/website + +EXPOSE 3000 35729 +COPY ./docs /app/docs +COPY ./website /app/website +RUN yarn install + +CMD ["yarn", "start"] diff --git a/README.md b/README.md index 6f3d9aa..f3da77f 100644 --- a/README.md +++ b/README.md @@ -1,40 +1,193 @@ +This website was created with [Docusaurus](https://docusaurus.io/). -## FlyBase GitHub Orgnization Website +# What's In This Document -This repository contains the code that generates the FlyBase -GitHub organization website hosted at https://flybase.github.io/ +* [Get Started in 5 Minutes](#get-started-in-5-minutes) +* [Directory Structure](#directory-structure) +* [Editing Content](#editing-content) +* [Adding Content](#adding-content) +* [Full Documentation](#full-documentation) -### Background +# Get Started in 5 Minutes -This site uses [Gatsbyjs](https://www.gatsbyjs.org/) to produce the documentation. +1. Make sure all the dependencies for the website are installed: -### Content +```sh +# Install dependencies +$ yarn +``` +2. Run your dev server: -Content for this site is generated via two main methods. Either via a React based -page under `src/pages/` or MD/MDX content under `src/content/`. +```sh +# Start the site +$ yarn start +``` -MD stands for Markdown and MDX are Markdown files that can use JSX components. +## Directory Structure -#### Layouts, Header, Footer, CSS, etc. +Your project file structure should look something like this -The `src/components` directory contains most of the React and CSS code that drives the -main page layout. +``` +my-docusaurus/ + docs/ + doc-1.md + doc-2.md + doc-3.md + website/ + blog/ + 2016-3-11-oldest-post.md + 2017-10-24-newest-post.md + core/ + node_modules/ + pages/ + static/ + css/ + img/ + package.json + sidebar.json + siteConfig.js +``` -#### Adding pages +# Editing Content -To add content to the site, create a new React component under `src/pages` or -a new MD/MDX file under `src/content`. +## Editing an existing docs page -Any sub-directories created will be reflected in the URL path. In other words, -creating a file called `src/content/chado/queries/index.md` will populate a page -at `https://flybase.github.io/chado/queries/`. +Edit docs by navigating to `docs/` and editing the corresponding document: -### Commands +`docs/doc-to-be-edited.md` -List of yarn/npm commands: - * npm run develop - Starts the developer mode via a local webserver. - * npm run build - Builds/compiles the static site. - * npm run format - Formats all JS/JSX code under `src` using prettier - * npm run deploy - Builds and publishes the static site to the GitHub website. - +```markdown +--- +id: page-needs-edit +title: This Doc Needs To Be Edited +--- +Edit me... +``` + +For more information about docs, click [here](https://docusaurus.io/docs/en/navigation) + +## Editing an existing blog post + +Edit blog posts by navigating to `website/blog` and editing the corresponding post: + +`website/blog/post-to-be-edited.md` +```markdown +--- +id: post-needs-edit +title: This Blog Post Needs To Be Edited +--- + +Edit me... +``` + +For more information about blog posts, click [here](https://docusaurus.io/docs/en/adding-blog) + +# Adding Content + +## Adding a new docs page to an existing sidebar + +1. Create the doc as a new markdown file in `/docs`, example `docs/newly-created-doc.md`: + +```md +--- +id: newly-created-doc +title: This Doc Needs To Be Edited +--- + +My new content here.. +``` + +1. Refer to that doc's ID in an existing sidebar in `website/sidebar.json`: + +```javascript +// Add newly-created-doc to the Getting Started category of docs +{ + "docs": { + "Getting Started": [ + "quick-start", + "newly-created-doc" // new doc here + ], + ... + }, + ... +} +``` + +For more information about adding new docs, click [here](https://docusaurus.io/docs/en/navigation) + +## Adding a new blog post + +1. Make sure there is a header link to your blog in `website/siteConfig.js`: + +`website/siteConfig.js` +```javascript +headerLinks: [ + ... + { blog: true, label: 'Blog' }, + ... +] +``` + +2. Create the blog post with the format `YYYY-MM-DD-My-Blog-Post-Title.md` in `website/blog`: + +`website/blog/2018-05-21-New-Blog-Post.md` + +```markdown +--- +author: Frank Li +authorURL: https://twitter.com/foobarbaz +authorFBID: 503283835 +title: New Blog Post +--- + +Lorem Ipsum... +``` + +For more information about blog posts, click [here](https://docusaurus.io/docs/en/adding-blog) + +## Adding items to your site's top navigation bar + +1. Add links to docs, custom pages or external links by editing the headerLinks field of `website/siteConfig.js`: + +`website/siteConfig.js` +```javascript +{ + headerLinks: [ + ... + /* you can add docs */ + { doc: 'my-examples', label: 'Examples' }, + /* you can add custom pages */ + { page: 'help', label: 'Help' }, + /* you can add external links */ + { href: 'https://github.com/facebook/Docusaurus', label: 'GitHub' }, + ... + ], + ... +} +``` + +For more information about the navigation bar, click [here](https://docusaurus.io/docs/en/navigation) + +## Adding custom pages + +1. Docusaurus uses React components to build pages. The components are saved as .js files in `website/pages/en`: +1. If you want your page to show up in your navigation header, you will need to update `website/siteConfig.js` to add to the `headerLinks` element: + +`website/siteConfig.js` +```javascript +{ + headerLinks: [ + ... + { page: 'my-new-custom-page', label: 'My New Custom Page' }, + ... + ], + ... +} +``` + +For more information about custom pages, click [here](https://docusaurus.io/docs/en/custom-pages). + +# Full Documentation + +Full documentation can be found on the [website](https://docusaurus.io/). diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..6711192 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,18 @@ +version: "3" + +services: + docusaurus: + build: . + ports: + - 3000:3000 + - 35729:35729 + volumes: + - ./docs:/app/docs + - ./website/blog:/app/website/blog + - ./website/core:/app/website/core + - ./website/i18n:/app/website/i18n + - ./website/pages:/app/website/pages + - ./website/static:/app/website/static + - ./website/sidebars.json:/app/website/sidebars.json + - ./website/siteConfig.js:/app/website/siteConfig.js + working_dir: /app/website diff --git a/docs/api/index.md b/docs/api/index.md new file mode 100644 index 0000000..c050159 --- /dev/null +++ b/docs/api/index.md @@ -0,0 +1,25 @@ +--- +id: index +title: API Overview +sidebar_label: Overview +--- + +## Description + +The FlyBase APIs provide access to data such as +[sequence data](/api/swagger-ui/#/Sequence), [gene summaries](/api/swagger-ui/#/Gene%20Summaries), +[protein domains](/api/swagger-ui/#/Domains), [Chado XML](/api/swagger-ui/#/Chado), and more. + +## API docs + +* [API docs](/api/swagger-ui/) +* [OpenAPI 3.0 JSON](https://api.swaggerhub.com/apis/FlyBase/FlyBase/1.0) + +## Rate limits + +Please limit the number of your requests to no more than 3 per second. +Anything over that will result in throttling or a complete ban. + +## Suggestions + +Have an idea for a service endpoint? Please [contact us](http://flybase.org/contact/email). \ No newline at end of file diff --git a/docs/chado/functions.md b/docs/chado/functions.md new file mode 100644 index 0000000..ede0d4b --- /dev/null +++ b/docs/chado/functions.md @@ -0,0 +1,197 @@ +--- +id: functions +title: FlyBase Chado Functions +sidebar_label: FlyBase Specific +--- + +## Description + +This page describes custom database functions that FlyBase has added to Chado to simplify +working with FlyBase data. For general Chado functions please +refer to the [GMOD Chado documentation](http://gmod.org/wiki/Chado_Manual#DBMS_Functions). + +## Source Code + +* [chado/schema](https://github.com/FlyBase/chado/tree/master/schema) (GitHub) + +## ID Utilities + +### data_class + +`flybase.data_class(FlyBase_ID)` + +Takes a FlyBase ID and returns the 4 letter FlyBase data class. + +e.g. FBgn0000490 -> FBgn + +```sql +select flybase.data_class('FBgn0000490'); +``` + +### update_ids + +`flybase.update_ids(FlyBase_ID)` + +Takes a single ID or an array of FlyBase Gene IDs (FBgn) and validates them against the current +database. A 3 column result set is returned containing the submitted ID, the updated ID, and +an update status. + +#### Update status +Status | Description +------ | ----------- +current | Submitted ID is current, there are no changes. +updated | The submitted ID is not current but the ID was cleanly updated to the current ID. +split | The submitted ID is not current and there are multiple possible new IDs. + +An ID that is involved in a split will have two or more entries in the result. One for +each of the possible new gene IDs. + +#### Parameters + +Name | Description | Required | Default +------------ | ------------- | --------- | ----------- +FlyBase_ID | One ID or an array of IDs | Y | N/A + +#### Returns + +Name | Description +------------ | ------------- +submitted_id | The ID originally submitted. +updated_id | The updated ID +status | Update status (current, updated, split) + +```sql +select * from flybase.update_ids('FBgn0000490'); +select * from flybase.update_ids(ARRAY['FBgn0000490','FBgn0002675','FBgn0030866','FBgn0031810']); +``` + +## Symbols and Names + +### current_symbol + +`flybase.current_symbol(FlyBase_ID)` + +Takes a current FlyBase ID and returns the current symbol. +Any current FlyBase data class ID can be passed in regardless of the hub table +that is used for that data class. + +```sql +select flybase.current_symbol('FBgn0000490'); +``` + +```sql +select flybase.current_symbol('FBgg0000546'); +``` + +```sql +select f.uniquename, flybase.current_symbol(f.uniquename) + from feature f + where f.uniquename ~ '^FBgn[0-9]+$' + and f.is_obsolete=false +limit 5; +``` + +### current_fullname + +`flybase.current_fullname(FlyBase_ID)` + +Takes a current FlyBase ID and returns the current full name. +Any current FlyBase data class ID can be passed in regardless of the hub table +that is used for that data class. + +```sql +select flybase.current_fullname('FBgn0000490'); +``` + +```sql +select flybase.current_fullname('FBgg0000546'); +``` + +```sql +select f.uniquename, flybase.current_fullname(f.uniquename) + from feature f + where f.uniquename ~ '^FBgn[0-9]+$' + and f.is_obsolete=false +limit 5; +``` + +### current_synonym + +`flybase.current_synonym(FlyBase_ID, synonym_type)` + +Takes a current FlyBase ID and a synonym type and returns the current synonym.synonym_sgml +value. + +```sql +select flybase.current_synonym('FBgn0000490','symbol'), + flybase.current_synonym('FBgn0000490','fullname'); +``` + +## Relationships + +These functions are for querying object relationships using tables such as `feature_relationship`. + +### get_feature_relationship + +`flybase.get_feature_relationship(FlyBase_ID(s), relationship_type, data_class, relationship_direction)` + +Takes one or more FlyBase IDs, relationship type(s), data class(es) (optional), and relationship direction (optional) +and returns the related entities. + +This can be used to fetch all transcripts of a gene, all alleles of a gene, orthologs, etc. + +#### Parameters +Name | Description | Required | Default +------------ | ------------- | --------- | ----------- +FlyBase_ID | One ID or an array of IDs to find other related entities for. | Y | N/A +relationship_type | One or more `cvterm.name` values used to type the relationship via `feature_relationship.type_id`.| Y | N/A +data_class | One or more FlyBase data classes to limit the results to.| N | all data classes +relationship_direction | The direction you wish to fetch objects for ('object' or 'subject'). | N | subject + +Multiple values in the relationship_type and data_class parameters need to be delimited with a pipe '|' +character. + +e.g. 'associated_with|partof' or 'FBal|FBtp|FBti' + +#### Returns + +Name | Description +------------ | ------------- +feature_relationship_id | Same as `feature_relationship` table +object_id | Same as `feature_relationship` table +subject_id | Same as `feature_relationship` table +uniquename | `feature.uniquename` of the related entity. +symbol | Current symbol of the related entity. +rank | Same as `feature_relationship` table. +value | Same as `feature_relationship` table. +type | The corresponding `cvterm.name` value for the `feature_relationship.type_id` field. + +```sql +-- Single IDs +select * from flybase.get_feature_relationship('FBgn0000490', 'associated_with|partof', 'FBti|FBtr'); +select * from flybase.get_feature_relationship('FBgn0000490', 'alleleof', 'FBal'); +select * from flybase.get_feature_relationship('FBgn0000490', 'alleleof', 'FBal', 'subject'); +select * from flybase.get_feature_relationship('FBgn0000490', 'orthologous_to', 'FBgn|FBog'); + +-- Multiple IDs +-- Using an array literal +select * + from flybase.get_feature_relationship( + array['FBgn0000490','FBgn0013765'], + 'alleleof', + NULL, + 'subject') +; +-- From a query result. +select * + from flybase.get_feature_relationship( + array( + select f.uniquename + from feature f + where uniquename in ('FBgn0000490','FBgn0013765') + ), + 'alleleof', + NULL, + 'subject') +; +``` \ No newline at end of file diff --git a/src/content/chado/index.mdx b/docs/chado/index.md similarity index 65% rename from src/content/chado/index.mdx rename to docs/chado/index.md index 42c2228..bacaec3 100644 --- a/src/content/chado/index.mdx +++ b/docs/chado/index.md @@ -1,37 +1,22 @@ --- -title: "FlyBase Chado" -date: "2017-08-10" -tags: - - chado +id: index +title: Chado General Information +sidebar_label: General Information --- -import { Breadcrumb } from 'semantic-ui-react' -import { navigate } from 'gatsby' - -
- - navigate('/') }>Home - - Chado - -
- - -## FlyBase Chado - -### Background +## Background [Chado](http://gmod.org/wiki/Chado) is a relational database schema for managing -a wide variety of biological data. It is was started by [FlyBase](http://flybase.org) -and is currently maintained by the [GMOD](http://gmod.org) organization. +biological data that was created by [FlyBase](http://flybase.org) in 2006. +It is currently developed and maintained by the [GMOD](http://gmod.org) organization. -### Database Dumps +## Database Dumps PostgreSQL database dumps of the FlyBase Chado database are available for every release of FlyBase from our FTP site. * [ftp://ftp.flybase.org/releases/current/psql/](ftp://ftp.flybase.org/releases/current/psql/) -#### Steps to load +### Steps to load This procedure assumes that you have enough disk space to hold the downloaded dump files and the PostgreSQL database files. You should expect to use ~200 GB of disk space for this procedure. @@ -49,28 +34,23 @@ cat FB2018_03.sql.gz.00 FB2018_03.sql.gz.01 FB2018_03.sql.gz.02 FB2018_03.sql.gz vacuumdb -f -z -v my_flybase ``` -### Public Database +## Public Database If you only need occasional access to the FlyBase Chado database and performance is not a primary concern you can access our public Chado instance via any SQL client that supports PostgreSQL. **hostname:** chado.flybase.org - + **user:** flybase - + **password:** <none> - + **database:** flybase - + **port:** 5432 - + Example using the command line PostgreSQL client `psql`: + ```bash psql -h chado.flybase.org flybase flybase -psql (10.4 (Ubuntu 10.4-0ubuntu0.18.04), server 9.5.12) -Type "help" for help. - -flybase=> ``` - - diff --git a/docs/downloads.md b/docs/downloads.md new file mode 100644 index 0000000..eeb8b03 --- /dev/null +++ b/docs/downloads.md @@ -0,0 +1,14 @@ +--- +id: downloads +title: Downloads Overview +sidebar_label: Overview +--- + +## Documentation + +* [Downloads Overview @FlyBase.org](https://wiki.flybase.org/wiki/FlyBase:Downloads_Overview) + +## File download site + +* [Releases](http://s3ftp.flybase.org/releases/) +* [Genomes](http://s3ftp.flybase.org/genomes/) diff --git a/docs/howtos.md b/docs/howtos.md new file mode 100644 index 0000000..add5c50 --- /dev/null +++ b/docs/howtos.md @@ -0,0 +1,17 @@ +--- +id: howtos-list +title: FlyBase HowTos +sidebar_label: Index +--- + +## Description + +HowTo tutorials for working with FlyBase data. + +We plan to add new HowTos every few weeks so bookmark this page for future reference. + +Have an idea for a HowTo? Please [send them to us](https://flybase.org/contact/email). + +## Symbols + +* [How to lookup FlyBase symbols in Chado](howtos/chado/symbol-lookup.md) \ No newline at end of file diff --git a/docs/howtos/chado/symbol-lookup.md b/docs/howtos/chado/symbol-lookup.md new file mode 100644 index 0000000..2e4da1f --- /dev/null +++ b/docs/howtos/chado/symbol-lookup.md @@ -0,0 +1,163 @@ +--- +id: symbol-lookup +title: Symbol Lookup with Chado +sidebar_label: Symbol Lookup +--- + +## Introduction + +In this HowTo, we are going cover how you can use Chado to get the current +symbol for a FlyBase object. A FlyBase object can be a gene, transcript, poplypeptide, insertion, +etc. + +If all you want is the quickest method to get the current symbol, +checkout the [flybase.current_symbol](chado/functions.md#current_symbol) function. + +## Requirements + +* A client capable of connecting to our [public PostgreSQL Chado](chado/index.md#public-database) database. +* Basic understanding of SQL. + +## Schema Structure + +The following chado tables are used in this HowTo: + +* [synonym](http://gmod.org/wiki/Chado_Tables#Table:_synonym) +* [cvterm](http://gmod.org/wiki/Chado_Tables#Table:_cvterm) +* [feature_synonym](http://gmod.org/wiki/Chado_Tables#Table:_feature_synonym) +* [feature](http://gmod.org/wiki/Chado_Tables#Table:_feature) + +## Synonym Table + +In Chado, symbols are stored in the `synonym` table along with other types of names such as +full names. In order to distinguish different types of entries in the `synonym` table from +each other, we associate each entry with a type in the `cvterm` table via the `synonym.type_id` field. +Every symbol entry in the `synonym` table gets assigned a `type_id` that corresponds to the `symbol` +`cvterm.name` entry. + +A query to fetch the first 10 symbols from this table looks like this: + +```sql +select s.name, s.synonym_sgml + from synonym s join cvterm cvt on s.type_id=cvt.cvterm_id + where cvt.name='symbol' +limit 10 +; +``` + +**Example output:** +```bash + name | synonym_sgml +------------------+------------------------- + Dok-RA | Dok-RA + TRAM-RB | TRAM-RB + ... + CG33070[EY06108] | CG33070EY06108 + betaTub60D[sk] | βTub60Dsk +``` + + +### `name` vs `synonym_sgml` + +As you can see the `synonym` table has two fields for storing the symbol, `name` +`synonym_sgml`. At FlyBase, we store an ASCII form of the symbol in `synonym.name` and +a UTF-8 version of the symbol in `synonym.synonym_sgml`. The main differences you will notice +between `name` and `synonym_sgml` are transliterated greek characters (beta) vs UTF-8 greek characters +(β) and square brackets `[]` or `[[]]` vs curator superscript/subscript notation `` +or `` respectively. + +## Gene Symbols + +To get symbols for genes we have to make a connection between the table being used to store +genes and the `synonym` table. For that we start with the `feature` table, which is the central +hub table for genes in FlyBase. Then in order to get to the `synonym` table we have to utilize +a linker table called `feature_synonym`. This linker table allows us to attach more than one +symbol and attribution to the association of the gene and symbol. + +Putting this together with the previous query the table path now looks something like this: + +`feature -> feature_synonym -> synonym -> cvterm` + +### Gene Symbol SQL + +Putting the above into SQL form, you get the following query for the gene FBgn0004907. + +```sql +select f.uniquename, s.synonym_sgml, fs.is_current + from feature f join feature_synonym fs on (f.feature_id=fs.feature_id) + join synonym s on (fs.synonym_id=s.synonym_id) + join cvterm cvt on (s.type_id=cvt.cvterm_id) + where f.uniquename='FBgn0004907' + and cvt.name='symbol' +; +``` + +```bash +... + FBgn0004907 | 14-3-3zeta | f + FBgn0004907 | 14-3-3zeta | f + FBgn0004907 | 1433Z | f + FBgn0004907 | Leo | f +(182 rows) +``` + +#### 182 Rows - What is going on?! + +There are a couple of issues here. First, take a look at the results for the `feature_synonym.is_current` +column, we have a mix of `true` and `false` in there. This field is used to distinguish symbols that +are current (gene symbol) and those that are no longer the current symbol (gene symbol synonym). In Drosophila +nomenclature, a gene can have only one valid symbol, all others are considered symbol synonyms. Symbols +that have `is_current=true` are the current symbol and `is_current=false` are symbol synonyms. + +#### OK, I've filtered on `is_current=true` but I'm still seeing duplicates + +The second issue here is that each use of the current symbol is being attributed to a specific publication +via `feature_synonym.pub_id` which results in repetitive results for each attribution. Filtering for +`is_current` and `pub_id` we get the following final form. + +```sql +select distinct f.uniquename, s.synonym_sgml + from feature f join feature_synonym fs on (f.feature_id=fs.feature_id) + join synonym s on (fs.synonym_id=s.synonym_id) + join cvterm cvt on (s.type_id=cvt.cvterm_id) + where f.uniquename='FBgn0004907' + and cvt.name='symbol' + and fs.is_current=true +; +``` +```sql + uniquename | synonym_sgml +-------------+-------------- + FBgn0004907 | 14-3-3ζ +(1 row) +``` + +## Other Symbols + +The above query will work for the majority of objects in FlyBase because they use the +`feature` table as a hub. However, there are some exceptions for FlyBase objects that +use other tables as their hub table. Other hub tables include `grp` (Gene Groups), `strain` (Strains), +`cell_line` (Cell Lines), `humanhealth` (Human Disease), and `library` (Library Metadata). + +For these other tables you will need to change the hub and linker tables +that are used and some of the ID fields used for joining. +For example, this is what a query for a Gene Group would look like after +switching to using the `grp` as the hub table and `grp_synonym` as the linker table. + +```sql +select distinct gg.uniquename, s.synonym_sgml + from grp gg join grp_synonym gs on (gg.grp_id=gs.grp_id) + join synonym s on (gs.synonym_id=s.synonym_id) + join cvterm cvt on (s.type_id=cvt.cvterm_id) + where gg.uniquename='FBgg0000546' + and cvt.name='symbol' + and gs.is_current=true +; +``` + +## Chado Function + +Since this is a commonly used query when working with FlyBase data we have added some custom FlyBase +functions to make this a bit easier. + +* [FlyBase Symbol Functions for Chado](chado/functions.md#symbols-and-names) diff --git a/gatsby-browser.js b/gatsby-browser.js deleted file mode 100644 index b1e5c31..0000000 --- a/gatsby-browser.js +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Implement Gatsby's Browser APIs in this file. - * - * See: https://www.gatsbyjs.org/docs/browser-apis/ - */ - -// You can delete this file if you're not using it diff --git a/gatsby-config.js b/gatsby-config.js deleted file mode 100644 index fcf5d37..0000000 --- a/gatsby-config.js +++ /dev/null @@ -1,41 +0,0 @@ -module.exports = { - siteMetadata: { - title: "FlyBase for Developers", - }, - plugins: [ - "gatsby-plugin-react-helmet", - "gatsby-transformer-json", - { - resolve: "gatsby-source-filesystem", - options: { - name: "docs", - path: `${__dirname}/src/content/`, - }, - }, - { - resolve: "gatsby-plugin-manifest", - options: { - name: "gatsby-starter-default", - short_name: "starter", - start_url: "/", - background_color: "#036", - theme_color: "#036", - display: "minimal-ui", - //icon: 'src/images/gatsby-icon.png', // This path is relative to the root of the site. - }, - }, - "gatsby-plugin-offline", - { - resolve: "gatsby-mdx", - options: { - defaultLayouts: { - default: require.resolve("./src/components/docs.js"), - }, - extensions: [".mdx", ".md"], - mdPlugins: [require("remark-toc")], - gatsbyRemarkPlugins: [{ resolve: "gatsby-remark-autolink-headers" }], - }, - }, - "gatsby-plugin-styled-components", - ], -} diff --git a/gatsby-node.js b/gatsby-node.js deleted file mode 100644 index 76322f9..0000000 --- a/gatsby-node.js +++ /dev/null @@ -1,109 +0,0 @@ -/** - * Implement Gatsby's Node APIs in this file. - * - * See: https://www.gatsbyjs.org/docs/node-apis/ - */ - -// gatsby-node.js -const path = require("path") -const startCase = require("lodash.startcase") -const componentWithMDXScope = require("gatsby-mdx/component-with-mdx-scope") - -// You can delete this file if you're not using it -exports.onCreateWebpackConfig = ({ stage, loaders, actions }) => { - if (stage === "build-html") { - actions.setWebpackConfig({ - module: { - rules: [ - { - test: /swagger-ui/, - use: loaders.null(), - }, - ], - }, - }) - } -} - -exports.createPages = ({ graphql, actions }) => { - const { createPage } = actions - return new Promise((resolve, reject) => { - resolve( - graphql( - ` - { - allMdx { - edges { - node { - fields { - id - slug - } - tableOfContents - code { - scope - } - } - } - } - } - ` - ).then(result => { - if (result.errors) { - console.log(result.errors) - reject(result.errors) - } - // Create blog posts pages. - result.data.allMdx.edges.forEach(({ node }) => { - createPage({ - path: node.fields.slug ? node.fields.slug : "/", - component: componentWithMDXScope( - path.resolve("./src/components/docs.js"), - node.code.scope - ), - context: { - id: node.fields.id, - }, - }) - }) - }) - ) - }) -} - -exports.onCreateWebpackConfig = ({ actions }) => { - actions.setWebpackConfig({ - resolve: { - modules: [path.resolve(__dirname, "src"), "node_modules"], - alias: { $components: path.resolve(__dirname, "src/components") }, - }, - }) -} - -exports.onCreateNode = ({ node, getNode, actions }) => { - const { createNodeField } = actions - - if (node.internal.type === `Mdx`) { - const parent = getNode(node.parent) - let value = parent.relativePath.replace(parent.ext, "") - value = value.replace(/\/index$/i, "/") - - createNodeField({ - name: "slug", - node, - value: `/${value}`, - }) - - createNodeField({ - name: "id", - node, - value: node.id, - }) - - createNodeField({ - name: "title", - node, - value: node.frontmatter.title || startCase(parent.name), - }) - } -} diff --git a/gatsby-ssr.js b/gatsby-ssr.js deleted file mode 100644 index b17b8fc..0000000 --- a/gatsby-ssr.js +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Implement Gatsby's SSR (Server Side Rendering) APIs in this file. - * - * See: https://www.gatsbyjs.org/docs/ssr-apis/ - */ - -// You can delete this file if you're not using it diff --git a/package.json b/package.json deleted file mode 100644 index bccb983..0000000 --- a/package.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "name": "flybase.github.io", - "description": "FlyBase doc site for developers", - "version": "0.1.0", - "author": "Josh Goodman ", - "dependencies": { - "@mdx-js/mdx": "^0.15.2", - "@mdx-js/tag": "^0.15.0", - "babel-plugin-styled-components": "^1.7.1", - "core-js": "^2.5.7", - "gatsby": "^2.0.0", - "gatsby-mdx": "^0.1.4", - "gatsby-plugin-manifest": "^2.0.2", - "gatsby-plugin-offline": "^2.0.5", - "gatsby-plugin-react-helmet": "^3.0.0", - "gatsby-plugin-styled-components": "^3.0.0", - "gatsby-remark-autolink-headers": "^2.0.6", - "gatsby-source-filesystem": "^2.0.1", - "gatsby-transformer-json": "^2.1.1", - "lodash.startcase": "^4.4.0", - "mobx": "^4.5.0", - "react": "^16.5.1", - "react-dom": "^16.5.1", - "react-helmet": "^5.2.0", - "redoc": "^2.0.0-alpha.40", - "remark-toc": "^5.0.0", - "semantic-ui-css": "^2.4.0", - "semantic-ui-react": "^0.82.5", - "styled-components": "^3.4.9" - }, - "keywords": [ - "gatsby", - "flybase" - ], - "license": "MIT", - "scripts": { - "build": "gatsby build", - "develop": "gatsby develop", - "format": "prettier --write '*.{js,jsx}' 'src/**/*.{js,jsx}'", - "test": "echo \"Error: no test specified\" && exit 1", - "deploy": "gatsby build --prefix-paths && gh-pages -d public -b gh-pages" - }, - "devDependencies": { - "gh-pages": "^2.0.0", - "prettier": "^1.14.2" - }, - "repository": { - "type": "git", - "url": "https://github.com/FlyBase/flybase.github.io" - } -} diff --git a/src/components/FlyBaseIcons.js b/src/components/FlyBaseIcons.js deleted file mode 100644 index 72328f2..0000000 --- a/src/components/FlyBaseIcons.js +++ /dev/null @@ -1,26 +0,0 @@ -import React from "react" -import { Icon } from "semantic-ui-react" - -function FlyBaseIcons({ iconSize = "large" }) { - return ( - - - - - - - - - - - - - - - - - - ) -} - -export default FlyBaseIcons diff --git a/src/components/docs.js b/src/components/docs.js deleted file mode 100644 index 96ed1f7..0000000 --- a/src/components/docs.js +++ /dev/null @@ -1,41 +0,0 @@ -import React, { Component } from "react" -import { graphql } from "gatsby" - -import MDXRenderer from "gatsby-mdx/mdx-renderer" -import { MDXProvider } from "@mdx-js/tag" -import { Grid } from "semantic-ui-react" - -import Layout from "./layout" - -export default class MDXRuntimeTest extends Component { - render() { - const { children, __mdxScope, data, ...props } = this.props - return ( - - - - - -
{children}
- - {data.mdx.code.body} - -
-
-
-
-
- ) - } -} - -export const pageQuery = graphql` - query($id: String!) { - mdx(id: { eq: $id }) { - id - code { - body - } - } - } -` diff --git a/src/components/footer.js b/src/components/footer.js deleted file mode 100644 index 9af9040..0000000 --- a/src/components/footer.js +++ /dev/null @@ -1,17 +0,0 @@ -import React from "react" -import { Divider, Grid } from "semantic-ui-react" - -import FlyBaseIcons from "./FlyBaseIcons" - -const Footer = () => ( - - - - - - - - -) - -export default Footer diff --git a/src/components/header.js b/src/components/header.js deleted file mode 100644 index 6abb8ab..0000000 --- a/src/components/header.js +++ /dev/null @@ -1,24 +0,0 @@ -import React from "react" -import { Link } from "gatsby" -import { Grid, Header as SemHeader } from "semantic-ui-react" - -import FlyBaseIcons from "./FlyBaseIcons" - -const Header = ({ siteTitle, iconSize = "large" }) => ( - - - - - - {siteTitle} - - - - - - - - -) - -export default Header diff --git a/src/components/layout.css b/src/components/layout.css deleted file mode 100644 index d875e48..0000000 --- a/src/components/layout.css +++ /dev/null @@ -1,649 +0,0 @@ -html { - font-family: sans-serif; - -ms-text-size-adjust: 100%; - -webkit-text-size-adjust: 100%; -} -body { - margin: 0; -} -article, -aside, -details, -figcaption, -figure, -footer, -header, -main, -menu, -nav, -section, -summary { - display: block; -} -audio, -canvas, -progress, -video { - display: inline-block; -} -audio:not([controls]) { - display: none; - height: 0; -} -progress { - vertical-align: baseline; -} -[hidden], -template { - display: none; -} -a { - background-color: transparent; - -webkit-text-decoration-skip: objects; -} -a:active, -a:hover { - outline-width: 0; -} -abbr[title] { - border-bottom: none; - text-decoration: underline; - text-decoration: underline dotted; -} -b, -strong { - font-weight: inherit; - font-weight: bolder; -} -dfn { - font-style: italic; -} -h1 { - font-size: 2em; - margin: .67em 0; -} -mark { - background-color: #ff0; - color: #000; -} -small { - font-size: 80%; -} -sub, -sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; -} -sub { - bottom: -.25em; -} -sup { - top: -.5em; -} -img { - border-style: none; -} -svg:not(:root) { - overflow: hidden; -} -code, -kbd, -pre, -samp { - font-family: monospace, monospace; - font-size: 1em; -} -figure { - margin: 1em 40px; -} -hr { - box-sizing: content-box; - height: 0; - overflow: visible; -} -button, -input, -optgroup, -select, -textarea { - font: inherit; - margin: 0; -} -optgroup { - font-weight: 700; -} -button, -input { - overflow: visible; -} -button, -select { - text-transform: none; -} -[type=reset], -[type=submit], -button, -html [type=button] { - -webkit-appearance: button; -} -[type=button]::-moz-focus-inner, -[type=reset]::-moz-focus-inner, -[type=submit]::-moz-focus-inner, -button::-moz-focus-inner { - border-style: none; - padding: 0; -} -[type=button]:-moz-focusring, -[type=reset]:-moz-focusring, -[type=submit]:-moz-focusring, -button:-moz-focusring { - outline: 1px dotted ButtonText; -} -fieldset { - border: 1px solid silver; - margin: 0 2px; - padding: .35em .625em .75em; -} -legend { - box-sizing: border-box; - color: inherit; - display: table; - max-width: 100%; - padding: 0; - white-space: normal; -} -textarea { - overflow: auto; -} -[type=checkbox], -[type=radio] { - box-sizing: border-box; - padding: 0; -} -[type=number]::-webkit-inner-spin-button, -[type=number]::-webkit-outer-spin-button { - height: auto; -} -[type=search] { - -webkit-appearance: textfield; - outline-offset: -2px; -} -[type=search]::-webkit-search-cancel-button, -[type=search]::-webkit-search-decoration { - -webkit-appearance: none; -} -::-webkit-input-placeholder { - color: inherit; - opacity: .54; -} -::-webkit-file-upload-button { - -webkit-appearance: button; - font: inherit; -} -html { - font: 112.5%/1.45em georgia, serif; - box-sizing: border-box; - overflow-y: scroll; -} -* { - box-sizing: inherit; -} -*:before { - box-sizing: inherit; -} -*:after { - box-sizing: inherit; -} -body { - color: hsla(0, 0%, 0%, 0.8); - font-family: georgia, serif; - font-weight: normal; - word-wrap: break-word; - font-kerning: normal; - -moz-font-feature-settings: "kern", "liga", "clig", "calt"; - -ms-font-feature-settings: "kern", "liga", "clig", "calt"; - -webkit-font-feature-settings: "kern", "liga", "clig", "calt"; - font-feature-settings: "kern", "liga", "clig", "calt"; -} -img { - max-width: 100%; - margin-left: 0; - margin-right: 0; - margin-top: 0; - padding-bottom: 0; - padding-left: 0; - padding-right: 0; - padding-top: 0; - margin-bottom: 1.45rem; -} -h1 { - margin-left: 0; - margin-right: 0; - margin-top: 0; - padding-bottom: 0; - padding-left: 0; - padding-right: 0; - padding-top: 0; - margin-bottom: 1.45rem; - color: inherit; - font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, - Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; - font-weight: bold; - text-rendering: optimizeLegibility; - font-size: 2.25rem; - line-height: 1.1; -} -h2 { - margin-left: 0; - margin-right: 0; - margin-top: 0; - padding-bottom: 0; - padding-left: 0; - padding-right: 0; - padding-top: 0; - margin-bottom: 1.45rem; - color: inherit; - font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, - Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; - font-weight: bold; - text-rendering: optimizeLegibility; - font-size: 1.62671rem; - line-height: 1.1; -} -h3 { - margin-left: 0; - margin-right: 0; - margin-top: 0; - padding-bottom: 0; - padding-left: 0; - padding-right: 0; - padding-top: 0; - margin-bottom: 1.45rem; - color: inherit; - font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, - Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; - font-weight: bold; - text-rendering: optimizeLegibility; - font-size: 1.38316rem; - line-height: 1.1; -} -h4 { - margin-left: 0; - margin-right: 0; - margin-top: 0; - padding-bottom: 0; - padding-left: 0; - padding-right: 0; - padding-top: 0; - margin-bottom: 1.45rem; - color: inherit; - font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, - Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; - font-weight: bold; - text-rendering: optimizeLegibility; - font-size: 1rem; - line-height: 1.1; -} -h5 { - margin-left: 0; - margin-right: 0; - margin-top: 0; - padding-bottom: 0; - padding-left: 0; - padding-right: 0; - padding-top: 0; - margin-bottom: 1.45rem; - color: inherit; - font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, - Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; - font-weight: bold; - text-rendering: optimizeLegibility; - font-size: 0.85028rem; - line-height: 1.1; -} -h6 { - margin-left: 0; - margin-right: 0; - margin-top: 0; - padding-bottom: 0; - padding-left: 0; - padding-right: 0; - padding-top: 0; - margin-bottom: 1.45rem; - color: inherit; - font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, - Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; - font-weight: bold; - text-rendering: optimizeLegibility; - font-size: 0.78405rem; - line-height: 1.1; -} -hgroup { - margin-left: 0; - margin-right: 0; - margin-top: 0; - padding-bottom: 0; - padding-left: 0; - padding-right: 0; - padding-top: 0; - margin-bottom: 1.45rem; -} -ul { - margin-left: 1.45rem; - margin-right: 0; - margin-top: 0; - padding-bottom: 0; - padding-left: 0; - padding-right: 0; - padding-top: 0; - margin-bottom: 1.45rem; - list-style-position: outside; - list-style-image: none; -} -ol { - margin-left: 1.45rem; - margin-right: 0; - margin-top: 0; - padding-bottom: 0; - padding-left: 0; - padding-right: 0; - padding-top: 0; - margin-bottom: 1.45rem; - list-style-position: outside; - list-style-image: none; -} -dl { - margin-left: 0; - margin-right: 0; - margin-top: 0; - padding-bottom: 0; - padding-left: 0; - padding-right: 0; - padding-top: 0; - margin-bottom: 1.45rem; -} -dd { - margin-left: 0; - margin-right: 0; - margin-top: 0; - padding-bottom: 0; - padding-left: 0; - padding-right: 0; - padding-top: 0; - margin-bottom: 1.45rem; -} -p { - margin-left: 0; - margin-right: 0; - margin-top: 0; - padding-bottom: 0; - padding-left: 0; - padding-right: 0; - padding-top: 0; - margin-bottom: 1.45rem; -} -figure { - margin-left: 0; - margin-right: 0; - margin-top: 0; - padding-bottom: 0; - padding-left: 0; - padding-right: 0; - padding-top: 0; - margin-bottom: 1.45rem; -} -pre { - margin-left: 0; - margin-right: 0; - margin-top: 0; - padding-bottom: 0; - padding-left: 0; - padding-right: 0; - padding-top: 0; - margin-bottom: 1.45rem; - font-size: 0.85rem; - line-height: 1.42; - background: hsla(0, 0%, 0%, 0.04); - border-radius: 3px; - overflow: auto; - word-wrap: normal; - padding: 1.45rem; -} -table { - margin-left: 0; - margin-right: 0; - margin-top: 0; - padding-bottom: 0; - padding-left: 0; - padding-right: 0; - padding-top: 0; - margin-bottom: 1.45rem; - font-size: 1rem; - line-height: 1.45rem; - border-collapse: collapse; - width: 100%; -} -fieldset { - margin-left: 0; - margin-right: 0; - margin-top: 0; - padding-bottom: 0; - padding-left: 0; - padding-right: 0; - padding-top: 0; - margin-bottom: 1.45rem; -} -blockquote { - margin-left: 1.45rem; - margin-right: 1.45rem; - margin-top: 0; - padding-bottom: 0; - padding-left: 0; - padding-right: 0; - padding-top: 0; - margin-bottom: 1.45rem; -} -form { - margin-left: 0; - margin-right: 0; - margin-top: 0; - padding-bottom: 0; - padding-left: 0; - padding-right: 0; - padding-top: 0; - margin-bottom: 1.45rem; -} -noscript { - margin-left: 0; - margin-right: 0; - margin-top: 0; - padding-bottom: 0; - padding-left: 0; - padding-right: 0; - padding-top: 0; - margin-bottom: 1.45rem; -} -iframe { - margin-left: 0; - margin-right: 0; - margin-top: 0; - padding-bottom: 0; - padding-left: 0; - padding-right: 0; - padding-top: 0; - margin-bottom: 1.45rem; -} -hr { - margin-left: 0; - margin-right: 0; - margin-top: 0; - padding-bottom: 0; - padding-left: 0; - padding-right: 0; - padding-top: 0; - margin-bottom: calc(1.45rem - 1px); - background: hsla(0, 0%, 0%, 0.2); - border: none; - height: 1px; -} -address { - margin-left: 0; - margin-right: 0; - margin-top: 0; - padding-bottom: 0; - padding-left: 0; - padding-right: 0; - padding-top: 0; - margin-bottom: 1.45rem; -} -b { - font-weight: bold; -} -strong { - font-weight: bold; -} -dt { - font-weight: bold; -} -th { - font-weight: bold; -} -li { - margin-bottom: calc(1.45rem / 2); -} -ol li { - padding-left: 0; -} -ul li { - padding-left: 0; -} -li > ol { - margin-left: 1.45rem; - margin-bottom: calc(1.45rem / 2); - margin-top: calc(1.45rem / 2); -} -li > ul { - margin-left: 1.45rem; - margin-bottom: calc(1.45rem / 2); - margin-top: calc(1.45rem / 2); -} -blockquote *:last-child { - margin-bottom: 0; -} -li *:last-child { - margin-bottom: 0; -} -p *:last-child { - margin-bottom: 0; -} -li > p { - margin-bottom: calc(1.45rem / 2); -} -code { - font-size: 0.85rem; - line-height: 1.45rem; -} -kbd { - font-size: 0.85rem; - line-height: 1.45rem; -} -samp { - font-size: 0.85rem; - line-height: 1.45rem; -} -abbr { - border-bottom: 1px dotted hsla(0, 0%, 0%, 0.5); - cursor: help; -} -acronym { - border-bottom: 1px dotted hsla(0, 0%, 0%, 0.5); - cursor: help; -} -abbr[title] { - border-bottom: 1px dotted hsla(0, 0%, 0%, 0.5); - cursor: help; - text-decoration: none; -} -thead { - text-align: left; -} -td, -th { - text-align: left; - border-bottom: 1px solid hsla(0, 0%, 0%, 0.12); - font-feature-settings: "tnum"; - -moz-font-feature-settings: "tnum"; - -ms-font-feature-settings: "tnum"; - -webkit-font-feature-settings: "tnum"; - padding-left: 0.96667rem; - padding-right: 0.96667rem; - padding-top: 0.725rem; - padding-bottom: calc(0.725rem - 1px); -} -th:first-child, -td:first-child { - padding-left: 0; -} -th:last-child, -td:last-child { - padding-right: 0; -} -tt, -code { - background-color: hsla(0, 0%, 0%, 0.04); - border-radius: 3px; - font-family: "SFMono-Regular", Consolas, "Roboto Mono", "Droid Sans Mono", - "Liberation Mono", Menlo, Courier, monospace; - padding: 0; - padding-top: 0.2em; - padding-bottom: 0.2em; -} -pre code { - background: none; - line-height: 1.42; -} -code:before, -code:after, -tt:before, -tt:after { - letter-spacing: -0.2em; - content: " "; -} -pre code:before, -pre code:after, -pre tt:before, -pre tt:after { - content: ""; -} -@media only screen and (max-width: 480px) { - html { - font-size: 100%; - } -} - -main { - margin-top: 3rem; -} - -.topbar { - background-color: #036; - height: 6rem; - color: white; -} - -.topbar a { - color: white; -} - -i.icon.center { - align-self: center; -} -a i.icon.center { - color: black; -} - -.breadcrumb-container { - margin-bottom: 2rem; -} diff --git a/src/components/layout.js b/src/components/layout.js deleted file mode 100644 index 9794cbd..0000000 --- a/src/components/layout.js +++ /dev/null @@ -1,52 +0,0 @@ -import React from "react" -import PropTypes from "prop-types" -import Helmet from "react-helmet" -import { StaticQuery, graphql } from "gatsby" - -import Header from "./header" -import Footer from "./footer" -import "semantic-ui-css/semantic.min.css" -import "./layout.css" - -const Layout = ({ children }) => ( - ( - <> - - - - -
-
{children}
-