This repository was archived by the owner on Jun 12, 2024. It is now read-only.
Repository navigation
Create Edit and CodeSnippet components - #197
Merged
Merged
Conversation
added 8 commits
December 3, 2019 20:17
* master: Use @mapbox/eslint-config-docs (#196)
Contributor
Author
|
This is ready for review, but can wait until the new year. |
colleenmcginnis
requested review from
colleenmcginnis
and removed request for
a team
January 2, 2020 21:24
Contributor
Author
|
Per chat, we're going to work in mr-ui code-snippet to this PR |
added 2 commits
January 2, 2020 20:07
* master: Update CHANGELOG.md Update CHANGELOG.md Collapse grayed lines in code block (#206) Add a tag component with themes (#216) Add new related page component (#213) Rework Notes themes (#202) Add "tag" option to second and third level headings (#212) Update style of BetaFlag (#207) allow `feedbackSentryDsn` to accept string (url) or boolean (false) Add IE11 compatibility for the `Search` component (#203) conditionally set `section` and `preferredLanguage`; send along `environment` Prepare 0.24.0 Add groovy highlight option (#201) Push text feedback to Sentry (#198) Prepare 0.23.0 Allow for a configurable connector on search component (#200) Update budo
* master: Create themes component to house shared themes for Tag and Note (#217)
added 5 commits
January 3, 2020 13:02
* master: Update CHANGELOG.md Update CHANGELOG.md create highlight/theme-css
Contributor
Author
|
Need to test locally in:
|
Edit and CodeSnippet components
katydecorah
force-pushed
the
edit-in-buttons
branch
from
January 3, 2020 21:37
c02d14a to
2347f58
Compare
|
|
||
| import React from 'react'; | ||
| import PropTypes from 'prop-types'; | ||
| import MrCodeSnippet from '@mapbox/mr-ui/code-snippet'; |
added 2 commits
January 6, 2020 08:19
Contributor
Author
|
@colleenmcginnis this is ready for review again! I updated the original comment with some testing suggestions |
| edit: { | ||
| html: '<h1>gurd murn!</h1>', | ||
| css: 'h1 {color: red}', | ||
| js: "console.log('hurn')", |
Contributor
There was a problem hiding this comment.
Trying to wrap my head around a real world example here. So if we were to use this with a tutorial code block, we could import the code and then use the extractor helper function to get the edit contents? Like:
<CodeSnippet
code={rawCode}
highlighter={() => highlightHtml}
edit={extractor(code)}
...
/>
Contributor
Author
There was a problem hiding this comment.
I'll add a test case!
colleenmcginnis
approved these changes
Jan 7, 2020
colleenmcginnis
left a comment
Contributor
There was a problem hiding this comment.
Looks great @katydecorah and all works as expected!
katydecorah
pushed a commit
that referenced
this pull request
Jan 7, 2020
* master: (32 commits) add missing indices (#219) Create `Edit` and `CodeSnippet` components (#197) Update CHANGELOG.md Update CHANGELOG.md create highlight/theme-css Create themes component to house shared themes for Tag and Note (#217) Update CHANGELOG.md Update CHANGELOG.md Collapse grayed lines in code block (#206) Add a tag component with themes (#216) Add new related page component (#213) Rework Notes themes (#202) Add "tag" option to second and third level headings (#212) Update style of BetaFlag (#207) allow `feedbackSentryDsn` to accept string (url) or boolean (false) Add IE11 compatibility for the `Search` component (#203) conditionally set `section` and `preferredLanguage`; send along `environment` Prepare 0.24.0 Add groovy highlight option (#201) Push text feedback to Sentry (#198) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a new component that you can send code and metadata to and these buttons will bring it into your favorite editor:
This PR also adds CodeSnippet that include:
To do:
How to test /mapbox-gl-js-docs:
npm run build(build it locally)dr-ui-edit-buttonsbranch"@mapbox/dr-ui": "file:/Users/katydecorah/Documents/GitHub/dr-ui/pkg",(update this with your path to your local dr-ui)yarn installthenyarn startHow to test in /help:
npm run build(build it locally)dr-ui-code-snippetbranch"@mapbox/dr-ui": "file:/Users/katydecorah/Documents/GitHub/dr-ui/pkg",(update this with your path to your local dr-ui)npm installthennpm start