Skip to content

Commit

Permalink
Add a link to download the notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathansick committed Apr 12, 2024
1 parent 2e55366 commit db24047
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export default function IpynbDownloadLink({ url, sourcePath }) {
// get the filename from the sourcePath
const filename = sourcePath.split('/').pop();

return (
<p>
<a href={url} download={filename}>
Download notebook
</a>
</p>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import useTimesSquarePage from '../../hooks/useTimesSquarePage';
import TimesSquareParameters from '../TimesSquareParameters';
import ExecStats from './ExecStats';
import GitHubEditLink from './GitHubEditLink';
import IpynbDownloadLink from './IpynbDownloadLink';

export default function TimesSquareGitHubPagePanel({}) {
const { publicRuntimeConfig } = getConfig();
Expand Down Expand Up @@ -46,6 +47,11 @@ export default function TimesSquareGitHubPagePanel({}) {

<TimesSquareParameters />

<IpynbDownloadLink
url={pageData.renderedIpynbUrl}
sourcePath={pageData.github.sourcePath}
/>

<ExecStats />
</div>
</PagePanelContainer>
Expand Down

0 comments on commit db24047

Please sign in to comment.