Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#11 2021-01-05 12:38:32

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,662
Website

Re: Textile bundle/theme for TextMate

This, about TextMate Grammar, looks like it will be helpful. We’ll see.

= = = = =

Wow, that is a thoroughly enlightening article. Styling, it seems, is spread out over different standard bundles. And not documented at all, as that PhD points out.

So if I understand in a nutshell, to add a different presentation to the textile.tmbundle (which does not have its own theme, in fact; thus why I was looking around like a toddler for easter eggs), I either need to:

  1. Fork that repo (done), and figure out how to add an overriding theme to it?
  2. Figure out how to edit the relevant standard bundles as they exist in TextMate 2?

Something else?

Last edited by Destry (2021-01-05 12:54:02)

Offline

#12 2021-01-05 18:13:40

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,662
Website

Re: Textile bundle/theme for TextMate

Gah! The stupid Bundle Editor has moved in TM2, not removed, and the location has been staring me right in the face all day.

Last edited by Destry (2021-01-06 13:31:21)

Offline

#13 2021-01-13 14:33:25

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,662
Website

Re: Textile bundle/theme for TextMate

I had a rather slick iA Writer-like theme working in TextMate. Very exciting. Something I should have looked into years ago. It had a few things still needing worked out, though, not least of which was the managed Textile bundle in TextMate (which hasn’t been updated in years) does not seem to recognize the bc. tag (a biggie), and maybe one or two more I’ve not discovered yet, and that would suggest the language grammar for that bundle (and whatever other file or script components in relation) needs modernized/extended (topics for another post).

So, realizing I probably wanted more than just an iA Writer theme for the managed Textile bundle, I decided to reset application defaults (part of the learning process) and start over by creating a new ‘tWriter’ bundle for Textile instead, and add new light and dark Writer-like themes to that bundle specifically. I could then maybe put that up as a repository for people to have a better look at and help with (notably the extending code stuff).

In fact, it occurred to me, since Textile was one of Dean’s babies and it’s such an integral part of this project already, why not Textpattern owning a couple of new TM2 bundle repositories: one for core tags and .txp templates (like what Mario once had rolling), and one for Textile (web content writing); the latter maybe powered by php Textile instead of the RedCloth/Ruby textile that the current managed bundle does, if possible, though maybe that doesn’t matter in this case. But the bundles would be boons for anyone wanting to work with flat files instead of the Content panels, as well as working with Txp theme packages, I would think.

In any case, I will try my hand at the second bundle, if nothing else, even if I stick with redcloth and just mod the current grammar. But I’m taking baby steps in all this, documenting TM 2 as I go, mapping the terrain. Right now I’m just trying to get my head around how TextMate operates on the tree.

On that note, let me run some things by you as I understand them. Let it be known that TextMate’s (TM2) docs are deplorably bare and cryptic about any of this, and pretty much only exist in their TM 2 GitHub wiki at the moment; and like I said, there isn’t much there.

General Bundle Dev Best Practices

From what I gather, it’s better to create a new bundle based on a sourced (managed) bundle than it is to edit a managed bundle. To that end there are two paths to take, as I’ve found written about:

(A) Either way, new bundles (not managed by TextMate) are added to:

~/Library/Application Support/TextMate/Bundles/

TextMate puts custom bundles at that location to keep them separate from the bundles it manages from source. That way if/when TextMate is updated, or one of the managed bundles is, you don’t lose any custom work.

(B) Whereas bundles that are managed by TextMate appear at:

~/Library/Application Support/TextMate/Managed/Bundles/

But only the bundles that you have activated (via check boxes) in the client at TextMate > Preferences > Bundles will show up in the (B) location.

(C) Bonus mystery: There is a curious bundle called Avian.tmbundle that is often cryptically mentioned in various online resources. I’m under the impression (perhaps incorrectly) it’s important for something. But it does not show up in the managed bundles list in Preferences, yet it does appear in the Bundles Editor listing along with the bundles you have activated in preferences (the only bundles that appear there). It also appears inside the TextMate package on the tree, the only bundle that does:

/Applications/TextMate.app/Contents/SharedSupport/Bundles/

Questions so far…

If I try to look at the contents of a bundle (assuming they are directories), regardless which one or where, I get a ‘No such file or directory’ response, for example:

% ls ~/Library/Application\ Support/TextMate/Managed/Bundles
. . .
Textile.tmbundle
. . .
% ls Textile.tmbundle
ls: Textile.tmbundle: No such file or directory

So this makes me wonder:

  1. What is a bundle? A file, directory, other?
  2. How do I view a bundle’s contents outside of TextMate’s Bundles Editor? From their GitHub repositories only?

Current Situation

I created a new bundle test in TextMate using the Bundles Editor approach. When you do this, TextMate first creates it as an empty bundle named Yourname’s Bundle (e.g. ‘Destry’s Bundle’) and it’s found at (A) above.

Using the Bundles Editor, you can rename the new bundle. I renamed mine to ‘tWriter’. It now shows up in the Bundles Editor list of bundle options with that revised name, but it still appears at (A) as Destry???s Bundle.tmbundle.

That seems odd since I renamed the bundle in the editor. Not liking the name on disk very much, I try:

% cd ~/Library/Application\ Support/TextMate/Bundles/
% ls
Destry???s Bundle.tmbundle
% mv 'Destry???s Bundle.tmbundle' tWriter.tmbundle
mv: rename Destry???s Bundle.tmbundle to tWriter.tmbundle: No such file or directory

Either my command is structured wrong, or it’s not recognizing the bundle by the first name even though it’s the only bundle being listed in that location.

Are these symlinks, or something? Any clues what’s going on?

Exporting Bundles

I’ve seen mention of being able to export a custom bundle once it’s built in TextMate. But this might have been functionality in TM1 because I don’t see any such export utility anywhere. Then again, I’m not a developer and can’t read between the lines…

Does this mean that my new bundle should be pulled from the tree at (A)?

That would seem weird to me since I can’t even view the contents of the damn thing except from within the Bundles Editor. Mostly just looks like a bunch of Ruby scripts in the editor, called different things like commands, snippets, grammar, settings, theme… One thing I also know is important are the .plist files associated with these scripts, and these you cannot see in the Bundles Editor nor on the tree! But I do see them in the aforementioned Textile repo, for example. They look like/are XML files, and I think they call these ‘definition’ files.

How do a get a custom bundle started in TextMate to a repository on GitHub?

Last edited by Destry (2021-01-13 16:19:31)

Offline

#14 2021-01-13 15:08:44

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,662
Website

Re: Textile bundle/theme for TextMate

Destry wrote #328153:

Using the Bundles Editor, you can rename the new bundle. I renamed mine to ‘tWriter’. It now shows up in the Bundles Editor list of bundle options with that revised name, but it still appears at (A) as Destry???s Bundle.tmbundle.

Thinking about this workflow, as I recall what I did yesterday…

When you first create the bundle via the Bundles Editor, you get an empty bundle with that name as mentioned, but you have not yet actually saved it. It could be that I initially saved it like that then renamed it afterward, thus it only retains the initially saved name on disk, though not in the editor.

Another TM reset to defaults might be in order, I guess, to test that theory. You’d think they’d use a better default name than something with an apostrophe and space in it.

Offline

#15 2021-01-13 15:25:35

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,994
Website

Re: Textile bundle/theme for TextMate

Couple of file systems points:

% ls ~/Library/Application\ Support/TextMate/Managed/Bundles
. . .
Textile.tmbundle
. . .
% ls Textile.tmbundle
ls: Textile.tmbundle: No such file or directory

Will fail unless you cd ~/Library/Application\ Support/TextMate/Managed/Bundles first :)

For the one with renaming the entry with the weird characters in it, does it help if you do this:

