Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download button for tutorials #48

Closed
TuanaCelik opened this issue Nov 7, 2022 · 7 comments · Fixed by #59
Closed

Download button for tutorials #48

TuanaCelik opened this issue Nov 7, 2022 · 7 comments · Fixed by #59
Assignees
Labels
enhancement New feature or request

Comments

@TuanaCelik
Copy link
Member

Tutorials have the following in the frontmatter:

---
layout: tutorial
colab: https://colab.research.google.com/github/deepset-ai/haystack-tutorials/blob/main/tutorials/01_Basic_QA_Pipeline.ipynb
toc: True
title: "Build Your First QA System"
last_updated: 2022-10-12
level: "beginner"
weight: 10
description: Get Started by creating a Retriever Reader pipeline.
category: "QA"
aliases: ['/tutorials/first-qa-system']
---

We would like to also have a 'download' button at the top too.

@masci - is it worth asking contributors to provide a download field in haystack-tutorials index.toml ? - I would imagine everything should be 'downloadable'? In which case we could just re-use the colab field URL to download the file?

@TuanaCelik TuanaCelik added the enhancement New feature or request label Nov 7, 2022
@carlosgauci
Copy link
Collaborator

It was added already, you just need to add the download key to the frontmatter, like the colab link.
dl-btn

@TuanaCelik
Copy link
Member Author

Hey @carlosgauci - Yes indeed, but from what I remember there was still some functionality to add no? When I click that button I got a json file in the browser. It didn't download the .ipynb file. Or am I doing something wrong?

@carlosgauci
Copy link
Collaborator

@TuanaCelik You're right I opened a PR: #49 to force downloads on the button. The files to be downloaded should be in the static directory though so I don't think you can re-use the same colab URL unless they provide a direct download link.

@TuanaCelik
Copy link
Member Author

Ah ok, so the .ipynb files won't be in the haystack-home repo. They're in haystack-tutoials. Any way we could have them downloaded from the git url to the file?

@carlosgauci
Copy link
Collaborator

I think the best way would be to modify the build script that @masci added, to also copy over the .ipynb files into static/downloads, then you can serve the downloads from there easily.

@TuanaCelik
Copy link
Member Author

Sounds good, wdyt @masci ?

@masci
Copy link
Member

masci commented Nov 14, 2022

Ok to include the notebooks in the Hugo build without checking them into the repo 👍

@TuanaCelik TuanaCelik linked a pull request Nov 24, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants