Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2021-01-05 07:50:24

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

A TextMate Textile bundle for Txp articles w/ iA Writer aesthetic

Has anyone ever created a Textile bundle for the ‘Mate? I guess bundle is the right word. It’s still the app I use (nearly as long as I’ve used Txp), as I don’t really need a code editor for much but CSS and the occasional HTML.

However, I would use TextMate a lot more for drafting Txp articles—instead of iA Writer (markdown only)—if I could create a Textile bundle that looks and behaves a lot like iA Writer for article drafts. That kind of usable words editor for Textile users is seriously missing in the market.

Anyway, if there was something I could piggy-back on, I might start there.

To be clear, I’m not trying to create a colorful theme for code. I want a grayscale UI that keeps regular text prominent, downplays (grays-out) Textile syntax, and treats Textiled elements visually as marked up (e.g. if I apply emphasis, the word is italicized, etc).

Can I even do that kind of thing in a bundle?

Last edited by Destry (2021-01-29 10:59:11)

Offline

#2 2021-01-05 08:33:15

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,135
Website

Re: A TextMate Textile bundle for Txp articles w/ iA Writer aesthetic

It’s been a while since I last used Textmate but there’s this tmbundle for textile syntax highlighting in Textmate and I guess you could then create/adapt a theme (plenty here to try) to get the styling look you want. It’s from 2010 so I don’t know whether it still works but Textmate hasn’t changed much over the years and textile only slightly.


TXP Builders – finely-crafted code, design and txp

Offline

#3 2021-01-05 08:38:37

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

Re: A TextMate Textile bundle for Txp articles w/ iA Writer aesthetic

That looks like a good place to start. Thank you.

Offline

#4 2021-01-05 09:52:24

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

Re: A TextMate Textile bundle for Txp articles w/ iA Writer aesthetic

I see CMS bundles in the TextMate bundles list in preferences, so now I’m thinking a Textpattern bundle is in order for Txp templates and tags, and get that submitted.

Last edited by Destry (2021-01-05 09:52:53)

Offline

#5 2021-01-05 10:30:52

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,135
Website

Re: A TextMate Textile bundle for Txp articles w/ iA Writer aesthetic

Destry wrote #328032:

I see CMS bundles in the TextMate bundles list in preferences, so now I’m thinking a Textpattern bundle is in order for Txp templates and tags, and get that submitted.

Many moons ago, there was one. Marios made it: See textpattern.org and this thread and this lengthy archive.org article.

Marios resurfaced late last year so he – or someone else here – may still have it somewhere. In fact he asked about a similar topic and reports that his bundle doesn’t work in Textmate2.


TXP Builders – finely-crafted code, design and txp

Offline

#6 2021-01-05 12:10:01

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,135
Website

Re: A TextMate Textile bundle for Txp articles w/ iA Writer aesthetic

My guess is that the textile and textpattern bundles are mostly concerned with defining syntax patterns to recognize in the code, and that a theme then governs how they look. So to get an iA-type look you also need to use / alter a theme.

BTW: just in case you don’t already know, the fonts that iAWriter uses are available here. I still preferred the Nitti / Nitti Grotesk combo they used to use, but it’s not free. The new ones are based on IBMPlex (incidentally by some of the same type designers) and iA has documented their evolution on their site.


TXP Builders – finely-crafted code, design and txp

Offline

#7 2021-01-05 12:24:30

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

Re: A TextMate Textile bundle for Txp articles w/ iA Writer aesthetic

Apparently the Bundles editor has been removed in TextMate 2, which is probably where these things were tweaked once upon a time.

Offline

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

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

Re: A TextMate Textile bundle for Txp articles w/ iA Writer aesthetic

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

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

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

Re: A TextMate Textile bundle for Txp articles w/ iA Writer aesthetic

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

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

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

Re: A TextMate Textile bundle for Txp articles w/ iA Writer aesthetic

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

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

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

Re: A TextMate Textile bundle for Txp articles w/ iA Writer aesthetic

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

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

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 10,282
Website GitHub

Re: A TextMate Textile bundle for Txp articles w/ iA Writer aesthetic

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

Online

Board footer

Powered by FluxBB