Open in Editor command should open the single text.whatever file in a Textbundle.
// Please enter a detailed description of the issue // Description of the issue: While previewing a Textbundle file, which is actually a folder, pressing command+e or clicking Open in Editor to invoke the predefined text editor does nothing. However, because there’s only one markdown file in the folder of the Textbundle file according to the spec, Marked should point to this file to make it be edited by the text editor.
// Please enter a list of steps required to reproduce the issue // Steps to reproduce:
- Open/Preview a Textbundle file by Marked 2.
- Press command+e or click File — Open in Editor.
- Nothing happens.
// If applicable please attach a sample document that causes the issue for you. Please use the example files in http://textbundle.org .
// Configuration (do not edit) Marked 2 1031 (Direct)
macOS Version: 12.4
folderPreviewExtensionsArray: md, markdown, txt, mdown, html, opml
printHeaderBottomRight: %page / %total
- example-bundle-v2.zip 6.6 KB
|?||Show this help|
|ESC||Blurs the current field|
|r||Focus the comment reply box|
|^ + ↩||Submit the comment|
You can use
Command ⌘ instead of
Control ^ on Mac
Support Staff 1 Posted by Brett on 19 Jul, 2022 03:51 PM
The issues are:
Marked works with both TextBundle and Textpack (compressed TextBundle). When working with the compressed version, the Markdown file only exists in memory, not on disk where it can be opened by another app.
Modifying just the Markdown of textbundle outside of the creating app is possible, but the point of the TextBundle is to allow additional structured data to be stored next to the Markdown. Extracting and editing just the Markdown could lead to the data and the text getting out of sync. Granted, no app that has implemented textbundle thus far has made much use of that capability, but I'd hate to break compatibility.
If you have a default handler for the TextBundle/TextPack extension, I think Marked should open the entire bundle in that editor automatically. I actually don't have any TextBundle-capable apps on the machine I'm on at the moment so I can't confirm.
2 Posted by Xell on 21 Jul, 2022 10:01 AM
Thank you for the reply.
As for the first part of editing the text file inside a textbundle, I appreciate your opinion. However, I have a special case that I use Vim as the external editor. I think Marked 2 shoud give the path of the textbundle file, i.e. a directory, to Vim, which can handle it properly by its NERD tree, instead of doing nothing. In short, it’d be better that Marked 2 pass the directory path (including the filename of the textbundle file) to the “Text Editor” defined in the Preferences / App and let the app to decide what to do next.
As for the second part about the “default handler”. I tried several apps such as Panda  and MWeb  and still nothing happens, desipte that I’ve set up the app as the default one both in the Open With of Info panel of Finder and in the Marked 2.
 https://bear.app/alpha/  https://www.mweb.im
Support Staff 3 Posted by Brett on 21 Jul, 2022 11:21 AM
The other issue is that if the textbundle's "transient" key is set to true, Marked has to respect that it's a transport file and not available for direct editing. I think that key is being misused by a lot of implementations, but I hesitate to ignore it.
Because of the complications of dealing with textpack files and the fact that I can never reasonably predict that a user's preferred editor can handle opening directories, I don't see this being a feature I'm going to implement any time soon. I may (eventually) add an additional default editor specifically for textbundles, in which case I'd have a little more predictability in behavior.
4 Posted by Xell on 22 Jul, 2022 12:17 PM
It's a good idea to separate editors for textbundles and normal markdowns in the Marked 2. Hope to see more solid support for textbundle in the future. Thanks.