cd ~/Library/Application\ Support/TextMate/Managed/Bundles
mv Destry[hit Tab to autocomplete the filename] tWriter.tmbundle

If there are odd characters in filenames, the Tab key normally helps me out by escaping anything on my behalf.

As far as exporting to a GitHub repo, if all the settings and doohicky are stored in that one file then simply setting up a bare Git repo somewhere, linking it to a repo on GitHub, and then copying that file into your local repo to then do the add/commit/push dance will publish it.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#16 2021-01-13 15:48:54

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,662
Website

Re: Textile bundle/theme for TextMate

Thanks, I will try these CL tricks. I’m not a jockey, admittedly.

Bloke wrote #328156:

As far as exporting to a GitHub repo, if all the settings and doohicky are stored in that one file then simply setting up a bare Git repo somewhere, linking it to a repo on GitHub, and then copying that file into your local repo to then do the add/commit/push dance will publish it.

It occurs to me maybe I’m coming at this the wrong way. If the managed Textile bundle is already on GitHub, maybe I fork/clone/checkout (probably fork, I guess) that one and work isolated there. Then download that code bundle and… Well then the question is, how to import it. ;)

Offline

#17 2021-01-13 16:02:44

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,994
Website

Re: Textile bundle/theme for TextMate

Destry wrote #328158:

If the managed Textile bundle is already on GitHub, maybe I fork/clone/checkout (probably fork, I guess) that one and work isolated there. Then download that code bundle and… Well then the question is, how to import it. ;)

Presumably copy the file out of your repo into ~/Library/Application\ Support/TextMate/Managed/Bundles and get TextMate to rescan for bundles (or restart the app so it sweeps that dir for changes?)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#18 2021-01-13 16:08:55

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,662
Website

Re: Textile bundle/theme for TextMate

Bloke wrote #328156:

Will fail unless you cd [to directory] first :)

% cd ~/Library/Application\ Support/TextMate/Managed/Bundles/Textile.tmbundle
% ls
Changes.json	Macros		README.mdown	Support		info.plist
Commands	Preferences	Snippets	Syntaxes

Woo-hoo!

If there are odd characters in filenames, the Tab key normally helps me out

% cd ~/Library/Application\ Support/TextMate/Bundles
% ls
Destry???s Bundle.tmbundle
% mv Destry’s\ Bundle.tmbundle tWriter
% ls
tWriter

Woo-hoo!

Thanks, Bloke!

The little things.

Offline

#19 2021-01-13 16:14:19

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,662
Website

Re: Textile bundle/theme for TextMate

Bloke wrote #328160:

Presumably copy the file out of your repo into ~/Library/Application\ Support/TextMate/Managed/Bundles and get TextMate to rescan for bundles (or restart the app so it sweeps that dir for changes?)

Yeah, that’s probably right. Though the path would be the other safe (non-managed) directory, I think:

~/Library/Application Support/TextMate/Bundles/

And then just a relaunch of the app.

Offline

#20 2021-01-13 22:53:44

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,662
Website

Re: Textile bundle/theme for TextMate

Destry wrote #328161:

% mv Destry’s\ Bundle.tmbundle tWriter

That didn’t turn out as expected. It made the name of the bundle disappear from the Bundles Editor list, even though it’s the same new name. No way to see or edit it inside the app now. Maybe my OS is too old, or maybe an empty bundle didn’t merit being acknowledged by the app. Not sure, but it makes it hard to work on the bundle via the editor. It also makes me think that initially creating bundles via the Bundles Editor is not the way to go after all; rather, I’ll try it using option 2, cloning an existing managed bundle.

Cloning has the advantage, if it proves to work, of getting all the dope in one quick shot to start with, rather than the tedious copy/paste dance of each bundle component at a time via the Bundles editor. Easier to remove and edit from there, in theory.

Back to the lab…

Offline

Board footer

Powered by FluxBB