Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skylighting .numberLines — adding lines to your code block #127

Open
Tracked by #134
badlydrawnrob opened this issue Jan 30, 2024 · 0 comments
Open
Tracked by #134

Skylighting .numberLines — adding lines to your code block #127

badlydrawnrob opened this issue Jan 30, 2024 · 0 comments

Comments

@badlydrawnrob
Copy link
Owner

It seems that Skylighting outputs the code for numbered lines
But you add a conditional .numberLines and .numberSource to view them.

⚠️ Current Anki highlighting themes don't allow for numbered lines (yet)

<div class="sourceCode" id="cb2"><pre
class="sourceCode elm"><code class="sourceCode elm"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="co">-- !# Error (1) and (2):</span></span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a><span class="co">-- Must be `CapitalCase`</span></span>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a><span class="kw">type</span> <span class="dt">ThumbnailSize</span></span>
...</pre></div>

To add numbered lines:

type thumbnailSize
  = small
  | medium
  | large

sizeToString : thumbnailSize -> String
sizeToString size =
  case size of
      Small -> "small"

Outputs

<div class="sourceCode" id="cb2"><pre class="sourceCode numberSource numberLines elm"><code class="sourceCode elm"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="co">-- !# Error (1) and (2):</span></span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a><span class="co">-- Must be `CapitalCase`</span></span>
...</code></pre></div>

Which looks like (in a different highlighting theme)

Screenshot 2024-01-30 at 23 00 25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant