
Hi. It seems Pandoc doesn’t highlight Racket syntax. I also couldn’t find a KDE syntax highlighting XML relevant to Racket at https://github.com/KDE/syntax-highlighting. Trying to remedy this, I spent the past few hours tweaking Pandoc’s Scheme highlighter to color a subset of (Typed) Racket forms in the same style as Emacs’ Racket Mode. Before I spend time penning down highlighting rules for more Racket forms, I would like to know more about the prevailing way of publishing Racket code. Can I use Scribble to process my Pandoc-flavored-Markdown, turn all Racket blocks to HTML, and then convert the rest of the markdown file to HTML using Pandoc? Am I oblivious to an even simpler solution e.g. “just use Scribble”?

What’s your use case? Is this for blog posts, standalone documentation, other?

Personal note-taking.

Ok! I would hesitate to use Scribble for that purpose. I know pygments supports Racket highlighting. There may be a way to use that with pandoc. If you want more control I would look into using Pollen, which is syntactically like Scribble but more “lightweight” (easier to customize) Here’s some info on using pygments with Pollen: https://docs.racket-lang.org/pollen/mini-tutorial.html?q=Pollen#%28part._pygments-with-pollen%29\|https://docs.racket-lang.org/pollen/mini-tutorial.html?q=Pollen#%28part._pygments-with-pollen%29

I’ll look into it. Thank you!

I also wrote up a mini tutorial on how to generate automatic links for racket code within Pollen, just like Scribble does: https://thelocalyarn.com/excursus/pollen-cookbook/doclinks.html\|https://thelocalyarn.com/excursus/pollen-cookbook/doclinks.html

If I recall correctly, I think what Matthew Butterick has done in at least one Pollen project is run code through pygments and then look at the result, applying the racket doc link generator to anything pygments marked as a function or what have you.

Pollen is great if you like building designing your own markup and HTML/CSS from scratch. But for note taking with minimal setup you might want to stick with pandoc.

@joel I was about to suggest Scribble as it is included with racket and happily generates html, pdf, .md - why do you hesitate? e.g. https://github.com/racket/scribble/blob/master/scribble-doc/scribblings/scribble/manual.scrbl\|https://github.com/racket/scribble/blob/master/scribble-doc/scribblings/scribble/manual.scrbl

It’s probably just me, but I think of Scribble like typesetting a finished book. For quick note taking with a few conveniences, or if I wanted to customize the styling at all I would reach for a less elaborate tool. Again, just personal taste.

I wouldn’t typeset notes in Scribble for the same reason that I find it weird when people take notes in LaTeX

(although the real best note-taking tool is pen and paper, in my opinion)

someone actually implemented the improvement I suggested for the documentation, the one where the left panel scrolls independently from the page, wild… and thank you!

can someone explain me why this doesn’t do what I expect it to do? https://gist.github.com/kurinoku/89fce7fcbf5da1f3baecf67beb3e90c6 wouldn’t this just get as many non blank/whitespace characters after a http string and return them?

Can you give the link?

I didn’t look deep, but it seems to me that a regexp would be more fitting to this task

yes, maybe I should have just gone with regexp, I don’t even know exactly why I didn’t

When you want to draft equations, nothing i know of beats latex, apart sometimes from pencil and paper/e-ink. I wish i could write them in scribble

I still would like to know why it doesn’t work though.

I mean, lexer is regexp

yeah, but I dont get why it backtracks to the title option if there’s a space after the “url”

I don’t think this is a bug. It’s just not producing what you want

yeah, I don’t think it’s a bug either, I just want to understand

Try
[(:& (:: (:~ blank whitespace) (:* (:~ #\newline)))
(complement (:: "http" any-string)))
`(title ,lexeme)]

This will make the title
refuse to match strings that start with http

So the only possible choice for it is url

well, that works, thanks. still weird, I would think that url takes priority here

https://racket.slack.com/archives/C06V96CLD/p1610058433497900 well this is when I asked

maybe someone else asked the same, I just meant that I was surprised to see it being implemented

From the documentation:
> When multiple patterns match, a lexer will choose the longest match, breaking ties in favor of the rule appearing first.

ah… I should be read more carefully, thanks!

In your original code, both:
<https://abc.com>
and
<https://abc.com> e
can be matched, so it chooses the latter

What about latex in Scribble:

I mean if you’re already using Emacs, there is also org-mode. It is a non-awful way to take notes; some people really like it. You can use source blocks tagged with a major mode, and it will highlight the block using that mode.

To be clear I’m not evangelizing (< (or scribble pollen x) org-mode)
! :smile: Just pointing out it’s another option.

Not sure if I ought to bring it up, but there’s also the not-often-discussed case against syntax highlighting, which is that it interferes with, or at least does nothing for, code legibility

now it makes a ton of sense, I was rusty so that’s why I didn’t remember that I actually already encountered similar problems with regex before.

right, after using LaTeX for a while, I gained the ability to almost think equations in it rather than just transliterating pen-and-paper work @laurent.orseau

I still think that paper is better for when you need to do it fast though (read: lectures)

https://github.com/racket/scribble/pull/297 I think wilbowma discussed with a student and created this PR

Hmm, I’ve tried this again, but I’m still not getting anything in bin
. I thought config-tethered-gui-bin-dir
might be the answer—I hadn’t set that at first, thinking it would get a default value—but that didn’t help, either. I’m trying this on Kubuntu, if that matters. I’ve attached my config.rktd
: I have a Unix-style minimal Racket installation built (by Guix) from the source download under the prefix /gnu/store/7vy0ikhd3ws5v6jydzx7aipvs4jv7rb9-racket-minimal-8.1/
, and I’m working under the prefix /home/philip/code/tmp/racket-config-tethered/
, with the package sources for a full Racket installation unpacked into the paths named by pkgs-dir
and links-file
(in the layout of a Unix-style install).

what is the time complexity of vector-append
?

O(n+m)