Skip to content

Commit

Permalink
Add a button to copy markdown with playground information
Browse files Browse the repository at this point in the history
  • Loading branch information
fee1-dead committed Dec 23, 2021
1 parent 361fa21 commit f08ceb1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions ui/frontend/Output/Gist.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,15 @@ const Links: React.SFC = () => {
const gistUrl = useSelector((state: State) => state.output.gist.url);
const permalink = useSelector(selectors.permalinkSelector);
const urloUrl = useSelector(selectors.urloUrlSelector);
const markdownSnippet = useSelector(selectors.snippetSelector);

return (
<Fragment>
<Copied href={permalink}>Permalink to the playground</Copied>
<Copied href={gistUrl}>Direct link to the gist</Copied>
<Copied href={codeUrl}>Embedded code in link</Copied>
<NewWindow href={urloUrl}>Open a new thread in the Rust user forum</NewWindow>
<Copied href={markdownSnippet}>Markdown snippet with all the information</Copied>
</Fragment>
);
};
Expand Down
2 changes: 1 addition & 1 deletion ui/frontend/selectors/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ const maybeOutput = (code: string, whenPresent: (_: string) => void) => {
if (val.length !== 0) { whenPresent(code); }
};

const snippetSelector = createSelector(
export const snippetSelector = createSelector(
gistSelector, permalinkSelector,
(gist, permalink) => {
let snippet =
Expand Down

0 comments on commit f08ceb1

Please sign in to comment.