Closed priyadarshan closed 9 years ago
Agreed, this would be cool! It may be outside the scope of the project, but if I find I can do it fairly easily, I'll add the feature. Leaving this issue open until I can make a decision either way.
highlight-lisp
will hopefully be used for cl-cookbook (LispCookbook/cl-cookbook#43).
Being able to highlight matching paren on mouse-over would be a good help studying the recipes (at least for absolute beginners like myself).
:+1:
OK FINE YOU WIN!!
Added paren matching in 93216f5. Works slightly differently than paste.lisp.org (their version is more robust, this one just highlights immediate matches). Pull down master and give it a shot (check out the readme for details)
:smile_cat: Thank you so much for the new feature!
It works wonderfully. A quick test from the example in README:
<html lang="en">
<head>
<link rel="stylesheet" href="/Users/priyadarshan/highlight-lisp/themes/github.css">
<script type="text/javascript" src="/Users/priyadarshan/highlight-lisp/highlight-lisp.js"></script>
<body>
<pre><code class="lisp">(defun test-syntax-highlighter ()
"Docstring explaining what this function does."
(let ((hash (make-hash-table :test #'equal)))
...))</pre></code>
<script type="text/javascript">
HighlightLisp.highlight_auto({className: null});
HighlightLisp.paren_match();
</script>
</body>
</html>
Results in
Thank you.
I was meant to add a link to what looks related to paste.lisp.org's source colouring. Let me do it now, if I may: https://github.com/stassats/lisp-bots
Thanks again.
Cool, glad it's working well!
@priyadarshan indeed now the CL cookbook uses it :) (https://github.com/LispCookbook/cl-cookbook/pull/64)
@vindarel Very nice PR.
Thank you!
It would be very nice to have the option to highlight matching paren on mouse-over, like pastes at paste.lisp.org. See as example the same code of the
highlight-lisp
demo here: http://paste.lisp.org/display/143836Thank you for
highlight-lisp
!