Giter Site home page Giter Site logo

andre-simon / highlight Goto Github PK

View Code? Open in Web Editor NEW
205.0 205.0 57.0 3.8 MB

Source code to formatted text converter

License: GNU General Public License v3.0

Makefile 2.36% C 0.31% Lua 44.37% C++ 48.73% QMake 0.17% Inno Setup 0.30% HTML 0.86% CSS 0.29% PHP 1.74% Perl 0.24% Python 0.20% Pascal 0.38% Batchfile 0.01% Shell 0.01% PureBasic 0.03% Tcl 0.02%
escape-sequences html latex rtf syntax-highlighting tex

highlight's People

Contributors

ahmedelgabri avatar andre-simon avatar cjmayo avatar gdsotirov avatar iamhammer avatar jaseemabid avatar jrtc27 avatar super7ramp avatar tajmone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

highlight's Issues

About Perl 6 support

Hi there,

What is the status of Perl 6 support in highlight package?
Is it planned?
Which file should I look into to see if I can do something?

Best,

tabBarAutoHide is a Qt 5.4 property

<property name="tabBarAutoHide">
<bool>false</bool>
</property>

In recently released Highlight 3.42, there is a modification of src/gui-qt/mainwindow.ui in 4a3788d, which sets tabBarAutoHide properly to false. However, tabBarAutoHide is a Qt 5.4 property. I found no mention in ChangeLog that GUI now requires Qt 5 and this is the only obstacle before compiling with Qt 4 (if I remove the properly from the UI file the GUI compiles perfectly well with Qt 4.8.7 on Slackware 14.2).
If this property is going to stay could it be made Qt 5 specific, so compilation with Qt 4 is still possible?

RFE: option for transparent background for when using --enclose-pre

I use the --enclose-pre option to copy highlighted code to the clipboard and for pasting into a single-cell table in Google Docs.

highlight \
  --style=edit-msvs2008 \
  --syntax=java \
  --inline-css \
  --fragment \
  --enclose-pre \
  --font-size=10 \
  --font='Courier New' \
  Sample.java \
  | xclip -sel c -t text/html

Works great. But if the background-color of the theme is different than the background color of the single-cell Google Doc table, the result isn't so good, Consider this case of the theme having a white background-color and the Google Doc table cell having a grey background color:

highlight-background-color-issue

So, some way to suppress the theme background-color would be helpful.

Line ranges?

Hi,

I have a scenario where, for performance reasons, it'd be nice to be able to color just a few lines of a file. This is possible with gnu's source-highlight via e.g. --line-range, but not (yet) with highlight.

Would it be possible to add that option/feature?

Help Needed Understanding "PreProcessor" Syntax Element

Ciao André,

I've just realized that in the template.lang I created for the "extras" folder I've forgot to cover the PreProcessor element! (it slipped through! I thought I had them all covered...)

Since I've already opened a pull request (PR #44) to update the template, it would be a right time to add the missing element; but I'll need to understand better how it works.

The documentation states:

PreProcessor = { Prefix, Continuation? }

  Prefix:        String, regular expression which describes open delimiter
  Continuation:  String, contains line continuation character (optional).

And the example I've found (I think from Python) is:

