Skip to content

Commit f08ceb1

Browse files
committed
Add a button to copy markdown with playground information
1 parent 361fa21 commit f08ceb1

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

ui/frontend/Output/Gist.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,15 @@ const Links: React.SFC = () => {
5757
const gistUrl = useSelector((state: State) => state.output.gist.url);
5858
const permalink = useSelector(selectors.permalinkSelector);
5959
const urloUrl = useSelector(selectors.urloUrlSelector);
60+
const markdownSnippet = useSelector(selectors.snippetSelector);
6061

6162
return (
6263
<Fragment>
6364
<Copied href={permalink}>Permalink to the playground</Copied>
6465
<Copied href={gistUrl}>Direct link to the gist</Copied>
6566
<Copied href={codeUrl}>Embedded code in link</Copied>
6667
<NewWindow href={urloUrl}>Open a new thread in the Rust user forum</NewWindow>
68+
<Copied href={markdownSnippet}>Markdown snippet with all the information</Copied>
6769
</Fragment>
6870
);
6971
};

ui/frontend/selectors/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ const maybeOutput = (code: string, whenPresent: (_: string) => void) => {
194194
if (val.length !== 0) { whenPresent(code); }
195195
};
196196

197-
const snippetSelector = createSelector(
197+
export const snippetSelector = createSelector(
198198
gistSelector, permalinkSelector,
199199
(gist, permalink) => {
200200
let snippet =

0 commit comments

Comments
 (0)