Sphinx not highlighting code it should

85 views
Skip to first unread message

Joshua J. Kugler

unread,
Sep 11, 2020, 6:31:24 PM9/11/20
to sphinx...@googlegroups.com
In my document, I have various bits of code like this:

```<code type>
# code
```

They are lexed and pygmentize'd correctly. However, I have a block like this:

```powershell
# powershell code
```

pygmentize -L lists "powershell" as a type of code it can lex and highlight.
However, I get this warning from sphinx:

/home/jkugler/repos/frb/devkit-python/docs/installing-devkit.md: WARNING:
Could not lex literal_block as "powershell". Highlighting skipped.

I uninstalled python3-pygments as a test, and sphinx would not run without it,
so I know that's the one it's using.

Ideas?

j

--
Joshua J. Kugler - Fairbanks, Alaska - jos...@azariah.com
Azariah Enterprises - Programming and Website Design
PGP Key: http://pgp.mit.edu/ ID 0x68108cbb73b13b6a


Komiya Takeshi

unread,
Sep 12, 2020, 9:42:42 AM9/12/20
to sphinx...@googlegroups.com
Hi,

I think your code block contains a syntax error.
Could you check the text is valid using `pygmentize -l powershell -F
raiseonerror` command?

If it contains syntax error, you need to pass `:force:` option to the
code-block directive.

Thanks,
Takeshi KOMIYA

2020年9月12日(土) 7:31 Joshua J. Kugler <jos...@azariah.com>:
> --
> You received this message because you are subscribed to the Google Groups "sphinx-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sphinx-users...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sphinx-users/6311453.lOV4Wx5bFT%40hosanna.

Joshua J. Kugler

unread,
Sep 14, 2020, 1:09:28 PM9/14/20
to sphinx...@googlegroups.com
That was it! Thank you very much.

j

Daniel Scott

unread,
Nov 25, 2020, 10:31:14 PM11/25/20
to sphinx...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages