Commit Graph

23 Commits (master)

Author SHA1 Message Date
Amitai Schleier 9ea3f9dfe7 Catch up to highlight 4.0 API change.
In 4.0, searchDataDir() is gone, replaced by initSearchDirectories().
Call the latter if available, else fall back to the former.
2021-05-14 08:46:53 +02:00
Amitai Schleier 4d06df9583 Catch up to highlight 3.51 API change.
As of 3.51, searchFile() is no longer provided in highlight's Perl
bindings (at least on NetBSD and OS X, as built from pkgsrc). This
leaves us falling through to getConfDir(), which has been gone
rather longer.

From highlight git, it appears searchFile() and getFiletypesConfPath()
both originated in the 3.14 release. The latter is still available in
3.51, and returns the same result searchFile() used to. Switch to it.
2019-05-26 23:45:19 -04:00
Simon McVittie 317d19842c Silence "used only once: possible typo" warnings for variables that are part of modules' APIs 2016-01-19 11:24:18 +00:00
David Bremner adbc9cb8d6 Plugins::highlight: replace use of langdefdir with searchFile
In recent versions of highlight there can be more than one langdefdir.
This patch fixes the ensuing hilarity when the user adds a single
highlight lang definition and highlight.pm expects all definitions to
be in the same place.
2014-08-06 22:29:25 -03:00
David Bremner a55a20f5f8 cope with missing getConfDir in 3.18+ of highlight.
Unfortunately we have to try a couple things since the API changed
between 3.9 and 3.18
2014-08-06 22:28:32 -03:00
Joey Hess 480d6f93c1 highlight: Now adds a span with class highlight-<extension> around highlighted content, allowing for language-specific css styling. 2013-02-12 11:27:29 -04:00
Joey Hess 64e09f9968 cannot reproduce 2011-11-23 16:13:16 -04:00
Joey Hess 35b69392c8 Avoid warning message when generating setup file if highlight is not installed. Closes: #637606
There's a nice message if the plugin is loaded and used and highlight is
not available, and a nice fallback. So no need for this other warning,
which can happen any time all plugins are loaded to generate a setup file.
2011-09-05 13:21:56 -04:00
David Bremner ab511bb39c Update highlight plugin for highlight api.
Note that in particular calling initTheme with and empty file does not
work anymore.

use of initLanguage was replaced by loadLanguage, which seems to work
in both places.

I tried to make it a bit more robust against missing a highlight package.
There are lots of warnings, but it no longer crashes.
2010-12-29 13:05:20 -04:00
Joey Hess af5f162ca7 highlight: Support new format of filetypes.conf used by version 3.2 of the highlight package. 2010-11-20 12:55:26 -04:00
Joey Hess ac8aad2eca remove a last that won't work 2010-10-25 23:03:28 -04:00
Joey Hess 5c6eb167b8 highlight: Ensure that other, more-specific format plugins, like txt are used in preference to this one in case of ties. 2010-10-25 23:00:32 -04:00
Joey Hess 2076ed597c txt: Fix display when used inside a format directive.
txt's use of a format hook can't work in that case, so it needs to use a
htmlizeformat hook in this case to handle wrapping the text in pre tags.
2010-10-25 22:37:34 -04:00
Joey Hess 7ab84dcfe5 highlight: Make location of highlight's files configurable in setup file to allow for nonstandard installations. 2010-08-30 13:15:49 -04:00
Joey Hess 068e47aa45 catch failure to open the filetypes file 2010-02-24 20:28:52 -05:00
Joey Hess 9cee2962e0 format plugin categorization 2010-02-12 01:10:36 -05:00
Joey Hess feae031a80 highlight: Fix utf-8 encoding bug. Closes: #535028 2009-07-07 16:31:18 -04:00
Joey Hess 96087cbd88 call initLanguage after initTheme
See #530654
2009-05-26 17:04:49 -04:00
Joey Hess 39e5e25000 cache highlighters to optimise
Setting up a new highlighter object is slightly expensive since it
reads and parses the langfile each time. So cache them.

This also speeds up ext2langfile by avoiding it needing to check for the
existence of a language file in some cases.
2009-05-23 18:39:49 -04:00
Joey Hess 8ba98ad1dc update 2009-05-23 05:33:08 -04:00
Joey Hess 47298b01c1 allow format to use any language supported by highlight
format: Provide a htmlizefallback hook that other plugins can use to
handle formats that are not suitable for general-purpose htmlize hooks.

highlight: Use the hook to allow formatting of any language/extension,
without it needing to be enabled for standalone source files.

highlight: If the highlight perl binding is not available, fallback
safely to a passthrough mode.
2009-05-23 05:17:26 -04:00
Joey Hess cdd1b58b38 remove commas in tohighlight list 2009-05-23 00:09:14 -04:00
Joey Hess 8ae260015f highlight: New plugin supporting syntax highlighting of pretty much anything.
* debian/control: Add suggests for libhighlight-perl, although
  that package is not yet created by Debian's highlight source package.
  (See #529869)
2009-05-22 22:57:03 -04:00