@ 261105.1

260808.4.1 · 5ba030cac3c000feb2351ae65bb181ae3a294c1d

https://gitlab.com/saalen/highlight/-/work_items/224 added AnsiIndex theme attribute

Themes had no effect with --out-format=ansi, which emitted one hard coded sequence per element. A theme element may now carry AnsiIndex, a terminal palette index from 0 to 15, which is used for that element instead.

Elements without the attribute keep their previous sequence, so every shipped theme renders unchanged in this format. themes/terminal.theme shows the attribute in use.

reading declarations

Changes to src/include/ansigenerator.h. All files

src/include/ansigenerator.h

@@ -74,6 +74,11 @@ private:     std::string getOpenTag ( std::string_view font,                              std::string_view fgCol, std::string_view bgCol="" ); +    /** \return ANSI formatting sequences of the element's terminal colour index,+        or the given default sequence if the element defines no index */+    std::string getOpenTag ( const ElementStyle &elem,+                             std::string_view font, std::string_view fgCol );+     /** initialize tags in specific format according to colouring information provided in DocumentStyle */     void initOutputTags() override;