summaryrefslogtreecommitdiffstats
path: root/helpers/pygments.go
AgeCommit message (Collapse)Author
2017-10-14Add table linenos support for Chroma highlighterBjørn Erik Pedersen
Fixes #3915
2017-09-25Use Chroma as new default syntax highlighterBjørn Erik Pedersen
If you want to use Pygments, set `pygmentsUseClassic=true` in your site config. Fixes #3888
2017-06-13all: Update import paths to gohugoio/hugoBjørn Erik Pedersen
2017-02-17all: Refactor to nonglobal Viper, i18n etc.Bjørn Erik Pedersen
This is a final rewrite that removes all the global state in Hugo, which also enables the use if `t.Parallel` in tests. Updates #2701 Fixes #3016
2017-02-04all: Refactor to nonglobal file systemsBjørn Erik Pedersen
Updates #2701 Fixes #2951
2017-01-01Fix Appveyor Windows build and GitInfo path issue on WindowsDavid Kassa
2016-11-07commands, tpl: Get rid of repeating viper accessesAlbert Nigmatzianov
* all: Delete some blank lines * commands, tpl: Get rid of repeating viper accesses
2016-10-24all: Unify case of config variable namesAlbert Nigmatzianov
All config variables starts with low-case and uses camelCase. If there is abbreviation at the beginning of the name, the whole abbreviation will be written in low-case. If there is abbreviation at the end of the name, the whole abbreviation will be written in upper-case. For example, rssURI.
2016-10-06Whitelist startinline pygments optionKim Gressens
2016-04-10helpers: Ignore cache for Pygments when flag setRobert Basic
When the --ignoreCache flag is set to true, do not write and read the Pygments results to/from the cache directory. Fixes #2066 Closes #2068
2016-03-31Add readFile template funcBjørn Erik Pedersen
This also includes a refactor of the hugofs package and its usage. The motivation for that is: The Afero filesystems are brilliant. Hugo's way of adding a dozen of global variables for the different filesystems was a mistake. In readFile (and also in some other places in Hugo today) we need a way to restrict the access inside the working dir. We could use ioutil.ReadFile and implement the path checking, checking the base path and the dots ("..") etc. But it is obviously better to use an Afero BasePathFs combined witha ReadOnlyFs. We could create a use-once-filesystem and handle the initialization ourselves, but since this is also useful to others and the initialization depends on some other global state (which would mean to create a new file system on every invocation), we might as well do it properly and encapsulate the predefined set of filesystems. This change also leads the way, if needed, to encapsulate the file systems in a struct, making it possible to have several file system sets in action at once (parallel multilanguage site building? With Moore's law and all...) Fixes #1551
2016-03-19Return early from parseOptionsBjørn Erik Pedersen
2016-01-04added remaining relevant optionsBen Thomas
2016-01-04added more pygments optsBen Thomas
2015-12-07Fix copyright headers in source filesBjørn Erik Pedersen
Still need to add some missing headers and an AUTHORS file. See #1646
2015-11-23Change the license to Apache 2.0Steve Francia
2015-11-23Add PygmentsOptions optionAndrew Brampton
This allows default pygments settings to be used, if none are explictly set per shortcode. Fixes #1260
2015-10-15Insert code tag for server-side syntax highlightingNathan Youngman
Inserts a code tag into Pygments output with the language-info that is present when using client-side highlighting (useful for CSS hooks) ```html <code class="language-go" data-lang="go"> ``` closes #1490
2015-10-12Apply project wide go fmtBjørn Erik Pedersen
2015-07-08If no language is provided to Pygments, then try and guess itAndrew Brampton
Previously if no language was specified, then illegal args would be passed to pygments, for example `pygments -l -fhtml`, which would result in pygments printing an error.
2015-05-07Allow 'classprefix' pygments options.Andrew Gallant
2015-04-16Only write highlight to cache when CacheDir is setbep
To avoid writing cache files when testing.
2015-04-15Add more options to highlightbep
Fixes #1021
2015-04-14Fix potential Windows path issue with Pygments cachebep
2015-03-29Hash all pygments parameters.Ruben Vermeersch
Ensures that Hugo rehighlights source code whenever one of the highlighting options changes.
2015-03-27Cache pygments rendering between runsRuben Vermeersch
Fixes #1000
2014-12-26Wrap comments helpers package to fit 80-column widthAnthony Fok
Add an initial space after `//` where appropriate. Minor copyediting.
2014-12-18Commented helpers packageAhsanul Haque
2014-11-17Shortcode rewrite, take 2bep
This commit contains a restructuring and partial rewrite of the shortcode handling. Prior to this commit rendering of the page content was mingled with handling of the shortcodes. This led to several oddities. The new flow is: 1. Shortcodes are extracted from page and replaced with placeholders. 2. Shortcodes are processed and rendered 3. Page is processed 4. The placeholders are replaced with the rendered shortcodes The handling of summaries is also made simpler by this. This commit also introduces some other chenges: 1. distinction between shortcodes that need further processing and those who do not: * `{{< >}}`: Typically raw HTML. Will not be processed. * `{{% %}}`: Will be processed by the page's markup engine (Markdown or (infuture) Asciidoctor) The above also involves a new shortcode-parser, with lexical scanning inspired by Rob Pike's talk called "Lexical Scanning in Go", which should be easier to understand, give better error messages and perform better. 2. If you want to exclude a shortcode from being processed (for documentation etc.), the inner part of the shorcode must be commented out, i.e. `{{%/* movie 47238zzb */%}}`. See the updated shortcode section in the documentation for further examples. The new parser supports nested shortcodes. This isn't new, but has two related design choices worth mentioning: * The shortcodes will be rendered individually, so If both `{{< >}}` and `{{% %}}` are used in the nested hierarchy, one will be passed through the page's markdown processor, the other not. * To avoid potential costly overhead of always looking far ahead for a possible closing tag, this implementation looks at the template itself, and is branded as a container with inner content if it contains a reference to `.Inner` Fixes #565 Fixes #480 Fixes #461 And probably some others.
2014-05-09Add pygmentsstyle and pygmentsuseclasses optionsLK4D4
Fixes #204 Conflicts: commands/hugo.go
2014-04-26Little syntax mistakeLordFPL
2014-03-31Adding support for logging & verbose logging. Consolidation of error ↵spf13
handling. Integration of jWalterWeatherman library. Fixed #137
2014-01-29gofmt all go codeTibor Vass
2014-01-10Report error, but don’t fatally stop if pygments has error. Return ↵spf13
original string. (+1 squashed commit) Squashed commits: [849a7af] if highlighting doesn’t work, just return original string
2013-12-05Adding Pygments helperspf13