Canvas Project Autofit

by Peng He
5
4
3
2
1
Score: 30/100

Description

Obsidian plugin: zoom canvases on open to fill viewport width (top-aligned).

Reviews

No reviews yet.

Stats

0
stars
302
downloads
0
forks
70
days
71
days
71
days
0
total PRs
0
open PRs
0
closed PRs
0
merged PRs
2
total issues
2
open issues
0
closed issues
1
commits

Latest Version

2 months ago

Changelog

Initial community release.

  • Auto-fit canvases on open to fill viewport width (top-aligned)
  • Configurable path prefix, width fraction, and top padding
  • Command: Fit canvas to width
  • Optional clickable external links in text cards

README file from

Github

Canvas Project Autofit

Zoom Obsidian canvases on open so content fills the viewport width, pinned to the top. Lower rows can stay off-screen — useful for tall project boards with many cards.

Features

  • Auto-fit when opening a canvas (configurable path prefix)
  • Width-first framing instead of Obsidian’s default “fit everything” zoom
  • Overrides canvas zoomToFit while the plugin is active
  • Command palette: Fit canvas to width
  • Optional: click text cards with external links to open them in the browser
  • Settings for path prefix, width fraction, and top padding

Installation

From Obsidian Community Plugins (after submission)

  1. Open Settings → Community plugins.
  2. Browse and search for Canvas Project Autofit.
  3. Install and enable.

Manual install

  1. Download main.js, manifest.json, and styles.css from the latest release.
  2. Create a folder canvas-project-autofit inside your vault’s .obsidian/plugins/.
  3. Copy the three files into that folder.
  4. Enable the plugin under Settings → Community plugins.

Usage

  1. Enable the plugin.
  2. Open a canvas (by default, only paths starting with Projects/ are auto-fitted).
  3. The view zooms so the board width fills the window; the top of the canvas stays visible.

Use the command Fit canvas to width to re-apply the framing on the active canvas.

Settings

Setting Default Description
Canvas path prefix Projects/ Limit auto-fit to canvases under this folder. Empty = all canvases.
Width fraction 1.0 How much of the board width to frame. Lower = more zoomed in.
Top padding 16 Pixels of space above content when framing.
Clickable external links on Open URLs from text cards with a single click.

Development

This plugin is written in plain JavaScript (main.js) for easy inspection and community review. No build step is required.

To develop locally:

  1. Clone this repository into .obsidian/plugins/canvas-project-autofit/ inside a test vault, or symlink it.
  2. Reload Obsidian (Settings → Community plugins → reload).

Submitting to the Community directory

This repository is structured for Obsidian Community plugin submission:

  • manifest.json at repo root (committed on default branch)
  • LICENSE (MIT)
  • README.md with usage instructions
  • GitHub release tagged 1.2.0 (no v prefix) with release assets: main.js, manifest.json, styles.css
  • versions.json maps plugin version → minimum Obsidian version

After publishing a release, sign in at community.obsidian.md, link GitHub, and submit the repository URL under Plugins → New plugin.

License

MIT — see LICENSE.