List of all functions, methods and variables in Hugo?

I am developing a Syntax Definition, for syntax highlighting in Sublime Text.
My goal is to create syntax-files so that in Sublime all the text is highlighted within templates and markdown files.
The problem to be solved is that in the Hugo files only the html or markdown text is highlighted, ignoring Front Matter and everything between {{ }}.

Creating the Syntax Definitions for Sublime wouldn’t be very complicated, in principle. However, what is proving difficult is collecting all the reserved words, because they are scattered throughout the documentation.

There is a package for Sublime Text that properly displays go HTML templates:

1 Like

Thanks, @davidsneighbour. Precisely, I am working on GoSublime, to add highlighting of reserved words that are exclusive to Hugo.
GoSublime identifies Go keywords…
(?: Break | case | chan | const | continue | ... etc.)
but ignore hugo’s functions and variables…
(?: absURL | Get | GetPage | HasMenuCurrent | Param | ... etc.)

I’m trying to get past this …

to this…
clip2

There will be subtle but quite useful differences.

1 Like

For a list of all functions:

  • hugo gen docshelper --dir /somedirectory

All methods are … harder.

The best you can currently automatically do is with jsonify, e.g.:

  • {{ site | jsonify }}
  • {{ $page | jsonify }}
3 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.