Does syntax highlighting exist as a feature?

I’ve filed 160360 – Syntax Highlighting for Markdown, and see 43089 – Syntax highlighting for Math requesting it for another language. However, does LibreOffice (#Writer) support syntax highlighting whatsoever, currently?

There is an extension, I don’t know if it is what you need, Code Highlighter » Extensions

1 Like

@EarnestAl, that’s certainly useful if ever I need to produce some ODT, DOCX, or PDF documents with code snippet examples. However, it’s basically a custom textbox implementation, so it wouldn’t be of much use when editing .txt file derivatives (like .HTML or myriad others).

Automatic syntax highlighting does not exist per se but you can get an equivalent appearance with a set of character styles. Have you tried to design Reserved Word; Identifier, Function, Variable, … styles? Of course, this means manual style application which can be boring on long examples. However this is an approach fully under your control.

An automatic feature requires language identification (manual tag or assisted “guess”) and text parsing (which may be imperfect because snippet do not always contain all “declarations”). And the result is not guaranteed.

1 Like

I’ve filed 160362 – Syntax Highlighting Support because it appears not.

-1

It is NOT the scope of writer!
there are already a few extensions that provide syntax highlighting, so you don’t need a builtin feature!

2 Likes

@karolus, you’ve already stated that at 160362 – Syntax Highlighting Support, which is the more appropriate place to discuss this anyway. See 160362 – Syntax Highlighting Support.