Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
54f23e3
Add download button for Jupyter notebooks in tutorial pages
Sep 18, 2025
ff55d5a
Refactor Quarto rendering and remove download notebook script
Sep 22, 2025
8dd8fbf
Merge branch 'main' into add_notebook_dl
AoifeHughes Sep 22, 2025
091e1a1
Update to Turing 0.40
mhauru Aug 13, 2025
fc4df94
Update version in _quarto.yml
mhauru Aug 13, 2025
df1f9cd
Fix DPPL 0.37 run_ad change
mhauru Aug 13, 2025
14973ad
Fix VI tutorial
mhauru Aug 20, 2025
06bb33d
Fix model-manual's use of contexts
mhauru Aug 21, 2025
e7519c9
Fix references to __context__
mhauru Aug 21, 2025
4530247
Fix use of addlogprob for log prior
mhauru Aug 21, 2025
57c3162
Fix typo
mhauru Sep 16, 2025
2065a14
Regenerate manifest
mhauru Sep 16, 2025
2babb2d
Remove version pin of DelayDiffEq and update Manifest
mhauru Sep 18, 2025
b41a4cb
Fix call to evaluate
mhauru Sep 18, 2025
425539d
Add note about contexts tutorial being out of date
mhauru Sep 19, 2025
dde0ed3
Apply suggestions from code review
mhauru Sep 22, 2025
a32ec1b
Add ipynb format support
Sep 24, 2025
1e7f351
maybe added links to dl?
Sep 24, 2025
e455881
Merge branch 'add_notebook_dl' of https://github.com/TuringLang/docs …
Sep 24, 2025
d1bacac
reset mainifest
Sep 24, 2025
a78fac4
dont execute ipynb
Sep 24, 2025
98bf999
bump local changes
Sep 25, 2025
60a07a8
Merge branch 'main' into add_notebook_dl
AoifeHughes Sep 26, 2025
af7ceb4
add post-render script for converting .quarto_ipynb files to .ipynb
Sep 26, 2025
4459016
Merge branch 'add_notebook_dl' of https://github.com/TuringLang/docs …
Sep 26, 2025
7f00453
Refactor notebook generation process and clean up tutorial metadata
Sep 29, 2025
708d22b
Merge branch 'main' into add_notebook_dl
AoifeHughes Sep 29, 2025
64c62a4
please work :(
Sep 29, 2025
1c6fad9
Merge branch 'add_notebook_dl' of github.com:TuringLang/docs into add…
Sep 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
sh assets/scripts/versions.sh

- name: Render Quarto site
run: quarto render
run: quarto render --to html,ipynb

- name: Rename original search index
run: mv _site/search.json _site/search_original.json
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ venv
site_libs
.DS_Store
index_files
digest.txt
digest.txt
**/*.quarto_ipynb
56 changes: 56 additions & 0 deletions _includes/download-notebook.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<script>
document.addEventListener('DOMContentLoaded', function() {
// Only add button if we're on a tutorial page
const path = window.location.pathname;
if (path.includes('/tutorials/') || path.includes('/usage/')) {
// Extract the notebook name from the URL
const pathParts = path.split('/');
const section = pathParts[pathParts.length - 2];

// Create download button
const downloadBtn = document.createElement('a');
downloadBtn.className = 'btn btn-primary download-notebook-btn';
downloadBtn.innerHTML = '<i class="bi bi-download"></i> Download as Notebook';

// Generate GitHub raw URL for the notebook
const baseUrl = 'https://raw.githubusercontent.com/TuringLang/docs/main';
const notebookPath = path.replace('.html', '.ipynb');
downloadBtn.href = baseUrl + notebookPath;
downloadBtn.download = section + '.ipynb';

// Insert button after title or in TOC area
const tocTitle = document.querySelector('.toc-title');
if (tocTitle) {
tocTitle.parentNode.insertBefore(downloadBtn, tocTitle.nextSibling);
} else {
const articleHeader = document.querySelector('header.quarto-title-block');
if (articleHeader) {
articleHeader.appendChild(downloadBtn);
}
}
}
});
</script>

<style>
.download-notebook-btn {
display: inline-block;
margin: 1rem 0;
padding: 0.5rem 1rem;
background-color: var(--bs-primary);
color: white;
text-decoration: none;
border-radius: 0.25rem;
font-size: 0.9rem;
}

.download-notebook-btn:hover {
background-color: var(--bs-primary-dark);
color: white;
text-decoration: none;
}

.download-notebook-btn i {
margin-right: 0.5rem;
}
</style>
6 changes: 6 additions & 0 deletions _quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ format:
toc-title: "Table of Contents"
code-fold: false
code-overflow: scroll
code-tools:
source: true
toggle: false
caption: none
downloads: [ipynb]
include-in-header:
- text: |
<style>
Expand All @@ -163,6 +168,7 @@ format:
text-decoration: underline;
}
</style>
- _includes/download-notebook.html
include-after-body:
- text: |
<footer class="custom-footer">
Expand Down
Loading