# How to get DAML syntax highlighting on Github?

**URL:** <https://forum.canton.network/t/how-to-get-daml-syntax-highlighting-on-github/1064>\
**Category:** App Development\
**Created:** [August 18, 2020, 7:48pm UTC](https://forum.canton.network/t/how-to-get-daml-syntax-highlighting-on-github/1064 "2020-08-18T19:48:11Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![gyorgybalazsi](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/gyorgybalazsi/32/684_2.png) [@gyorgybalazsi](https://forum.canton.network/u/gyorgybalazsi)\
**Post date:** [August 18, 2020, 7:48pm UTC](https://forum.canton.network/t/how-to-get-daml-syntax-highlighting-on-github/1064/1 "2020-08-18T19:48:11Z")

</div>

Many .daml files on Github don’t have any syntax highlighting.

There was already a question about this topic on this forum, with answers from @cocreature and @anthony, with the conclusion that we don’t have proper syntax highlighting for DAML files yet: [Is there a way to configure syntax highlighting in topics?](https://discuss.daml.com/t/is-there-a-way-to-configure-syntax-highlighting-in-topics/163)

Still, there are .daml files on Github which have proper syntax highlighting, eg this one: [lib-finance/Types.daml at 07011cb70b7d8d95f54a30770b8307f0d9ccd5ba · digital-asset/lib-finance · GitHub](https://github.com/digital-asset/lib-finance/blob/07011cb70b7d8d95f54a30770b8307f0d9ccd5ba/model/src/DA/Finance/Types.daml)

How so? How can I get this for my files?

---

<div class="post-metadata">

**Author:** ![anthony](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/anthony/32/419_2.png) [@anthony](https://forum.canton.network/u/anthony)\
**Post date:** [August 18, 2020, 7:51pm UTC](https://forum.canton.network/t/how-to-get-daml-syntax-highlighting-on-github/1064/2 "2020-08-18T19:51:12Z")

</div>

Can you screenshot? This is showing in plain text for me.

Is it too early to get excited that GH may be rolling out syntax highlighting for DAML and it simply hasn’t hit all the servers yet? To give some background GH chooses to add syntax highlighting for a language when they see enough usage of it. I’m unaware of the exact criteria and process though.

 ![image](https://canada1.discourse-cdn.com/flex028/uploads/daml/original/1X/d1f5e71783628bd89233ce0a6116d427c12e8411.png)

---

<div class="post-metadata">

**Author:** ![gyorgybalazsi](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/gyorgybalazsi/32/684_2.png) [@gyorgybalazsi](https://forum.canton.network/u/gyorgybalazsi)\
**Post date:** [August 18, 2020, 7:54pm UTC](https://forum.canton.network/t/how-to-get-daml-syntax-highlighting-on-github/1064/3 "2020-08-18T19:54:35Z")

</div>

![image](https://canada1.discourse-cdn.com/flex028/uploads/daml/original/1X/451f87c25f2a835b8786607f7744e5123dda9a5d.png)

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [August 18, 2020, 7:54pm UTC](https://forum.canton.network/t/how-to-get-daml-syntax-highlighting-on-github/1064/4 "2020-08-18T19:54:47Z")

</div>

Not sure why it’s showing as plaintext for @anthony, it looks fine for me. However, this is not DAML syntax highlighting. We are just telling Github to use Haskell highlighting for `.daml` files. See [lib-finance/.gitattributes at 07011cb70b7d8d95f54a30770b8307f0d9ccd5ba · digital-asset/lib-finance · GitHub](https://github.com/digital-asset/lib-finance/blob/07011cb70b7d8d95f54a30770b8307f0d9ccd5ba/.gitattributes#L1)

---

<div class="post-metadata">

**Author:** ![anthony](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/anthony/32/419_2.png) [@anthony](https://forum.canton.network/u/anthony)\
**Post date:** [August 18, 2020, 7:55pm UTC](https://forum.canton.network/t/how-to-get-daml-syntax-highlighting-on-github/1064/6 "2020-08-18T19:55:51Z")

</div>

Hmm… loaded it again and now I have syntax highlighting too

---

<div class="post-metadata">

**Author:** ![gyorgybalazsi](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/gyorgybalazsi/32/684_2.png) [@gyorgybalazsi](https://forum.canton.network/u/gyorgybalazsi)\
**Post date:** [August 18, 2020, 7:58pm UTC](https://forum.canton.network/t/how-to-get-daml-syntax-highlighting-on-github/1064/7 "2020-08-18T19:58:38Z")

</div>

Yes, thank you!

---

<div class="post-metadata">

**Author:** ![gyorgybalazsi](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/gyorgybalazsi/32/684_2.png) [@gyorgybalazsi](https://forum.canton.network/u/gyorgybalazsi)\
**Post date:** [August 18, 2020, 8:11pm UTC](https://forum.canton.network/t/how-to-get-daml-syntax-highlighting-on-github/1064/8 "2020-08-18T20:11:59Z")

</div>

I couldn’t find any way to apply the same trick to Github gists.

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [August 18, 2020, 8:23pm UTC](https://forum.canton.network/t/how-to-get-daml-syntax-highlighting-on-github/1064/9 "2020-08-18T20:23:34Z")

</div>

A bit annoying that adding a `.gitattributes` file to a gist doesn’t work but you can use the [modelines](https://github.com/github/linguist/tree/47b109be3657fe3d5933fba6840a6ceea0f94498#using-emacs-or-vim-modelines) feature of linguist (the library github uses for highlighing. E.g., [here’s a gist](https://gist.github.com/cocreature/c8dc3da0b869628d0f9e70aaf432bf00) of a DAML file I wrote yesterday to demonstrate two failure modes of `fetchByKey`.

---

<div class="post-metadata">

**Author:** ![gyorgybalazsi](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/gyorgybalazsi/32/684_2.png) [@gyorgybalazsi](https://forum.canton.network/u/gyorgybalazsi)\
**Post date:** [August 18, 2020, 8:42pm UTC](https://forum.canton.network/t/how-to-get-daml-syntax-highlighting-on-github/1064/10 "2020-08-18T20:42:48Z")

</div>

That’s great, thank you! Will use it myself.

---

<div class="post-metadata">

**Author:** ![anthony](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/anthony/32/419_2.png) [@anthony](https://forum.canton.network/u/anthony)\
**Post date:** [August 19, 2020, 7:51pm UTC](https://forum.canton.network/t/how-to-get-daml-syntax-highlighting-on-github/1064/11 "2020-08-19T19:51:13Z")

</div>

Another way is to enter gist filenames as `file.hs` to get syntax highlighting.

---

<div class="post-metadata">

**Author:** ![stefanobaghino-da](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/stefanobaghino-da/32/7057_2.png) [@stefanobaghino-da](https://forum.canton.network/u/stefanobaghino-da)\
**Post date:** [August 20, 2020, 7:04am UTC](https://forum.canton.network/t/how-to-get-daml-syntax-highlighting-on-github/1064/12 "2020-08-20T07:04:12Z")

</div>

FYI [we’re still trying to make GitHub accept DAML as a supported language](https://github.com/github/linguist/issues/4219), but that mostly boils down to having a certain number of repositories using it, so tell your friends and family to write more Daml. 😃

---

<div class="post-metadata">

**Author:** ![Luciano](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/luciano/32/319_2.png) [@Luciano](https://forum.canton.network/u/Luciano)\
**Post date:** [April 20, 2021, 7:43am UTC](https://forum.canton.network/t/how-to-get-daml-syntax-highlighting-on-github/1064/13 "2021-04-20T07:43:02Z")

</div>

How’s this coming along? I looked at your link. Seems like the acceptance criteria is considered on a case-by-case basis.
