Skip to content

feat: Add plaintext format detection#15

Merged
Yahiewi merged 3 commits into
notebook-link:mainfrom
Yahiewi:format-detection
Jun 3, 2026
Merged

feat: Add plaintext format detection#15
Yahiewi merged 3 commits into
notebook-link:mainfrom
Yahiewi:format-detection

Conversation

@Yahiewi

@Yahiewi Yahiewi commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

This PR adds format detection to the library which can be useful to automatically convert a plaintext file to a notebook without having to select what the format is each time.
This is especially useful for example in the Specta standalone app, which automatically converts files without prompting the user to choose the format. With these changes, Specta and other extensions can correctly convert plaintext files without format input from the user.

The main code changes are:

  • src/detect.ts (new): The main important function here is detectFormat(text, ext).
  • src/index.ts: exports new functions parseFormat and serializeFormat.
  • test/detect.test.ts (new): Tests different cases using the newly created functions.

@Yahiewi Yahiewi merged commit 90f6f7d into notebook-link:main Jun 3, 2026
2 checks passed
@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 1.8.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant