D14236: Add some improvements to kate-syntax-highlighter for use in scripting

Laurent Cimon noreply at phabricator.kde.org
Thu Jul 19 23:07:42 BST 2018


xciml created this revision.
xciml added a reviewer: Framework: Syntax Highlighting.
xciml added a project: Framework: Syntax Highlighting.
Restricted Application added projects: Kate, Frameworks.
Restricted Application added a subscriber: kwrite-devel.
xciml requested review of this revision.

REVISION SUMMARY
  This patch aims at making the kate-syntax-highlighter tool independent of the filesystem for better use in pipelines.
  
  - A --stdin option was added to signify that the text stream comes from standard input instead of a file. If a source file is still provided, the program implicitly chooses that instead.
  
  This makes the tool usable in pipelines.
  
  - MIME types can now be used in the -s option
  
  This is useful for when the file name can't be trusted to give an appropriate type (it might be a hash), but the MIME type is provided by a protocol or database through which the file is accessed. This way translation to the program's syntax names doesn't have to be done outside of the program.
  
  - A -T/--title option was added to explicitly specify the HTML page's title. I arbitrarily chose "Kate Syntax Highlighter" as a default title from stdin streams and the default is unchanged for a specified source file.
  
  This is needed because now that a filename isn't guaranteed, it's hard to make a default title that's always appropriate. So just let the user specify it without having to rummage through it later to replace it.
  
  Other than these added features, behaviour does (should) not change.

REPOSITORY
  R216 Syntax Highlighting

REVISION DETAIL
  https://phabricator.kde.org/D14236

AFFECTED FILES
  src/cli/kate-syntax-highlighter.cpp
  src/lib/htmlhighlighter.cpp
  src/lib/htmlhighlighter.h
  src/lib/repository.cpp
  src/lib/repository.h

To: xciml, #framework_syntax_highlighting
Cc: kde-frameworks-devel, kwrite-devel, #framework_syntax_highlighting, michaelh, genethomas, kevinapavew, ngraham, bruns, demsking, cullmann, vkrause, sars, dhaumann
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwrite-devel/attachments/20180719/1125499d/attachment.html>


More information about the KWrite-Devel mailing list