PreProcessor = {
  Prefix=[[#]],
  Continuation="\\",
}

How does this element actually work? Does the parser assume that from the Prefix match onward (until end of line) the Prefix and all that follows it is part of the PreProcessor element? (ie: like with single line comments)

And is the Continuation meant to be a RegEx that, if matched, will carry on over the next line the PreProcessor element? ie: it can occur only at the end of the line?

Sorry to bother you with this, but I've trouble coming to grips with this element. (haven't had a chance to use it so far!)

Language Definition 'Environments' or 'States'

Heya, man do I wish I found this repo a few months ago before I started the long battle of using source-highlight. I'm developing language syntax highlighting for biological data and one of the main features is adding syntax highlighting for data in a pager, like less.

I've written new language definitions files but I think I could port those over without too much problems. Highlight looks great. I just have a few questions about the highlight language definition files which I couldn't find a clear answer for.

  1. Is it possible to define something equivalent to source-highlight's environment or state in which new regex definitions can be defined within that state? And is it possible to nest these states?

I've essentially used such nesting to select columns of data by chaining on tabs. The GTF language file is probably the cleanest example of this.

  1. Is there a less pipe script or something similar to alias less to highlight | less? Something like source-highlight's lesspipe.sh

  2. For most High Performance Clusters, most users don't have sudo access. Is there a way to install highlight locally for users?

No Multi-Selection in "GUI -> Plug-ins - > Clear selection"

Unlike the "Files -> Clear selection" button, the "Plug-ins - > Clear selection" doesn't actually work with multiple selections — holding Ctrl or Shift while left-clicking doesn't add to items selection.

I guess it's because plug-ins entries are check-box controls and that's the way Qt handles them. Still, I though it worth opening an issue to see if there is a way to fix it and gain use consistency with other tabs in the same pane.

The pop-up tip for Clear selection says "Remove the selected plug-ins." — since multiple selections are not possible, this might lead to confusion between click-selection and check-boxes (which do allow multiple selections).

If the multi-selection can't be fixed, the tip text should be changed to singular: "Remove the selected plug-in."

A highlighting issue with Matlab files

There is an issue with Matlab files concerning the ambiguity of single quote. It can be an operator (to obtain the conjugate of a matrix), in addition to quoting string literals. It seems that the first usage is not recognized correctly.

Test file: highlight.m

a = ones(1, 2)';
fprintf(2, 'Hello!');

Expected: fprintf is highlighted as a function, and 'Hello' is a string literal.

Actual: fprintf is highlighted as part of a string.

screenshot from 2018-04-02 22-00-47

add an environment variable

A handy enhancement would be an environment variable for highlight to refer for run-time options. This way, for example, if one is using highlight in a script or in ~/.lessfilter (reference: man(1) lesspipe), one can easily change the colorization style to be applied.

Question on Compiling Highlight as Library on Windows

I've started issue on AsciiDoctor repo for adding support to Highlight in the Ruby implementation of AsciiDoc:

asciidoctor/asciidoctor#2096 (comment)

... it looks like the best solution would be to create a Ruby Gem using Highlight as a library.

In the documentation it mentions that Highlight can be built as a dynamic or static library. Is this an option only for Linux, or it can be done also for Windows? I couldn't workout how to get a makefile for compiling Highlight as a Windows library (I use GCC though, not MSVS).

Read from STDIN when given filename `-` for `less` compatibility

When using less with LESSOPEN=|-..., less will pass - as the filename when the input is from STDIN, eg in this case:

LESSOPEN='|-highlight --force -O truecolor --style aiseered "%s"

and using:

cat file | less

I see:

highlight: Could not read input file:
-

Currently I've worked around this issue with this wrapper script.

Could highlight read from STDIN if the single argument - is given for more less compatibility?

Ruby interpolation isn't working

Hi there.

It looks like Ruby interpolation isn't working.
This is a quick test with a file.rb with highlight version 3.43:

$ cat file.rb

"String with #{@interpolation}"

$ highlight -O html file.rb --style darkblue --inline-css
or:
$ highlight -O html file.rb --style darkblue --inline-css --src-lang=ruby

Output:

<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>file.rb</title>
</head>
<body style="background-color:#1c1c1c">
<pre style="color:#d0d0d0; background-color:#1c1c1c; font-size:10pt; font-family:'Courier New',monospace;"><span style="color:#ffffaf">&quot;String with #{&#64;interpolation}&quot;</span>
</pre>
</body>
</html>
<!--HTML generated by highlight 3.42, http://www.andre-simon.de/-->

Ie.:

image


But I'd expect something more like this:

image

Thank you.

Add Wiki to Repo

Could you add the Wiki to this repo, open to collaboration?

It could be used to create reference pages — not intended as a replacement of the official Wiki at www.andre-simon.de, which remains the official reference for Highlight; but it could offer pages on specific topics, links to related projects, ecc, to which anyone with a GitHub account can quickly drop a link or add contents.

Repo's Wiki

I would like to populate the Wiki of this repository with some notes I've been taking on the creation of lang defs, CSS themes, etc, so they can become tutorials/references for Highlight enduser and developers.

Do I have permission to reuse (cut & paste) material from Highlight documentation Wiki and the various README files from the source? ie: just paste and edit the text without explicitily mentioning its author, the source and changes in every page (unless really relevant).

I shall provide links to Highlight's website and Wiki in the main pages of this Wiki, and as links for further reading in each relevant section. But apart from this, my idea was to create new documentation built on top of the original one — which hopefully will grow in time through users contributions.

Feature request: possibility to paste into web WYSIWYG editors

Sometimes, I need to paste a formatted source code in a browser (usually some WYSIWYG editor, for example on visualstudio.com). But when I copy the code as an HTML using Copy preview to clipboard in Highlight and paste it in the browser, it pastes the HTML source code instead of the formatted text. That's not so surprising. But it wold be good to have such possibility.

I would say that it should be enough to just add one more format when copying into the clipboard - HTML Format.

Currently, Highlight copies the following clipboard formats on Windows:

  • DataObject
  • Unicode Text
  • Text
  • Ole Private Data
  • Locale
  • OEM Text

When I copy the formatted source code from some online code highlighter, I can paste it into a web WYSIWYG editor without any issues. The clipboard contains the following formats:

  • HTML Format
  • Unicode Text
  • Locale
  • Text
  • OEM Text

The Win API format ID for HTML Format is 49521.

Thank you.

graphviz dot file highlighting changes the input text

There seems to be a bug with graphviz dot files. A minimal example is as follows:

$ cat buggy.dot 
digraph { foo [label=bar]; }
$ highlight -O ansi buggy.dot 
digraph { foo [labelbar; }

Output has some colors but also missing some characters. I'm using version 3.18 with Ubuntu 16.04:

highlight version 3.18
Copyright (C) 2002-2013 Andre Simon <andre.simon1 at gmx.de>

Argparser class
Copyright (C) 2006-2008 Antonio Diaz Diaz <ant_diaz at teleline.es>

Artistic Style Classes (2.04)
Copyright (C) 2006-2013 by Jim Pattee <jimp03 at email.com>
Copyright (C) 1998-2002 by Tal Davidson

Diluculum Lua wrapper (1.0)
Copyright (C) 2005-2013 by Leandro Motta Barros

xterm 256 color matching functions
Copyright (C) 2006 Wolfgang Frisch <wf at frexx.de>

This software is released under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.

I couldn't try with the latest git version as I think I'm missing some dependencies for compilation.

vim2theme

I see a comment on many themes "generated by vim2theme"

Where can I find such a tool in order to generate my own themes?

feature request/question: LaTeX export: newline instead of \\?

The LaTeX export generates \\ for a newline. This works fine except for the beamer-article class.

I am using highlight to include source code snippets into beamer slides. Beamer knows to classes: the beamer class for presentations and beamer-article for hand outs. The beamer-article class somehow redefines \\ which removes the newlines in the output, i.e. the source code has no line breaks.

The problem is elaborated here: https://tex.stackexchange.com/questions/43857/beamerarticle-and
Here several options are discussed. My experience is that a simple newline (emtpy line) solves the problem best.

Maybe it is possible to replace the \\ at the end of a line with an empty newline.

HL GUI Feature Request: Allow Custom Lang/Theme

It would be nice if Highlight GUI would allow to chose a custom langDef and/or theme (from outside HL setup folder) for testing custom language definitions and themes. The selected langDef should override any existing langDef registered for that extension.

Maybe a new "Overrides" tab could be added on the top (next to "File") with a file selector and checkbox for langDef and for theme.

Some Default LangDef Definitions Don't Show-up in Verbose Debugging

Hi Andre,

it came up in a previous issue that some default values for language definitions don't show up when debugging with verbose:

I've tried defining Escape as an empty string, but this caused bad parsing behavior. It seems that
Highlight has some internal default definition of Escape string, but it doesn't show up in the --verbose output.

There is a default regex (will check why it is not displayed).

Today I was doing some tests with a bare-bone langDef (just Description and a Keywords entry) to actually check which elements have defaults and what these are. As it came out, the only visible defaults I can see via --versose are these two:

  • Digits (string = [ (?:0x|0X)[0-9a-fA-F]+|\d*[\.]?\d+(?:[eE][\-\+]\d+)?[lLuU]* ])
  • Identifiers (string = [ [a-zA-Z_]\w* ])

I somehow have the impression that the debug is not showing all the defaults --- Escape, as mentioned in the quote, but possibly others.

Also, boolean definitions don't show up (IgnoreCase, EnableIndentation, etc.). Are these hidden because false or null by default?

The documentation only mentions two default settings:

Global variables:

The following variables are available within a language definition:

HL_LANG_DIR: path of language definition directory (use with Lua dofile function)

Identifiers: Default regex for identifiers
Digits: Default regex for numbers

... so it might be correct. But, as mentioned in issue #23, even if I don't define Escapes Highlight seems to catch C-style escape sequences nonetheless (so I guess there is a hidden default string somewhere).

NOTE: This came up while I was working on PR #34

Escape Sequences False Positives

The Problem

I've just come across some false positives for escape sequences within strings. I've ecnountered it because PureBASIC language uses the \ to delimit structured variables:

SomeStr$ = ~"\nThis str contains escape-sequences: \v\""
SomeStructure\var1 = 20

... in the final HTML code, the \v in SomeStructure\var1 is treated as an escape sequence token (hl esc):

SomeStructure<span class="hl esc">\v</span>ar

Hackish Workaround

In my syntax theme I had to make some tweaks in order to ensure that only true escape sequence are actually styled:

.hl.str,
.hl.str + .hl.esc,
.hl.kwd {

... ie: the esc class is only styled when it follows directly a str classed span (this avoids styling structured vars that resemble escape sequences).

But the actual esc span is still there — so it's more a hack workaround than a real solution, and will only grant that the syntax is properly highlighted with my custom theme.

A real solution needs to emit the esc span only when the escape sequence is actually inside a string.

Possible Solutions

Shouldn't Highlight carry out some checks for escape sequences, to make sure they are actually found inside a string definition? After all, escape sequences should only occur in strings.

Questions

  1. If I don't define the strings » Escape regex (optional) does Highlight use a default internal regex definition, or does it mean that escape sequences are not parsed-for at all?

    (from documentation:)

     Strings = { Delimiter|DelimiterPairs={Open, Close, Raw?}, Escape?, Interpolation?,
     			RawPrefix? }
    
       Escape:         String, regex of escape sequences (optional)
    
  2. Is there a way to include some Lua code in the language definition to carry out some checks on the tokens, or is Lua code restricted to plugins only?

  3. Why the esc span is not nested inside the str span? Currently, when an escape sequence is found, the string span is closed and an escape span opened, then closed and a new string span opened. Wouldn't it make more sense to have the escape span nested inside a single string span? (I'm sure there is a reason for this behaviour, I'm just asking to understand its reasons!)

Haskell character literal not highlighing well

A double quote inside a Char literal causes all subsequent code to be highlighted as a string, e.g.:

main :: IO ()
main = putChar '"' -- this comment is highlighted as a string
-- and so is every line afterwards

(Github highlights that correctly)

Admittedly, Haskell is a bit weird in that it also allows a single quote inside idenfitiers, which might complicate correct highlighting.

help should list available syntaxes

I'm trying to highlight a anacron file. These files typically do not have a file extension. I don't know where to look for possible --syntax values.

--help should list available values for --syntax.

`HIGHLIGHT_DATADIR` Fails on Windows

I'm trying to force Highlight to use my custom lang def files instead of those that come with the installation. I'm using Windows 10 x64, and Highlight x64 (full installation).

Highlight is being invoked by a console app I'm working on. The app defines the env var HIGHLIGHT_DATADIR, pointing to a local folder (absolute path) which contains the following subfolders:

  • langDefs
  • plugins
  • themes

... but Highlight always ends up using the lang def from the installation folder.

NOTE: The app is working fine with Highlight. The only problem I'm facing is trying to use a custom data folder. The console app runs in Git Bash only (doesn't support Windows CMD because of some Bash commands it relies on); but this shouldn't affect Highlight's workings. Also, I've checked that the HIGHLIGHT_DATADIR env var is visible to Highlight at invocation time.

The README file states that:

Configuration scripts are searched in the following directories:

1. ~/.highlight/
2. value of the environment variable HIGHLIGHT_DATADIR
3. user defined directory set with --data-dir (deprecated option)
4. /usr/share/highlight/
5. /etc/highlight/ (location of filetypes.conf)
6. current working directory (fallback)

I'm not sure which are the Windows equivalents of some of those paths. But I've checked my user folders, and the only Highlight related folder I could find was C:\Users\MY_USER_NAME\AppData\Roaming\Highlight (which is empty).

From the CMD, I can see that Highlight is listed in the system PATH env var (C:\Program Files\Highlight) — could this be the reason why it's always reading the lang def from the install folder?

I've also tried using the --data-dir= option in my app's Highlight-invocation options ... same result!

Any advise on this?

Different coloring of Python decorators

Hi,

if you take code like this:

@ns.x()
def f1():
    pass

@ns.y
def f2():
    pass

@z()
def f3:
    f1()

You get different highlighting for x, y, and z. I think that’s not what you want.

x seems to be highlighted like a function call (→ looks like f1), y is not highlighted at all and z is highlighted like ns before.

I believe what you want here it to be them all highlighted like z?

To give you a real-life example, why this makes sense:

import environ

@environ.config(prefix="")
class AppConfig:
    @environ.config
    class Log:
        level = environ.var()
        format = environ.var()

    log = environ.group(Log)

With highlight, the first config (like function call) has a different color than the second (none). But they probably should have the same color as environ. :)

Add a Localization EN Template

I would like to localize the GUI to Italian. I have Qt Linguist (Qt4) installed and already used it with other Qt projects. Qt Linguist doesn't include the lupdate and lrelease tools.

Could you create an English template somewhere in the source so that it can be used as a base for localizing new languages without having to install the whole Qt Creator package (> 2Gb!). This would really help.

With a couple of Qt projects for which I maintain the Italian locale use this system and I've managed to create/update the locale files without resorting to external tools other than Qt Linguist.

OSX non-standard dependancy on lua

Installed the app on OSX and got an app crash with below details. Seems there is an app dependency on lua not by default available on OSX.

Installing lua using this command provides a work around.
$ brew install lua

Crash Dump

Process:               highlight-gui [64448]
Path:                  /Applications/highlight-gui.app/Contents/MacOS/highlight-gui
Identifier:            AS.highlight-gui
Version:               3.42 (3.42)
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           highlight-gui [64448]
User ID:               501

Date/Time:             2018-05-05 11:55:41.680 +0200
OS Version:            Mac OS X 10.12.6 (16G1314)
Report Version:        12
Anonymous UUID:        B7652ED6-D6CC-E6B6-411F-80566E47B78D

Sleep/Wake UUID:       32F1F639-E9DF-4F67-BF54-34C06B5CA027

Time Awake Since Boot: 270000 seconds
Time Since Wake:       9900 seconds

System Integrity Protection: enabled

Crashed Thread:        0

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Reason:    DYLD, [0x1] Library missing

Application Specific Information:
dyld: launch, loading dependent libraries

Dyld Error Message:
  Library not loaded: /usr/local/opt/lua/lib/liblua.5.3.dylib
  Referenced from: /Applications/highlight-gui.app/Contents/MacOS/highlight-gui
  Reason: image not found

Binary Images:
       0x109c8c000 -        0x10aad1ff7 +AS.highlight-gui (3.42 - 3.42) <627BEE21-E18C-392D-960D-201724C911A8> /Applications/highlight-gui.app/Contents/MacOS/highlight-gui
       0x112623000 -        0x112660dc7  dyld (433.5) <322C06B7-8878-311D-888C-C8FD2CA96FF3> /usr/lib/dyld

Model: MacBookPro13,3, BootROM MBP133.0242.B00, 4 processors, Intel Core i7, 2,7 GHz, 16 GB, SMC 2.38f7
Graphics: Intel HD Graphics 530, Intel HD Graphics 530, Built-In
Graphics: Radeon Pro 455, AMD Radeon Pro 455, PCIe, 2048 MB
Memory Module: BANK 0/DIMM0, 8 GB, LPDDR3, 2133 MHz, 0x80CE, 0x4B3445424533303445422D45474347202020
Memory Module: BANK 1/DIMM0, 8 GB, LPDDR3, 2133 MHz, 0x80CE, 0x4B3445424533303445422D45474347202020
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x15A), Broadcom BCM43xx 1.0 (7.21.171.133.1a2)
Bluetooth: Version 5.0.5f1, 3 services, 27 devices, 1 incoming serial ports
Network Service: Wi-Fi, AirPort, en0
USB Device: USB 3.0 Bus
USB Device: iBridge
Thunderbolt Bus: MacBook Pro, Apple Inc., 22.1
Thunderbolt Bus: MacBook Pro, Apple Inc., 22.1

