!avYyleMexqjFHoqrME:nixos.org

Nix Documentation

436 Members
Discussion about documentation improvements around the Nix ecosystem94 Servers

Load older messages


SenderMessageTime
8 Mar 2022
@finn:tomesh.netfinn joined the room.16:10:58
10 Mar 2022
@toonn:matrix.orgtoonn changed their profile picture.11:23:16
15 Mar 2022
@jeonwh:matrix.orgjeonwh left the room.13:20:52
17 Mar 2022
@drupol:matrix.orgPol joined the room.13:41:32
@drupol:matrix.orgPolHey hi, I'm going to copy paste a message I wrote in another room.13:43:22
@drupol:matrix.orgPol I'm writing a paper using LaTeX. In this paper, I'm including a lot of snippets written in Nix. Do you have an already made lstlisting configuration specifically made for Nix so it can highlight the snippets in a better way?
I currently made one, here is how it looks like:
13:44:24
@drupol:matrix.orgPolimage.png
Download image.png
13:45:15
@drupol:matrix.orgPolI wish I could customize the colors of the assignations, but I cannot find a proper way. Feel free to suggest anything !13:45:35
@drupol:matrix.orgPol Sadly, I cannot share the whole paper right now, it's not meant to be open-source yet. But I can share the lstlisting configuration if needed. 13:47:25
@jtojnar:matrix.orgJan Tojnar Pol: I would try searching GitHub for the keywords 15:36:19
@jtojnar:matrix.orgJan Tojnaror I would just use the pygments based highlighter15:36:51
@jtojnar:matrix.orgJan Tojnar * or I would just use the pygments based highlighter (minted)15:37:06
@drupol:matrix.orgPolI did, there are not a lot of results for it. I inspired my stuff from what I found on Github already.15:37:29
@jtojnar:matrix.orgJan Tojnar searching for usepackage lstlisting nix, I found https://github.com/yannham/lambdajam-2021/blob/1d6b5f6c65f8a0600370a6c6518eef9df0af47c8/presentation.tex#L31 15:39:51
@drupol:matrix.orgPol
In reply to @jtojnar:matrix.org
searching for usepackage lstlisting nix, I found https://github.com/yannham/lambdajam-2021/blob/1d6b5f6c65f8a0600370a6c6518eef9df0af47c8/presentation.tex#L31
Yeah this is basically what I'm using and I tweaked it. I wish I could customize the colors of the variables in let ... in ... bindings. But it seems that it's not something easy to do.
15:42:23
@jtojnar:matrix.orgJan Tojnaryeah, the only other I found is https://github.com/jmbaur/talks/blob/badad5450bb5bf67a3abda9683edafa71c83b044/2022/nix/nix.sty, which does not seem much better15:43:51
@drupol:matrix.orgPolThis is what I have:15:44:43
@drupol:matrix.orgPolhttps://gist.github.com/drupol/1ab0f25fea4f050f40e87d4ab75080ed15:45:34
@jtojnar:matrix.orgJan Tojnar have you tried minted yet? it tends to have better syntax highlighting and there seems to be a syntax for Nix out of the box 15:46:50
@drupol:matrix.orgPolah bon ?!15:47:06
@drupol:matrix.orgPolGoing to check this out.15:47:13
@drupol:matrix.orgPol./src/lrs/index.tex:3: Package minted Error: You must have `pygmentize' install ed to use this package15:48:34
@drupol:matrix.orgPolLooks like I will have to tweak my flake :)15:48:45
@drupol:matrix.orgPoljob done.15:51:34
@drupol:matrix.orgPol amazing, thanks Jan Tojnar !!!! 15:57:03
@jtojnar:matrix.orgJan Tojnarthe downside is that it depends on shell-exec and is kinda slow (maybe it is possible to disable it in preview mode?)15:59:03
@drupol:matrix.orgPolIt's fast enough for what I have to do... so it's all good :)16:01:13
@drupol:matrix.orgPolI will now learn how to customize the colors.16:01:21
@drupol:matrix.orgPolI would like to use university colors.16:01:27
@drupol:matrix.orgPolhttps://pygments.org/demo/?lexer=nixos&style=vim&formatter=html&code=fibonacci+%3D+let%0A++++f+%3D+n%3A%0A++++++++if+%28n+%3D%3D+0%29+then+0+else%0A++++++++if+%28n+%3D%3D+1%29+then+1+else%0A++++++++f+%28n+-+1%29+%2B+f+%28n+-+2%29%3B%0Ain%0A++++f16:06:59

Show newer messages


Back to Room ListRoom Version: 6