# Languages list for Code Macro?

**URL:** <https://forum.xwiki.org/t/languages-list-for-code-macro/10425>\
**Category:** Help / Discuss\
**Tags:** code-highlight, code\
**Created:** [May 31, 2022, 7:14am UTC](https://forum.xwiki.org/t/languages-list-for-code-macro/10425 "2022-05-31T07:14:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![NilkOne](https://forum.xwiki.org/user_avatar/forum.xwiki.org/nilkone/32/4272_2.png) [@NilkOne](https://forum.xwiki.org/u/NilkOne)\
**Post date:** [May 31, 2022, 7:14am UTC](https://forum.xwiki.org/t/languages-list-for-code-macro/10425/1 "2022-05-31T07:14:44Z")

</div>

Hello,

I try to use [Code Macro](https://extensions.xwiki.org/xwiki/bin/view/Extension/Code%20Macro/) but I didn’t find any language code list.

What is the correct value for c# language ?

Where to find it ?

Thanks

---

<div class="post-metadata">

**Author:** ![mleduc](https://forum.xwiki.org/user_avatar/forum.xwiki.org/mleduc/32/2328_2.png) [@mleduc](https://forum.xwiki.org/u/mleduc)\
**Post date:** [May 31, 2022, 8:01am UTC](https://forum.xwiki.org/t/languages-list-for-code-macro/10425/2 "2022-05-31T08:01:59Z")

</div>

Hello @NilkOne,

> [@NilkOne](#):
>
> I try to use [Code Macro](https://extensions.xwiki.org/xwiki/bin/view/Extension/Code%20Macro/) but I didn’t find any language code list.

As you can read in the documentation:

> See [Languages — Pygments](https://pygments.org/languages/) for the list of all supported languages. If you have a hard time finding the right id for the language, you can look at [Available lexers — Pygments](https://pygments.org/docs/lexers/) (Short names).

So if I trust [Available lexers — Pygments](https://pygments.org/docs/lexers/#pygments.lexers.dotnet.CSharpLexer), `csharp`, `c#`, and `cs` are all valid language identifiers for `C#` code.

If none of those values produces the expected results, your issue might have another cause.

---

<div class="post-metadata">

**Author:** ![NorSch](https://forum.xwiki.org/user_avatar/forum.xwiki.org/norsch/32/3116_2.png) [@NorSch](https://forum.xwiki.org/u/NorSch)\
**Post date:** [May 31, 2022, 1:37pm UTC](https://forum.xwiki.org/t/languages-list-for-code-macro/10425/3 "2022-05-31T13:37:04Z")

</div>

If Python is an allowed script language you can do it automatically.

```auto
{{python}}
import pygments
from pygments.lexers import get_all_lexers

print "|=Language |=Name |=File Extension |=Mime Types"
for lexer in get_all_lexers():
    print "| ", lexer[0], " | ", ", ".join(lexer[1]), " | ", ", ".join(lexer[2]), " | ", ", ".join(lexer[3])

{{/python}}

```

---

<div class="post-metadata">

**Author:** ![NilkOne](https://forum.xwiki.org/user_avatar/forum.xwiki.org/nilkone/32/4272_2.png) [@NilkOne](https://forum.xwiki.org/u/NilkOne)\
**Post date:** [June 15, 2022, 11:45am UTC](https://forum.xwiki.org/t/languages-list-for-code-macro/10425/4 "2022-06-15T11:45:35Z")

</div>

OK great thank you

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [June 15, 2022, 11:50am UTC](https://forum.xwiki.org/t/languages-list-for-code-macro/10425/5 "2022-06-15T11:50:53Z")

</div>

Nice one 🙂 I’ve documented it at [https://extensions.xwiki.org/xwiki/bin/view/Extension/Code%20Macro/#HListingallsupportedlanguages](https://extensions.xwiki.org/xwiki/bin/view/Extension/Code%20Macro/#HListingallsupportedlanguages)
