Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#21 2021-01-13 23:26:33

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

Re: Textile bundle/theme for TextMate

Destry wrote #328164:

That [mv] 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.

Then my (wild, yet educated) guess is that there’s some internal config file or mapping of names -> filenames inside TextMate. When you set it up in the app, it must create the file and keep a note of it so it’s linked to the name you give it. By renaming the file outside of TM, you perhaps broke the map link so it can’t find it.

Last edited by Bloke (2021-01-13 23:27:40)


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

#22 2021-01-15 19:33:45

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

Re: Textile bundle/theme for TextMate

The current Textile bundle in TextMate does not recognize bc., nor @code@, which is rather surprising.

Displayed (block) code

If I look in the Textile.plist file that defines the Textile, I don’t see these being defined.

The definition for bq. is defined at line 55.

My amateur guess to add a def for bc. would be to copy/paste that definition block, and edit lines 56, 62, 72, and 78 to:

  • <string>(^bc([&lt;&gt;=()]+)?)(\([^)]*\)|{[^}]*})*(\.)</string>
  • <string>entity.name.tag.blockcode.textile</string>
  • <string>entity.name.tag.blockcode.textile</string>
  • <string>markup.blockcode.textile</string>

Then I could target that fourth string, the scope, for style reasons in the Theme file.

Embedded (inline) code

For the embedded code syntax, @...@ , maybe do the same with the block for italic at line 446? Then change lines 456 and 458:

  • <string>(?:\b|\s)@((\([^)]*\)|{[^}]*}|\[[^]]+\]){0,3})(\S.*?\S|\S)@(?:\b|\s)</string>
  • <string>markup.code.textile</string>

Then I could target the second (the scope) with theme styles.
(I’m not sure what the <key>2</key> value is for at line 449, or if that should be different.)

Link syntax

The file accounts for links by targeting the URL part, and a different TextMate bundle targets the link text by recognizing it as a general string between quotation marks. But there is currently no way, that I can figure out, how to target just the "": punctuation alone. As it is, these are always foreground color, but I want to grey these out to lower the contrast from the link text.

Anyone know how that could be written as part of the Textile definition file.

Paired syntax

While the others are important, this one is not, but…

Similar to the link punctuation, it would be nice to be able to grey out the paired syntax punctuation on Textiled elements:

  • @...@
  • _..._
  • *...*
  • ^...^
  • etc

The idea is they would still live-react as expected, where relevant (be bold, be italic, etc), but the syntax part would just have less contrast (greyed out) while the actual text would have full foreground color.

Any ideas on that would be helpful.

What else?

I’m assuming in all of this that I don’t have to edit any other file in the Textile bundle to make the above changes work. As I understand it, once you define a syntax to recognize, then you can style it in the theme file by targeting the scope.

I haven’t actually tried any of this yet, but just thought I’d get some professional dev perspective before I bothered.

Last edited by Destry (2021-01-15 19:35:01)

Offline

#23 2021-01-16 18:25:18

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

Re: Textile bundle/theme for TextMate

Okay, the block and inline code mods worked as hypothesized, though the inline pattern needed to be:

<string>@((\([^)]*\)|{[^}]*}|\[[^]]+\]){0,3})(\S.*?\S|\S)@</string>

Instead of:

<string>(?:\b|\s)@((\([^)]*\)|{[^}]*}|\[[^]]+\]){0,3})(\S.*?\S|\S)@(?:\b|\s)</string>

Apparently (?:\b|\s) equals a blank space. Including it made the background style extend to the surrounding word spaces. Bad.

Anyway, a little closer. I won’t be able to figure out the link punctuation and paired syntax styling, though. That will take some pattern-fu I don’t know how to do.

Offline

Board footer

Powered by FluxBB