Skip to content

Allow configuring extra extensions as Markdown (e.g. .livemd) #1307

Closed

Description

@sgiath

Summary

Please add a way to treat additional file extensions as Markdown.

Livebook notebooks use .livemd. The content is normal Markdown (plus Livebook metadata), but Plannotator rejects them because the accepted-extension lists are hardcoded.

Current behavior

Annotate (/plannotator-annotate, plannotator annotate) only accepts the set in packages/core/annotatable.ts:

  • Markdown/plain: .md, .mdx, .txt
  • HTML: .html, .htm
  • Config/data: .yaml, .yml, .json, .jsonc, .json5, .toml, .ini, .cfg, .conf, .properties, .csv, .tsv, .log, .xml, .env.example

Plan write / plannotator_submit_plan is even narrower: only .md and .mdx (ALLOWED_PLAN_EXTENSIONS in apps/pi-extension/tool-scope.ts).

There is no config.json key, env var, or Pi plannotator.json setting that can add an extension. A .livemd file is rejected even though annotate already renders those files through the Markdown pipeline.

This is the same class of restriction as #1029 (annotate used to reject .yaml / .json / etc.). That issue expanded the hardcoded list. A config hook would cover the next .livemd / .mdc / .qmd without another allowlist PR each time.

Requested behavior

A persistent setting that maps extra extensions onto an existing treatment, at least:

{
  "markdownExtensions": [".livemd"]
}

.livemd (and any other listed extension) should then be accepted anywhere .md is accepted:

  • /plannotator-annotate notebook.livemd
  • folder annotate file browser
  • plan write / plannotator_submit_plan
  • frontmatter stripping (shouldStripFrontmatter)
  • relative / wiki-link navigation between sibling docs

I only need the annotate path for Livebook files. Including plan mode keeps the two allowlists from drifting.

Workaround today

ln -s notebook.livemd notebook.md

then annotate notebook.md. That works, but it is extra ceremony for a file that is already Markdown.

Environment

  • @plannotator/pi-extension 0.27.1
  • Agent: Pi / Oh My Pi
  • OS: Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions