{"action":"opened","number":3102,"pull_request":{"url":"https://api.github.com/repos/ONRR/doi-extractives-data/pulls/3102","id":206115318,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA2MTE1MzE4","html_url":"https://github.com/ONRR/doi-extractives-data/pull/3102","diff_url":"https://github.com/ONRR/doi-extractives-data/pull/3102.diff","patch_url":"https://github.com/ONRR/doi-extractives-data/pull/3102.patch","issue_url":"https://api.github.com/repos/ONRR/doi-extractives-data/issues/3102","number":3102,"state":"open","locked":false,"title":"Partial migration of Styleguide to Pattern Library","user":{"login":"adborden","id":509703,"node_id":"MDQ6VXNlcjUwOTcwMw==","avatar_url":"https://avatars2.githubusercontent.com/u/509703?v=4","gravatar_id":"","url":"https://api.github.com/users/adborden","html_url":"https://github.com/adborden","followers_url":"https://api.github.com/users/adborden/followers","following_url":"https://api.github.com/users/adborden/following{/other_user}","gists_url":"https://api.github.com/users/adborden/gists{/gist_id}","starred_url":"https://api.github.com/users/adborden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adborden/subscriptions","organizations_url":"https://api.github.com/users/adborden/orgs","repos_url":"https://api.github.com/users/adborden/repos","events_url":"https://api.github.com/users/adborden/events{/privacy}","received_events_url":"https://api.github.com/users/adborden/received_events","type":"User","site_admin":false},"body":"Fixes #3085 \r\n\r\n[:sunglasses: PREVIEW](https://federalist-proxy.app.cloud.gov/preview/onrr/doi-extractives-data/migrate-styleguide/patterns/)\r\n\r\nChanges proposed in this pull request:\r\n\r\n- Copies main documentation over to pattern library.\r\n- Shows how React components could be used within documentation.\r\n- Updates the layout of the pattern library to be more usable.\r\n- Migrates some of the components from the Styleguide.\r\n\r\nI will create issues for follow-on work.\r\n\r\n## Including mark up in documentation pages\r\n\r\nI'm going to write about how to include markup in the documentation pages (pages under `pattern-library/src/docs`. The color palette is a great example because it is not a component you would use on the NRRD site, but it is custom markup generated from data that is useful within the pattern library.\r\n\r\nImplementing the color palette pages was a bit tricky because the palette is generated dynamically. Gatsby's Markdown plugin doesn't include any kind of template language that would allow you to loop over data for example. I tried several different methods to figure out the best way to implement these pages. Unfortunately, I didn't get to a point where I decided on one, so for now there are several methods and we'll have to figure out which one we prefer as we continue development. Here are the general methods:\r\n\r\n- Implement each palette as a Gatsby component in `gatsby-site/src/components`\r\n- Use [rehype-react](https://github.com/rhysd/rehype-react) to allow us to include custom elements in the markdown\r\n- Create Gatsby pages in React instead of markdown\r\n\r\n\r\n### Palette as Gatsby component\r\n\r\nIn this case, you're treating the palette as if it was a production component on NRRD, even though it is not. This is the most straight forward solution because it shows up as a component and works just as you would expect it. The main drawback is this is no longer a documentation page, it's a component page.\r\n\r\n\r\n### Custom elements in markdown\r\n\r\nWith [rehype-react](https://github.com/rhysd/rehype-react), we can include custom elements within the markdown, e.g.\r\n\r\n```markdown\r\n# Color swatch\r\n\r\nThis is a color swatch in markdown:\r\n\r\n<color-swatch color=\"green\" code=\"#33dd55\" accessible=\"true\"></color-swatch>\r\n```\r\n\r\nThe downsides are a) attributes are always strings, so you have to parse them to other types and cannot include objects b) you still can't generate these from data c) you have to whitelist each component you want to use in markdown.\r\n\r\n\r\n### Documentation as a custom Gatsby page\r\n\r\nDownsides are a) I can't figure out how to get a title on these for the side navigation :blush: b) it lives in `pattern-library/src/pages` instead of `pattern-library/src/docs` c) you have to do extra work to include markdown content.","created_at":"2018-08-03T19:11:01Z","updated_at":"2018-08-03T19:11:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ONRR/doi-extractives-data/pulls/3102/commits","review_comments_url":"https://api.github.com/repos/ONRR/doi-extractives-data/pulls/3102/comments","review_comment_url":"https://api.github.com/repos/ONRR/doi-extractives-data/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ONRR/doi-extractives-data/issues/3102/comments","statuses_url":"https://api.github.com/repos/ONRR/doi-extractives-data/statuses/9756534af5ffee7fb85927ac00041c6abeb69e3d","head":{"label":"ONRR:migrate-styleguide","ref":"migrate-styleguide","sha":"9756534af5ffee7fb85927ac00041c6abeb69e3d","user":{"login":"ONRR","id":39165431,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM5MTY1NDMx","avatar_url":"https://avatars0.githubusercontent.com/u/39165431?v=4","gravatar_id":"","url":"https://api.github.com/users/ONRR","html_url":"https://github.com/ONRR","followers_url":"https://api.github.com/users/ONRR/followers","following_url":"https://api.github.com/users/ONRR/following{/other_user}","gists_url":"https://api.github.com/users/ONRR/gists{/gist_id}","starred_url":"https://api.github.com/users/ONRR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ONRR/subscriptions","organizations_url":"https://api.github.com/users/ONRR/orgs","repos_url":"https://api.github.com/users/ONRR/repos","events_url":"https://api.github.com/users/ONRR/events{/privacy}","received_events_url":"https://api.github.com/users/ONRR/received_events","type":"Organization","site_admin":false},"repo":{"id":21627244,"node_id":"MDEwOlJlcG9zaXRvcnkyMTYyNzI0NA==","name":"doi-extractives-data","full_name":"ONRR/doi-extractives-data","owner":{"login":"ONRR","id":39165431,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM5MTY1NDMx","avatar_url":"https://avatars0.githubusercontent.com/u/39165431?v=4","gravatar_id":"","url":"https://api.github.com/users/ONRR","html_url":"https://github.com/ONRR","followers_url":"https://api.github.com/users/ONRR/followers","following_url":"https://api.github.com/users/ONRR/following{/other_user}","gists_url":"https://api.github.com/users/ONRR/gists{/gist_id}","starred_url":"https://api.github.com/users/ONRR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ONRR/subscriptions","organizations_url":"https://api.github.com/users/ONRR/orgs","repos_url":"https://api.github.com/users/ONRR/repos","events_url":"https://api.github.com/users/ONRR/events{/privacy}","received_events_url":"https://api.github.com/users/ONRR/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ONRR/doi-extractives-data","description":"Information on the extractive industries in the U.S. from federal data.","fork":false,"url":"https://api.github.com/repos/ONRR/doi-extractives-data","forks_url":"https://api.github.com/repos/ONRR/doi-extractives-data/forks","keys_url":"https://api.github.com/repos/ONRR/doi-extractives-data/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ONRR/doi-extractives-data/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ONRR/doi-extractives-data/teams","hooks_url":"https://api.github.com/repos/ONRR/doi-extractives-data/hooks","issue_events_url":"https://api.github.com/repos/ONRR/doi-extractives-data/issues/events{/number}","events_url":"https://api.github.com/repos/ONRR/doi-extractives-data/events","assignees_url":"https://api.github.com/repos/ONRR/doi-extractives-data/assignees{/user}","branches_url":"https://api.github.com/repos/ONRR/doi-extractives-data/branches{/branch}","tags_url":"https://api.github.com/repos/ONRR/doi-extractives-data/tags","blobs_url":"https://api.github.com/repos/ONRR/doi-extractives-data/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ONRR/doi-extractives-data/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ONRR/doi-extractives-data/git/refs{/sha}","trees_url":"https://api.github.com/repos/ONRR/doi-extractives-data/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ONRR/doi-extractives-data/statuses/{sha}","languages_url":"https://api.github.com/repos/ONRR/doi-extractives-data/languages","stargazers_url":"https://api.github.com/repos/ONRR/doi-extractives-data/stargazers","contributors_url":"https://api.github.com/repos/ONRR/doi-extractives-data/contributors","subscribers_url":"https://api.github.com/repos/ONRR/doi-extractives-data/subscribers","subscription_url":"https://api.github.com/repos/ONRR/doi-extractives-data/subscription","commits_url":"https://api.github.com/repos/ONRR/doi-extractives-data/commits{/sha}","git_commits_url":"https://api.github.com/repos/ONRR/doi-extractives-data/git/commits{/sha}","comments_url":"https://api.github.com/repos/ONRR/doi-extractives-data/comments{/number}","issue_comment_url":"https://api.github.com/repos/ONRR/doi-extractives-data/issues/comments{/number}","contents_url":"https://api.github.com/repos/ONRR/doi-extractives-data/contents/{+path}","compare_url":"https://api.github.com/repos/ONRR/doi-extractives-data/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ONRR/doi-extractives-data/merges","archive_url":"https://api.github.com/repos/ONRR/doi-extractives-data/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ONRR/doi-extractives-data/downloads","issues_url":"https://api.github.com/repos/ONRR/doi-extractives-data/issues{/number}","pulls_url":"https://api.github.com/repos/ONRR/doi-extractives-data/pulls{/number}","milestones_url":"https://api.github.com/repos/ONRR/doi-extractives-data/milestones{/number}","notifications_url":"https://api.github.com/repos/ONRR/doi-extractives-data/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ONRR/doi-extractives-data/labels{/name}","releases_url":"https://api.github.com/repos/ONRR/doi-extractives-data/releases{/id}","deployments_url":"https://api.github.com/repos/ONRR/doi-extractives-data/deployments","created_at":"2014-07-08T19:44:18Z","updated_at":"2018-08-02T12:07:48Z","pushed_at":"2018-08-03T19:00:07Z","git_url":"git://github.com/ONRR/doi-extractives-data.git","ssh_url":"git@github.com:ONRR/doi-extractives-data.git","clone_url":"https://github.com/ONRR/doi-extractives-data.git","svn_url":"https://github.com/ONRR/doi-extractives-data","homepage":"https://revenuedata.doi.gov/","size":348543,"stargazers_count":43,"watchers_count":43,"language":"HTML","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":31,"mirror_url":null,"archived":false,"open_issues_count":121,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":31,"open_issues":121,"watchers":43,"default_branch":"dev"}},"base":{"label":"ONRR:dev","ref":"dev","sha":"54d27992cac01a6060151e8a0f6f1ed8e4c67166","user":{"login":"ONRR","id":39165431,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM5MTY1NDMx","avatar_url":"https://avatars0.githubusercontent.com/u/39165431?v=4","gravatar_id":"","url":"https://api.github.com/users/ONRR","html_url":"https://github.com/ONRR","followers_url":"https://api.github.com/users/ONRR/followers","following_url":"https://api.github.com/users/ONRR/following{/other_user}","gists_url":"https://api.github.com/users/ONRR/gists{/gist_id}","starred_url":"https://api.github.com/users/ONRR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ONRR/subscriptions","organizations_url":"https://api.github.com/users/ONRR/orgs","repos_url":"https://api.github.com/users/ONRR/repos","events_url":"https://api.github.com/users/ONRR/events{/privacy}","received_events_url":"https://api.github.com/users/ONRR/received_events","type":"Organization","site_admin":false},"repo":{"id":21627244,"node_id":"MDEwOlJlcG9zaXRvcnkyMTYyNzI0NA==","name":"doi-extractives-data","full_name":"ONRR/doi-extractives-data","owner":{"login":"ONRR","id":39165431,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM5MTY1NDMx","avatar_url":"https://avatars0.githubusercontent.com/u/39165431?v=4","gravatar_id":"","url":"https://api.github.com/users/ONRR","html_url":"https://github.com/ONRR","followers_url":"https://api.github.com/users/ONRR/followers","following_url":"https://api.github.com/users/ONRR/following{/other_user}","gists_url":"https://api.github.com/users/ONRR/gists{/gist_id}","starred_url":"https://api.github.com/users/ONRR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ONRR/subscriptions","organizations_url":"https://api.github.com/users/ONRR/orgs","repos_url":"https://api.github.com/users/ONRR/repos","events_url":"https://api.github.com/users/ONRR/events{/privacy}","received_events_url":"https://api.github.com/users/ONRR/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ONRR/doi-extractives-data","description":"Information on the extractive industries in the U.S. from federal data.","fork":false,"url":"https://api.github.com/repos/ONRR/doi-extractives-data","forks_url":"https://api.github.com/repos/ONRR/doi-extractives-data/forks","keys_url":"https://api.github.com/repos/ONRR/doi-extractives-data/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ONRR/doi-extractives-data/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ONRR/doi-extractives-data/teams","hooks_url":"https://api.github.com/repos/ONRR/doi-extractives-data/hooks","issue_events_url":"https://api.github.com/repos/ONRR/doi-extractives-data/issues/events{/number}","events_url":"https://api.github.com/repos/ONRR/doi-extractives-data/events","assignees_url":"https://api.github.com/repos/ONRR/doi-extractives-data/assignees{/user}","branches_url":"https://api.github.com/repos/ONRR/doi-extractives-data/branches{/branch}","tags_url":"https://api.github.com/repos/ONRR/doi-extractives-data/tags","blobs_url":"https://api.github.com/repos/ONRR/doi-extractives-data/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ONRR/doi-extractives-data/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ONRR/doi-extractives-data/git/refs{/sha}","trees_url":"https://api.github.com/repos/ONRR/doi-extractives-data/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ONRR/doi-extractives-data/statuses/{sha}","languages_url":"https://api.github.com/repos/ONRR/doi-extractives-data/languages","stargazers_url":"https://api.github.com/repos/ONRR/doi-extractives-data/stargazers","contributors_url":"https://api.github.com/repos/ONRR/doi-extractives-data/contributors","subscribers_url":"https://api.github.com/repos/ONRR/doi-extractives-data/subscribers","subscription_url":"https://api.github.com/repos/ONRR/doi-extractives-data/subscription","commits_url":"https://api.github.com/repos/ONRR/doi-extractives-data/commits{/sha}","git_commits_url":"https://api.github.com/repos/ONRR/doi-extractives-data/git/commits{/sha}","comments_url":"https://api.github.com/repos/ONRR/doi-extractives-data/comments{/number}","issue_comment_url":"https://api.github.com/repos/ONRR/doi-extractives-data/issues/comments{/number}","contents_url":"https://api.github.com/repos/ONRR/doi-extractives-data/contents/{+path}","compare_url":"https://api.github.com/repos/ONRR/doi-extractives-data/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ONRR/doi-extractives-data/merges","archive_url":"https://api.github.com/repos/ONRR/doi-extractives-data/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ONRR/doi-extractives-data/downloads","issues_url":"https://api.github.com/repos/ONRR/doi-extractives-data/issues{/number}","pulls_url":"https://api.github.com/repos/ONRR/doi-extractives-data/pulls{/number}","milestones_url":"https://api.github.com/repos/ONRR/doi-extractives-data/milestones{/number}","notifications_url":"https://api.github.com/repos/ONRR/doi-extractives-data/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ONRR/doi-extractives-data/labels{/name}","releases_url":"https://api.github.com/repos/ONRR/doi-extractives-data/releases{/id}","deployments_url":"https://api.github.com/repos/ONRR/doi-extractives-data/deployments","created_at":"2014-07-08T19:44:18Z","updated_at":"2018-08-02T12:07:48Z","pushed_at":"2018-08-03T19:00:07Z","git_url":"git://github.com/ONRR/doi-extractives-data.git","ssh_url":"git@github.com:ONRR/doi-extractives-data.git","clone_url":"https://github.com/ONRR/doi-extractives-data.git","svn_url":"https://github.com/ONRR/doi-extractives-data","homepage":"https://revenuedata.doi.gov/","size":348543,"stargazers_count":43,"watchers_count":43,"language":"HTML","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":31,"mirror_url":null,"archived":false,"open_issues_count":121,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":31,"open_issues":121,"watchers":43,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/ONRR/doi-extractives-data/pulls/3102"},"html":{"href":"https://github.com/ONRR/doi-extractives-data/pull/3102"},"issue":{"href":"https://api.github.com/repos/ONRR/doi-extractives-data/issues/3102"},"comments":{"href":"https://api.github.com/repos/ONRR/doi-extractives-data/issues/3102/comments"},"review_comments":{"href":"https://api.github.com/repos/ONRR/doi-extractives-data/pulls/3102/comments"},"review_comment":{"href":"https://api.github.com/repos/ONRR/doi-extractives-data/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ONRR/doi-extractives-data/pulls/3102/commits"},"statuses":{"href":"https://api.github.com/repos/ONRR/doi-extractives-data/statuses/9756534af5ffee7fb85927ac00041c6abeb69e3d"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":16,"additions":1283,"deletions":143,"changed_files":39}}
{"actor":{"display_login":"adborden"}}