Monday, January 09, 2012
Syntax Highlighting Here
One of the reasons I took a long hiatus at this blog was because I learned how to do syntax highlighting in my posts and it was such a laborious process that I quickly tired of it because posting became such a daunting task.
But scripts are supposed to make daunting tasks more manageable, possibly even eliminating the daunt altogether. That's the first time I've ever used "daunt" as a noun like that. Probably not good English.
If you've ever looked at ESTK's preferences, you'll see that it offers about a million syntax highlighting controls. There's no way I want to duplicate that lot. My sights are set much lower. If I can highlight reserved words in blue, strings in red, and comments in green, I'll be happy.
The interesting thing is that I've already solved this problem in InDesign itself. When I want to showJS code in an InDesign document, I use a paragraph style with a bunch of GREP styles. I can't do that here, but perhaps I can use similar GREPs to get the right tags around the right text to achieve the desired effect.
And with that, the thought occurs that perhaps I can write a script that pulls the GREP search values out of the paragraph style so I don't have to maintain them in more than one place. Sounds like a fun project. Let's give it a shot.
More to come ...
Comments:
<< Home
Good to see you show up on my RSS feed again Dave.
Why not use SyntaxHighlighter for your posts, as detailed here?
Why not use SyntaxHighlighter for your posts, as detailed here?
Or why don't you use github.com gists? Have a look at this: https://gist.github.com/ you can embed them and keep them under version control.
Also nice to read something on you blog again.
Also nice to read something on you blog again.
Dave, I know it's been a while since you posted on your blog, but I just wanted to say every time your blog comes up on one of my Google searches about scripting Indesign, I'm glad you and this blog exist. Hope you are well, and thanks for all the great posts.
Dan Fitzpatrick
Post a Comment
Dan Fitzpatrick
<< Home