I am writing some programming notes using #orgmode with C code snippets in it. When I export them in HTML, functions are not highlighted. They don’t have an associated class like variable types or language keywords. How can I improve this? #emacs #c
Conversation
Notices
-
Embed this notice
invernomut0 (invernomut0@mastodon.uno)'s status on Saturday, 18-Jan-2025 22:38:26 JST invernomut0
-
Embed this notice
Ihor Radchenko (yantar92) (yantar92@fosstodon.org)'s status on Saturday, 18-Jan-2025 22:38:24 JST Ihor Radchenko (yantar92)
@invernomut0 You need htmlize installed for highlighting export.
-
Embed this notice
Ihor Radchenko (yantar92) (yantar92@fosstodon.org)'s status on Sunday, 19-Jan-2025 23:23:52 JST Ihor Radchenko (yantar92)
@invernomut0 Do you mean that functions/constants are highlighted in Emacs, but do not have classes in the exported output?
-
Embed this notice
invernomut0 (invernomut0@mastodon.uno)'s status on Sunday, 19-Jan-2025 23:23:53 JST invernomut0
@yantar92 I have htmlize installed. When I export an org mode with some C code I get html with some classes added to parts of code: types, pre processor directives but not for functions or constants. I was wondering which component was doing this and if it is customizable
-
Embed this notice
Ihor Radchenko (yantar92) (yantar92@fosstodon.org)'s status on Sunday, 19-Jan-2025 23:46:32 JST Ihor Radchenko (yantar92)
@invernomut0 Then, when if you switch to src edit buffer for that problematic source code and run M-x htmlize-buffer? Will the classes show up?
-
Embed this notice
invernomut0 (invernomut0@mastodon.uno)'s status on Sunday, 19-Jan-2025 23:46:33 JST invernomut0
@yantar92 yes exactly. If they get classes in the exported output I can style them with CSS
-
Embed this notice
Ihor Radchenko (yantar92) (yantar92@fosstodon.org)'s status on Monday, 20-Jan-2025 01:24:20 JST Ihor Radchenko (yantar92)
@invernomut0 Are you sure that you used M-x htmlize-buffer? There is no way htmlize itself is using org- prefix in class names.
-
Embed this notice
invernomut0 (invernomut0@mastodon.uno)'s status on Monday, 20-Jan-2025 01:24:21 JST invernomut0
@yantar92 I get a lot of span elements with class “org-block”. It does detect keywords and strings and variables but not function calls. Is it possible to customize the process? Thanks for the help!
-
Embed this notice
Ihor Radchenko (yantar92) (yantar92@fosstodon.org)'s status on Monday, 20-Jan-2025 01:24:44 JST Ihor Radchenko (yantar92)
@invernomut0 What is better than screenshots is a recipe starting from emacs -Q
-
Embed this notice
invernomut0 (invernomut0@mastodon.uno)'s status on Monday, 20-Jan-2025 01:24:45 JST invernomut0
@yantar92 I can provide some screenshots later to get a better idea of what I mean :)
-
Embed this notice