Change HTML Anchors to IDs (Named Anchors Aren't Valid HTML5)

Currently, the --anchors options attaches a name attribute to <a> tags in linenumbers:

<a name="l_4"></a><span class="hl lin">  4 </span>  <span class="hl kwb">INC</span>

In HTML5 named anchors are not valid tags:

Differences Between HTML 4.01 and HTML5

In HTML 4.01, the tag could be either a hyperlink or an anchor. In HTML5, the tag is always a hyperlink, but if it has no href attribute, it is only a placeholder for a hyperlink.

HTML5 has some new attributes, and some HTML 4.01 attributes are no longer supported.

--- https://www.w3schools.com/tags/tag_a.asp

The <a> name attribute is not supported in HTML5. Use the id attribute instead.

--- https://www.w3schools.com/tags/att_a_name.asp

Highlight should drop the <a name=""> tag in favour of placing an Identifier directly on the line-number span (hl lin):

<span class="hl lin" id="l_4">  4 </span>  <span class="hl kwb">INC</span>

... or at least it should offer this alternative for HTML5-specific output --- it seems to me that using a <span id=""> would be valid also in HTML4:

-- https://www.quackit.com/html/html_4/tags/html_span_tag.cfm

But if for some backward compatiblity reasons (or to preserve output consistency in existing projects) the current line-numbers anchoring system should be preserved, it might be worth considering an additional option to target HTML5 specifically --- the introduction of this switch might also be a chance to introduce a more HTML5 compliant way of wrapping code blocks with <pre><code> tags (plus attributes targetting computer languages).

But for the <pre><code> tags problem, the --fragment options offers a workround. Not so for the line-numbers anchoring system, on which the users doesn't have much control (except, maybe, via some custom plugin).

HTML4 is becoming obsolete, and I think that Highlight should target valid HTML5 output via it's default options, so that its usage within projects should not affect the validity of their HTML5 syntax.

With the recent update to v2.0, pandoc changed the way it syntax highlights code in HTML (line numbers were previously achieved via tables, now dropped in favour of divs and spans with Ids), to catch up with HTML5 standards. Maybe pandoc could be a good reference point on how (X)HTML code should be formatted, as much thought and discussion as been going on during the last year regarding which HTML5 tags and attributes should be used for syntax highlighting code blocks. Of course, this forced pandoc to bump it's major version to 2.0, effectively marking a point bracking backward compatibilty --- but not doing so was causing more trouble to HTML5 complaint projects than updating existing scripts and templates.

For Highlight the case shouldn't be one of breaking backward compatiblity, if a new HTML5 format is added on top of the current HTML(4). But introducing this new format might require some careful thoughts, so that it's implemented at once with all it's requirements, or either gradually (as an experimental feature) and gets fine-tuned through actual usage and feedback.

Of course, changing the way line-numbering is achieved might have repercussions on CSS themes (but these could also comply to a new HTML5 option accordingly). The same could be said for standalone HTML5 documents, which could benefit from a newer HTML5 complaiant template.

Needless to say, I'm willing to contribute on this front.

background color is ignored for "console" output

From what I understand, all "console" output formats (ansii, xterm256, truecolor) ignore Canvas set in theme. As a result, the background colour isn't set, default terminal's background is used, rendering some of the themes unreadable.

Compare truecolor
console
and html
html
output for breeze theme.

How feasible would it be to use background color for at least truecolor? It'd most likely require padding things with spaces, to avoid original background from leaking through. Not sure what are the other downsides; chances are you've already tried that and decided against this. :)

