Open dbaynard opened 6 years ago
@dbaynard Hello and thank you for this issue. This will require being added as a code path I think tokei can maybe support this syntax though I have a couple of questions about literate files. How many other types of styles are common? Can a *.lhs
file have non haskell code fences and still be valid to the compiler?
The best resource on literate haskell files is the readme at https://github.com/wenkokke/unlit.
However, this applies beyond haskell. For example, it may be useful to know how many lines of code are in tutorials written in markdown (or latex).
How many other types of styles are common?
unlit
lists 6 types. In addition to the 'bird' style, there are two markdown styles (triple tildes or triple backticks) and three others:
LaTeX
\begin{code}
\end{code}
Org mode
#+BEGIN_SRC haskell
#+END_SRC
Jekyll
{% highlight haskell %}
{% endhighlight %}
Of these, I've only encountered the bird track, markdown and latex forms in the wild (and the latex form seems to be falling out of favour).
Can a
*.lhs
file have non haskell code fences and still be valid to the compiler?
With fences, haskell
must be present.
@XAMPPRocky Any progress on this? I'd love this feature, and might be up for implementing a patch for it.
Hello,
I've been through the language addition guide, and would like some advice on implementing support for literate files (e.g. literate haskell,
*.lhs
).In a literate file, the code is demarcated, whereas the comments are not. Traditionally literate haskell files used bird tracks.
More common now is the markdown style.
In either case, rather than demarcating the comments, it is the code which is demarcated, and therefore it does not appear that tokei can simply support such a file by extending the
languages.json
file.How can tokei support such a syntax?