Working directory browser

Whether you are working on a Jupyter notebook or a Python script, Juno offers much more than just a code editor: it creates an entire workspace, where everything you may need is within easy reach. One of these things is access to the file system — and Juno lets you seamlessly navigate, view, and edit files in the working directory without leaving your document.

What is the working directory?
Change the working directory
Recapture the working directory
Grant access to the working directory
File browser in a slide over
Preview files
Text editor
Open documents

Overview

Both the notebook workspace and the Python source editor let you easily navigate your current working directory with a built-in working directory browser. When working on a document on an iPad in fullscreen, it’s displayed on the left.

Juno's notebook workspace

The file navigator you see on the left works just like any file browser: you can navigate the file system, copy, move, delete, and rename files and folders, and do other file management tasks. The key here is the location it lets you browse: it is the CWD (short for current working directory) of the document you are working on, i.e., a notebook or a Python script.

What is the working directory?

The working directory (or CWD) in Juno is the directory where all relative file system paths in your Python scripts begin. For example, you can read a .csv file into a Pandas DataFrame by either specifying the file’s absolute (full) path:

df = pd.read_csv('/Users/alice/Projects/Iris/iris.csv')

Or, if your document’s working directory is /Users/alice/Projects/Iris, you could simply use the file name:

df = pd.read_csv('iris.csv')

Relative paths are much easier to work with on iOS, where absolute paths are frequently changed by the system, and where you need to explicitly ask for permissions from the OS to access certain locations. And Juno makes working with paths relative to your working directory much easier by displaying its contents right next to your code.

File actions in the CWD browser

The browser lets you quickly get a relative path by long-pressing the file and selecting Copy Relative Path in the pop-up context menu — this will copy the path relative to your document’s CWD into the clipboard, which you can then use in your code to read file contents, for example.

You can read more about the concept of the working directory (also known as current working directory, or CWD) in our File system permissions and paths doc.

Back to top

Change the working directory

The working directory is a per-document setting, and by default, it is set to the file system location of your notebook or Python script. You can change it in the Ellipsis circle icon overflow menu by selecting Change Directory — Juno will remember this setting and will use the selected location as this document’s working directory every time you open it.

Back to top

Recapture the working directory

In some cases, Juno may show an option to recapture the working directory:

CWD browser with blurred content and action button to recapture working directory

This can happen if you have multiple Juno windows open, and more than one document is on screen and active. This is due to how the concept of the working directory works on the OS level: it is actually not a per-window setting under the hood, but rather a configuration of the entire process (or app in case of iOS and iPadOS). And although apps on iPadOS can have more than one window these days, they still operate within a single process. To make working with your notebooks and Python scripts more seamless on iOS, Juno dynamically changes its CWD to accommodate the document you are (most likely) working on at this very moment. So, if at some point it guesses wrong, you can explicitly “recapture” the CWD for the window from which it was “stolen”.

Back to top

Grant access to the working directory

When you open a notebook or a Python script for the first time, you would expect the CWD to be set to the directory the document is in — so that you can read files sitting next to it by only using their file names, for example. However, if you open a document outside of Juno’s on-device storage (e.g., in iCloud, or in another app’s folder), iOS will not let you access this directory by default — you need to explicitly grant access to it.

So if the notebook or Python script you open doesn’t already have a CWD that Juno can access, it will give you an option to select a working directory, suggesting the location of the document by default.

CWD browser with blurred content and action button to select working directory

Juno will remember the working directory for each of your notebooks and Python scripts, and will retain access permissions — which means you will only need to grant access to the document’s directory once, and Juno will take care of the rest from that point on.

Back to top

File browser in a slide over

CWD browser presented as a slide-over

You can toggle the working directory browser with the Working directory browser sidebar icon button, or swipe from the screen edge while the browser is hidden to reveal it as an overlay on top of the editor — great if you don’t need the CWD browser open all the time, and only need to peek at it occasionally (works on iPhone, too!).

Back to top

Preview files

CWD browser presenting a modal view with a file preview

The working directory browser comes with powerful file preview capabilities: you can view Jupyter notebooks with beautifully rendered previews, navigate through source code, JSON, XML, and other text-based formats with syntax highlighting, and view most other document types and media with the system’s Quick Look previews. When selecting a file, the browser will show a compact preview by default, which you can expand by selecting the Arrow up left and arrow down right icon button. The expanded preview will open in a bigger modal view, giving you more space and showing more file actions, like annotating an image, for example. Both compact and expanded previews let you view the file as text with the Doc plaintext icon button, which will open the file in the built-in text editor.

Back to top

Text editor

CWD browser presenting a built-in text editor

The working directory browser shows previews for text-based files by default, with an option to edit the file in a built-in text editor. Juno’s text editor packs a lot:

  • Syntax highlighting for popular formats (like Python source files, JSON, YAML, Markdown, XML, LaTeX, R, and others).
  • Powerful Find and Replace capabilities.
  • Configurable view options, like text size, line wrapping, invisible characters, tab width, and more.
  • Keyboard extension for easier access to keys you are likely to use often.
  • Customizable toolbar.

Back to top

Open documents

Selecting another Jupyter notebook or Python source file in your working directory browser can either open it in the same window, replacing the currently open document, or — if your device supports multiple windows — can create a new Juno window for this document. Juno will ask what to do the first time you try to open a notebook or a Python script, and you can adjust this behavior later in settings.

Back to top