Friday, 15 August 2014

formatting - Does an Indesign syntax highlighter exist? -


Is anyone aware of a non-manual method of highlighting syntax highlighted in intensity?

I'm trying to show the code of a project in an indication documentation, but do not want to highlight the code manually, and also add well-ordered rows. Is it a plugin is?

This is the style in which I want to format the code. This style I would like to receive

Cheers

Not sure that you answered it, but there is no magic button that will solve your problem.

However, InDesign has a feature in every paragraph style named GREP that you can do as you like.

This is defined as 'regex' or 'regular expressions' which are just rules for applying the given character style. Yes, they look meaningful in the form of Harry Potter spells at first glance, but 2 or 3 simple regexes will find you a long way. For example:

  (\ & lt; | & lt;)! - \ s *. *? \ S * - (\ & gt; | & gt;)  

Will target HTML comments only.

  (? & Lt; = "). *? (? =")  

It will wrap anything directly in double quotes.

  (? & Lt; = \ (). *? (? = \))  

This will target any text in brackets () .

In an '@' GEEP style, try the symbol button, where you type reggae - which gives you a drop-down menu that is almost like the 'Regex Wizard'.

When you've got a works regex, make a new character style for the text color and select it in the 'apply style' input.

Good to test this stuff. Paste the sample of your code in the bottom panel and the rehex line at the top. The target of the bits will be blue.

There is a searchable community panel on the left where people have already written expressions like yours as you already have.

I am currently working with Javascript Highlighter.

Good luck.

It is a shame that there is no communal 'Indane style sharing library'.


No comments:

Post a Comment