diff --git a/documentation/conf.py b/documentation/conf.py
index 210b4ab60595..f89926549d20 100644
--- a/documentation/conf.py
+++ b/documentation/conf.py
@@ -82,7 +82,8 @@ extensions = [
     'yocto-vars',
     'bitbake-lexer',
     'bitbake-placeholder',
-    'scc-lexer'
+    'scc-lexer',
+    'wks-lexer'
 ]
 
 # current_version = "dev"
diff --git a/documentation/sphinx/wks-lexer.py b/documentation/sphinx/wks-lexer.py
new file mode 100644
index 000000000000..1e5e5ec1e5b9
--- /dev/null
+++ b/documentation/sphinx/wks-lexer.py
@@ -0,0 +1,60 @@
+"""A lexer for wic kickstart (.wks) files.
+
+wic reads a .wks file line by line: a line whose first non-blank
+character is ``#`` is a comment, and every other line is split with
+``shlex.split`` and handed to ``argparse``, after ``${VAR}`` has been
+expanded. The quoting is therefore shell quoting, which is why this
+extends the bash lexer. What the bash lexer cannot do is mark the
+vocabulary: ``part`` is not a shell builtin, so the statement opening
+each line comes out as ordinary text, and so does every ``--option``.
+
+The statements and options below are taken from wic's parser,
+``ksparser.py``, rather than from the manual, so update them from there
+when wic gains one. ``partition`` is not a statement: it was an alias
+while wic bundled pykickstart, and the parser that replaced it in 2016
+kept only ``part``.
+"""
+from pygments.lexer import bygroups, inherit
+from pygments.lexers.shell import BashLexer
+from pygments.token import Comment, Keyword, Name, Text, Whitespace
+
+__version__ = '1.0'
+
+# The subparsers wic registers.
+STATEMENTS = ('part', 'bootloader', 'include')
+
+
+class WksLexer(BashLexer):
+    """wic kickstart."""
+
+    name = 'wic kickstart'
+    aliases = ['wks']
+    filenames = ['*.wks', '*.wks.in']
+    mimetypes = []
+
+    tokens = {
+        'root': [
+            # A statement is only a statement at the start of a line.
+            # Anchoring matters: "include" is also an ordinary word in
+            # "--include-path", and "part" appears inside several option
+            # names, so an unanchored keyword would mark both.
+            (r'^(\s*)(%s)(\b)' % '|'.join(STATEMENTS),
+             bygroups(Whitespace, Keyword, Text)),
+            # Long options carry the meaning on a wic line; bash leaves
+            # them as plain text because it has no notion of them.
+            (r'--[\w-]+', Name.Attribute),
+            # wic tests the first character of the stripped line, so a
+            # comment may be indented and is never trailing.
+            (r'^\s*#.*$', Comment.Single),
+            inherit,
+        ],
+    }
+
+
+def setup(app):
+    app.add_lexer('wks', WksLexer)
+    return {
+        'version': __version__,
+        'parallel_read_safe': True,
+        'parallel_write_safe': True,
+    }
