Fence File Export turns named code blocks into vault files

Preview named code blocks and write them to new files in your vault.

MIT · no telemetry · core features free

An export preview shows a Python file and a YAML configuration file.
Open larger
version
1.1.1
released
downloads
20
review
Passed
health
Excellent
license
MIT
listed for
Desktop, Mobile
obsidian
1.13.4 or later

The app tests ran on macOS with simulated Pro responses. Real mobile devices, Windows, Linux, sync conflicts and live paid sign-in were not tested.

Directory facts fetched from community.obsidian.md/users/theluckystrike.

About Fence File Export

You keep scripts or configuration in notes and need separate files you can inspect before creating them.

Keep your script and configuration in one note, then preview the files they would create. Fence File Export reads named code blocks and writes new files inside your vault.

Your source note stays unchanged. Existing targets are rejected, and a failed write can leave earlier files from the batch in place.

Free features

Named backtick and tilde fences

Add file="main.py" after the language on a fence that starts in column one. Backtick and tilde fences work; unnamed fences are skipped. The language label does not change the output.

The preview lists Python and YAML targets from named fences.
Open larger

Join blocks in note order

Blocks with the same target path become one file, in note order. Their bodies keep source line endings, with one extra newline between bodies. The plugin neither formats nor compiles your text.

Two code blocks appear together in one Python output preview.
Open larger

Review complete output

Inspect each accepted path and its complete text before creating files. Changing the folder or index option requires another preview. Reopen the window to include edits made after you opened it.

New files and parent folders

Choose a visible vault folder, and the plugin creates missing parent folders for your targets. Existing targets and parents that are files are rejected. The result lists completed and failed paths.

The export result lists two newly created files in the vault.
Open larger

Rejected blocks and paths

The preview reports nested, indented and incomplete named fences. It rejects traversal, absolute paths, backslashes, hidden components, reserved device names and the vault configuration folder. Separate valid targets can still be created.

The preview lists rejected paths beside one accepted output target.
Open larger

Free export accepts source notes up to 2 MiB and prepares up to 100 targets; profiles and the index require Pro.

Pro features

Pro costs $5 a month or $15 one time through GitHub Sponsors. One sponsorship turns on Pro in every plugin that has it.

Output folder profiles Pro

Save up to 20 named output folders in the export window. Saving the same name updates its folder; reopen the window to select a new profile. Saving and using profiles require Pro.

A saved folder profile sets the output folder to Release files.
Open larger

Export index Pro

Add export-index.md with relative Markdown links to the source note and output files. The index counts toward the 100-target limit and is omitted if an output fails. An existing index prevents creation at that path.

The exported index links to the source note and two output files.
Open larger

Set up Fence File Export

needs

  • Obsidian 1.13.4 or later

steps

  1. Open a Markdown note with a top-level named fence, such as a Python fence with file="main.py".

  2. Run Preview named code blocks from the command palette.

  3. Enter an output folder and review the target text and rejected blocks.

  4. Select Create new files, then read the completed and failed paths.

If the app can't find a new plugin yet, try again later. Obsidian says a plugin that passes the review shows in the app within 24 hours.

How to export code blocks as files in your Obsidian vault

Known limits of Fence File Export

  • Only top-level named fences are supported; nested, indented and incomplete named fences are rejected.
  • Source text is limited to 2 MiB in UTF-8, with at most 100 targets including an optional export index.
  • The preview keeps a source snapshot; reopen it to include a later note edit.
  • Existing targets are rejected, so exporting a changed version requires a new folder or manual management of prior files.
  • Failed writes can leave completed files and created parent folders in place.
  • An output failure omits the Pro export index, and an existing index conflicts with a later export.
  • Real mobile devices, Windows, Linux, sync conflicts and live paid GitHub sign-in were not tested.

Need a change for your team? I build custom Obsidian plugins and features.

Questions about Fence File Export

Will an export replace files I already have?

Existing targets are rejected. Choose a new folder or manage the previous outputs before exporting a changed version.

Can I change the note while the preview is open?

The window keeps the source snapshot read when you opened it. Close it and run the command again to include a later edit.

What happens if one write fails?

Completed files remain in place, and the result lists failed paths. Parent folders created before a failure can also remain.

What does Pro add?

Pro adds named folder profiles and an export index. It costs $5 a month or $15 once through GitHub Sponsors, with sign-in and sponsorship checks.

Network use

After you choose Sign in with GitHub, github.com receives device authorization and token polling requests using the public client ID and read:user scope. Then api.github.com receives an authenticated query for your sponsorship tier and total payments, with no vault data. Successful checks last 7 days, failed checks can retry after 6 hours, and Refresh requests an earlier check.

Read the full network disclosure

Questions or ideas?

Tell me what is broken in Fence File Export, or what it should do next.

Send feedback

Fence File Export 1.1.1, MIT license

MIT · no telemetry · core features free