Repository navigation
Mallorn Format and RStudio
Imladris introduces the .mallorn specification and bidirectional serializers to solve a fundamental problem in scientific publishing: creating a project format that is native to modern Linux and GNOME while preserving 100% byte-for-byte interoperability with RStudio (.Rproj) and Jupyter Notebook (.ipynb).
The .mallorn specification operates in two distinct modes:
graph LR
subgraph Mode1["1. Local Project Markers"]
A["<project>.mallorn"] <--> B["<project>.Rproj"]
style A fill:#4e9a06,stroke:#204a87,stroke-width:2px;
style B fill:#3465a4,stroke:#204a87,stroke-width:2px;
end
subgraph Mode2["2. Portable Self-Contained Archive"]
C["<project>.mallorn bundle"] --> D["Reproducible Unpack Engine"]
D --> E["Restores renv + .venv + notebooks"]
end
Inside any Imladris workspace folder, Imladris writes a <name>.mallorn file using RStudio's Debian Control File (DCF) key-value syntax alongside a synchronized <name>.Rproj manifest.
You can also create standalone RStudio .Rproj projects directly from File .Rproj)… (RprojDialog), configuring:
-
RestoreWorkspace(Yes/No/Default) -
SaveWorkspace(Yes/No/Default) -
AlwaysSaveHistory(Yes/No/Default) -
UseSpacesForTabandNumSpacesForTab(2,4,8) -
Encoding(UTF-8) -
RnwWeave(knitr/Sweave) andLaTeX(pdfLaTeX/XeLaTeX/LuaLaTeX) - Optional automatic
renvinitialization and Git repository scaffolding.
Version: 1.0
RestoreWorkspace: No
SaveWorkspace: No
AlwaysSaveHistory: Default
EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8
RnwWeave: knitr
LaTeX: pdfLaTeX
ImladrisVersion: 0.18.0
ImladrisProjectType: Sandboxed
ImladrisTarget: Quarto
ImladrisPythonEnv: .venv
ImladrisRenvActive: Yes
All keys prefixed with Imladris* are ignored by standard RStudio while providing extended workspace metadata to Imladris.
When sharing code with peer reviewers or colleagues, standard .zip files often fail because huge local folders (renv/library/, .venv/, .git/, .cache/) are either accidentally included or critical lockfiles are missed.
In the Ribbon under Publish
- Imladris gathers all notebooks (
.qmd,.Rmd,.ipynb), scripts (.R,.py), configuration files, and datasets. - It captures the exact dependency state in
renv.lockandrequirements.txt. - It strips non-portable binaries,
.venv/bin/, and local object caches. - It packages the workspace into a compressed
.mallorntarball (tar.zstwith high-ratio Zstandard compression).
Imladris provides lossless bidirectional serialization between Jupyter .ipynb JSON documents and the GtkSourceView editor buffer via NotebookSerializer:
Jupyter nbformat 4.5 Feature |
Imladris Representation & Preservation |
|---|---|
Code Cells ("cell_type": "code") |
Editable fenced code blocks ({python}`, {r}, ````{julia}) with language kernel routing. |
Markdown Cells ("cell_type": "markdown") |
Native Markdown prose blocks separated by cell boundaries. |
Raw Cells ("cell_type": "raw") |
Preserved losslessly as ```{raw} blocks and restored to "cell_type": "raw" on save. |
Cell IDs ("id": "cell-abc123") |
Preserved across load/save cycles via <!-- imladris-cell: {"id": ...} --> metadata anchors; deterministic IDs generated if absent. |
| Execution Counts & Tags |
execution_count and metadata.tags (such as parameters, hide-input) round-trip without loss. |
| Kernel Metadata | Supports Python (python3), R (ir), and Julia (julia-1.10) kernelspec and language_info headers. |
Shift+Enter Cell Workflow |
Executes the current cell via ChunkExecutionEngine and automatically advances the cursor to the next code cell (or inserts a new cell at the end of the notebook). |
In addition to .mallorn bundles, the Publish ribbon includes direct export bridges:
-
Export for RStudio: Generates a clean RStudio project bundle with
.Rproj,renv/activate.R,.Rprofile, and a standardizedrun_all.Rharness. -
Export for Jupyter Notebook: Exports workspace notebooks along with
environment.yml,requirements.txt, and an automated virtual environment bootstrap script.
Imladris IDE (v0.45.0) • Core licensed under Apache License 2.0 (Apache-2.0) (Hybrid Open-Core) • Built with Vala, GTK4, Libadwaita, WebKitGTK 6.0 & Papirus Icons (GPL-3.0-or-later).