Thanks!

Compile error

Compiling on debian stretch results in the following error:

g++ -Wall -O2 -DNDEBUG -std=c++11 -c -I ./include/ ./core/xhtmlgenerator.cpp
In file included from ./include/codegenerator.h:37:0,
from ./include/htmlgenerator.h:34,
from ./include/xhtmlgenerator.h:32,
from ./core/xhtmlgenerator.cpp:27:
./include/syntaxreader.h:39:49: fatal error: boost/xpressive/xpressive_dynamic.hpp: No such file or directory
#include <boost/xpressive/xpressive_dynamic.hpp>
^
compilation terminated.

HL v3.43 x64 Installer: Problems with Windows 10

When I try to launch Highlight 3.43 (x64) installer on Win 10 I get a security warning and it gets blocked by Windows Defender SmartScreen. It says it's an unreckognized app and that it poses a threat.

This never happened before with other installers. Signature problems?

Add JSON Interface for Themes

A command line option to export a theme as JSON data: this would allow third party tools to extract theme information in an agnostic format and operate transformations on it. Some possible usage examples:

  • customize the CSS to bind a theme to a specific lang syntax, to achieve different theming for each language in a same document.
  • gain finer control over the actual styling.
  • transform a theme to other formats (non html).
  • export theme to other highlighters (including editors).

Implementing this feature in the other direction too — ie: import a theme from JSON data — might also be useful. Some examples:

  • conversion of themes from other highlighters.
  • dynamic creation of theme.

Working out a JSON schema for themes shouldn't be a problem. Either the themes variables names or the tokens class names could be used; colors could be in six digits hex, and formatting options as literal strings (bold, italic, etc.).

What you think about this feature?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.