Skip to main content
Ctrl+K

Manual

Your First TeachBook!

  • What is a TeachBook?
  • How can you do it?
  • It only takes 10 clicks!
  • You Know the Basics: What Next?

Getting Going!

  • User types
  • Collaboration tool: Git
    • Which git provider to choose
  • Install & authenticate required software
    • Editing text: VS Code
    • Git: GitHub Desktop / Git in VS Code
    • Managing code-related software: Anaconda
    • Combining Git Bash, VS Code and Conda
    • Build your book: JupyterBook
  • Collaborative book-editing
    • Assign task to yourself (milestones, issues)
    • Create your own version (branching, cloning, pulling)
    • Edit (merge conflicts, staging, committing, pushing)
    • Check changes online
    • Reviewing and combine versions (merge/pull request, merging)
  • Organize editing team, collaboration and visibility
  • Versioning and URLs
    • Publish version on separate (fixed) URLs
    • TeachBooks versioning with changelog
    • Publishing your book with a publisher
  • Copyright and Licenses checklist
    • Copyright Considerations
    • Licenses
    • Recommendations

Features

  • Overview
  • Original Jupyter Book and Sphinx Features
    • Anatomy of a Jupyter Book
    • Figures
    • Equations
    • Videos
    • References
    • Code
    • Code blocks that produce figures
    • Badges, Buttons & Icons
    • Banner or Announcement
  • Easy Editing Process
    • TeachBooks template
    • Draft-Release Workflow
    • Releasing book online
    • Build pull requests from forks
    • Local Server to view interactive elements locally
    • Sharing content between books in table of contents
      • (Deprecated) Share content between books using submodules
    • Auto-updating packages
    • TeachBooks Versioning
  • Additional functionality
    • Download link replacer
    • Multilingual book
    • Discussions in your book: Utterances
    • H5p interactive elements
      • Examples of H5p Quizzes
    • Interactive plots: plotly
    • Grasple
    • Interactive HTML/JavaScript elements
      • Adding interactive HTML/JavaScript elements
      • Creating basic interactive HTML/JavaScript elements
    • Interactive content: Run Python inside your book
      • Ipywidgets
      • Exercise checking using check-answer button
    • Interactive SVG images
    • JupyterQuiz
    • Iframes
    • PRIME applets
  • Book styling
    • Image Inverter
    • TU Delft theme
    • Rich hover over tips
    • APA References
    • Custom named colors
  • TeachBooks Student-view Features
    • Local Annotator Extension
    • Making comments on the website: Hypothesis

Examples

  • TeachBooks Examples
  • Well-Structured Book
  • Live Code (Sphinx Thebe)
  • Programming assignment with checks
  • Combining theory & interactive quizzes
  • Theory, interactive quizzes & live code
  • Coding theory, interactive quizzes & live code
  • Parametric questions

Editing Tools

  • Figure syntax maker
  • Scripts for automating workflow
    • Convert LaTeX to Markdown
    • Snippit
    • Extensionchecker, filedownloader and figreturner
    • Figshrinker

Miscallaneous

  • References
  • Credits and License
  • Changelog
  • Contact
  • Repository
  • Suggest edit
  • Open issue
  • .md

Download link replacer

Contents

  • 1. Disabling download
  • 2. Add/replace download link
    • 2.1. Installation
  • Contribute

Download link replacer#

This page reuses BSD 3-Clause License content from TeachBooks (2024). Find out more here.

User types

This section is useful for user type 4-5.

Sphinx Extension

You can control the download option of the book in two ways:

  • Disabling downloading using cell tags disable-download-page

  • Add / replace download link with custom link using sphinx-download-link-replacer

1. Disabling download#

If you add disable-download-page as a cell tag to a cell in a python notebook, the download button () will disappear from the topright corner. The cell tag can be added to any code cell in the notebook. This function might be handy if your page includes code which you don’t want the students to see. Be aware that this also removes the option to download a PDF of the page.

2. Add/replace download link#

The download link –> .ipynb can be replaced by using the following code in any markdown / notebook file:

```{custom_download_link} <link_target>
:text: "Custom text"
:replace_default: "True"
```

Replace <link_target> with the download location. It can either be a remote link (http, https, or ftp), or a local path (relative to the location of the file containing the directive). Local files must be located within or below the source folder of the book (i.e. the folder containing _config.yml).

The replace_default key is optional. When set to True, the default download link will be replaced with the custom one. When set to False, the default download link will be kept, and the custom one will be added below it. If the key is not set, the default behavior is to add the link to the list, without changing the default one.

The directive can appear multiple times in a single file.

A potential application of this functionality is when creating a page in which students have to do some coding. Downloading the page allows the student to save their work and work with their local environment. However, the original source file might include code (jupyterbook formatting, widgets, answers) which is not necessary for students. You can make a copy of the notebook file without these elements and replace the .ipynb link to this custom notebook file. Furthermore, you can add any additional data as an additional .zip file.

2.1. Installation#

To install the Download-Link-Replacer follow these steps:

Step 1: Install the Package

Install the download-link-replacer package using pip:

pip install download-link-replacer

Step 2: Add to requirements.txt

Make sure that the package is included in your project’s requirements.txt to track the dependency:

download-link-replacer

Step 3: Enable in _config.yml

In your _config.yml file, add the extension to the list of Sphinx extra extensions:

sphinx: 
    extra_extensions:
        - download-link-replacer

Contribute#

This tool’s repository is stored on GitHub. The README.md of the branch manual_docs is also part of the TeachBooks manual as a submodule. If you’d like to contribute, you can create a fork and open a pull request on the GitHub repository. To update the README.md shown in the TeachBooks manual, create a fork and open a merge request for the GitHub repository of the manual. If you intent to clone the manual including its submodules, clone using: git clone --recurse-submodulesgit@github.com:TeachBooks/manual.git.

previous

Additional functionality

next

Multilingual book

Contents
  • 1. Disabling download
  • 2. Add/replace download link
    • 2.1. Installation
  • Contribute

By TeachBooks Team, built with TeachBooks and Jupyter Book, CC BY 4.0

Last updated on June 1, 2025.