Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/xwmx/nb/llms.txt

Use this file to discover all available pages before exploring further.

nb treats your notebook as a general-purpose file container, not just a home for Markdown text. You can pull in images, PDFs, Office documents, videos, audio files, and entire browser bookmark collections with a single command. When you need to share a note externally, nb export can write it out as-is or hand it to Pandoc for conversion to virtually any document format — all without leaving the terminal.

Importing Files

Use nb import (shortcut: nb i) to copy files into the current notebook:
# import an image file
nb import ~/Pictures/example.png

# import a Word document
nb import ~/Documents/example.docx

# open the imported file in your system's default application
nb open example.docx

Importing Multiple Files

Multiple filenames and glob patterns are supported in a single command:
# import all files and directories in the current directory
nb import ./*

# import all markdown files in the current directory
nb import ./*.md

# import two specific files
nb import example.md sample.md

Importing from a URL

nb import can download and import files directly from the web:
# import a PDF from the web
nb import https://example.com/example.pdf
# Imported "https://example.com/example.pdf" to "example.pdf"

# open the downloaded PDF in your system's PDF viewer
nb open example.pdf

Copy vs Move

By default, nb import copies files into the notebook and leaves the originals in place. Use the explicit subcommands to control this behavior:
# explicitly copy a file (leaves the original intact)
nb import copy ~/Documents/example.docx

# move a file (removes the original after import)
nb import move ~/Documents/example.docx

Importing Bookmarks from a Browser

Bookmark files exported from Chrome, Firefox, and Edge can be imported with nb import bookmarks. nb creates one .bookmark.md file for each URL in the export:
nb import bookmarks ~/Downloads/bookmarks_export.html

Converting on Import

Pass --convert to have nb convert imported HTML content to Markdown during import. This is useful for pulling a downloaded web page or HTML file into your Markdown-based workflow:
nb import https://example.com/article.html --convert
--convert converts HTML content to Markdown. It does not convert other formats such as DOCX. Pandoc must be installed.

File Type Indicators

Imported files are shown with emoji indicators in the notebook list so you can identify them at a glance:
 nb
home
----
[6] 📖 example-ebook.epub
[5] 🌄 example-picture.png
[4] 📄 example-document.docx
[3] 📹 example-video.mp4
[2] 🔉 example-audio.mp3
[1] 📂 Example Folder

Importing Notebooks

An entire local folder or notebook can be imported to make it a global nb notebook:
# import a local notebook or folder and register it globally
nb import notebook ../path/to/notebook
This is an alias for nb notebooks import.

Exporting Files

Use nb export to write a note or file out of the notebook to a destination path. When the destination path has a different file extension than the source, nb automatically invokes Pandoc to convert the file:
# export a Markdown note to a .docx Microsoft Office Word document
nb export example.md /path/to/example.docx

# export a note titled "Movies" to an HTML web page
nb export Movies /path/to/example.html

# export an Org file
nb export example.org /path/to/example.org

# export note 12 in the "sample" notebook to HTML
nb export sample:12 /path/to/example.html

Exporting with Full Pandoc Control

For fine-grained control over Pandoc options, use the nb export pandoc subcommand. It passes all additional arguments directly to Pandoc and prints to standard output by default:
# export note 42 as an epub with custom pandoc options
nb export pandoc 42 --from markdown_strict --to epub -o path/to/example.epub

# export a Markdown note to HTML and print to standard output
nb export pandoc example.md --from=markdown_strict --to=html

Supported Output Formats

Because nb export delegates conversion to Pandoc, any format that Pandoc supports is available. Common targets include:

DOCX

Microsoft Word — great for sharing with collaborators.

PDF

Portable document — requires a LaTeX engine or wkhtmltopdf.

HTML

Web page output suitable for publishing.

ePub

E-book format for readers and distribution.

ODT

OpenDocument Text for LibreOffice and OpenOffice.

RTF / LaTeX

Rich Text Format or raw LaTeX source.

Exporting a Whole Notebook

Export an entire notebook to a directory on disk:
# export the global notebook named "example" to a destination directory
nb export notebook example ../path/to/destination
This is an alias for nb notebooks export.

Exporting via the Browser Interface

Items can also be exported through nb browse. Open any item page in the terminal or GUI browser and use the down-arrow () download link to save the original file:
 nb browse 123
❯nb · home : 123 · | +

    example.pdf

Typical Import Workflow

1

Locate the file you want to import

Find the file on disk or identify the URL you want to pull in.
2

Import into your notebook

# import from disk
nb import ~/Documents/research-notes.docx

# or import from the web
nb import https://example.com/paper.pdf
3

Verify the import

nb ls
The imported file appears in the list with its type indicator.
4

Open or edit the file

# open in your system's default application
nb open research-notes.docx

# or edit in your terminal editor (for text-based files)
nb edit research-notes.docx
5

Export when ready to share

nb export research-notes.docx ~/Desktop/research-notes-final.pdf

Build docs developers (and LLMs) love