Skip to content

Commit 40c006c

Browse files
committed
update release notes src with sdg links
1 parent 38a2c11 commit 40c006c

2 files changed

Lines changed: 89 additions & 15 deletions

File tree

release-notes/release-notes.rkt

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@
4444
(define racket-lang-core-url
4545
"https://racket-lang.org")
4646

47+
"[3.18 Iterations and Comprehensions: for, for/list, ...](https://docs.racket-lang.org/reference/for.html)"
48+
49+
50+
@list["https://docs.racket-lang.org/reference/for.html"]{3.18
51+
Iterations and Comprehensions: for, for/list, ...}
4752

4853
(define bullets
4954
(list
@@ -53,7 +58,9 @@
5358
language family, to allow users to interact with documentation in a way that
5459
is tailored to that language family. This is currently used by Rhombus.}
5560

56-
@bullet{The `for` form and its variants accept an `#:on-length-mismatch` specifier.}
61+
@bullet{The `for` form and its variants accept an `#:on-length-mismatch`
62+
specifier. @link["https://docs.racket-lang.org/reference/for.html"]{3.18
63+
Iterations and Comprehensions: for, for/list, ...}}
5764

5865
@bullet{DrRacket improves the GUI for choosing color schemes.}
5966

@@ -63,24 +70,31 @@ indicates the relative left- or right-displacement of the arrow's target.}
6370
@bullet{DrRacket's "Insert Large Letters" uses characters that match the
6471
comment syntax of the buffer's language, making it useful (and fun!) in Rhombus.}
6572

66-
@bullet{The `exn-classify-errno` maps network and filesystem error numbers on various platforms
67-
to posix-standard symbols, to enable more portable code.}
73+
@bullet{The `exn-classify-errno` maps network and filesystem error numbers on various
74+
platforms to posix-standard symbols, to enable more portable code. @link["https://docs.racket-lang.org/reference/exns.html#%28def._%28%28quote._~23~25kernel%29._exn-classify-errno%29%29"]{10.2
75+
Exceptions}}
6876

69-
@bullet{The behavior of Racket BC on certain character operations (most notably `eq?`) is changed
70-
to match that of Racket CS, with a small performance penalty for these operations for BC programs.}
77+
@bullet{The behavior of Racket BC on certain character operations (most notably `eq?`)
78+
is changed to match that of Racket CS, with a small performance penalty for these operations for BC programs.
79+
@link["https://docs.racket-lang.org/guide/performance.html#%28tech._bc%29"]{19 Performance}
80+
@link["https://docs.racket-lang.org/reference/implementations.html#%28tech._bc%29"]{1.5 Implementations}}
7181

7282
@bullet{The `make-struct-type` procedure can inherit the current inspector using a `'current`
7383
flag. This is the default behavior, but there are situations in which it's not possible
74-
to refer to the current inspector.}
84+
to refer to the current inspector. @link["https://docs.racket-lang.org/reference/creatingmorestructs.html"]{5.2
85+
Creating Structure Types}}
7586

7687
@bullet{Bundle configurations can better control the conventions for locating shared object
7788
files with the `--enable-sofind=<conv>` flags.}
7889

7990
@bullet{The `system-type` function can report on platform and shared-object-library conventions
80-
with new flags.}
91+
with new flags. @link["https://docs.racket-lang.org/reference/runtime.html"]{15.8
92+
Environment and Runtime Information}}
8193

8294
@bullet{The `openssl/legacy` library makes it possible to access OpenSSL's built-in "legacy"
83-
provider, to get access to insecure and outdated algorithms.}
95+
provider, to get access to insecure and outdated algorithms. @link[
96+
"https://docs.racket-lang.org/openssl/index.html#%28mod-path._openssl%2Flegacy%29"]{OpenSSL:
97+
Secure Communication}}
8498

8599
@bullet{Typed Racket improves expected type propagation for keyword argument functions.}
86100

release-notes/render-release-notes.rkt

Lines changed: 67 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
#lang at-exp racket
22

3-
(require rackunit)
3+
(require rackunit
4+
;; sorry I'm addicted to Ryan's regexp library
5+
scramble/regexp)
46

5-
(provide bullet
6-
sub-bullet
7-
link
7+
(provide bullet ; a bullet
8+
sub-bullet ; a sub-bullet
9+
link ; use this to represent links, as e.g. @link["http://zzz.com"]{this is a link to zzz}
810
txt-render-bullet
911
md-render-bullet
1012
bullet-links
@@ -20,6 +22,9 @@
2022

2123
(define bar-length 70)
2224

25+
;; looks like sdg prefers stars?
26+
(define bullet-start-string "* ")
27+
2328
(define horizontal-bar (apply string (for/list ([i bar-length]) #\-)))
2429

2530
;; a break-loc is a number representing a break before the nth character of a string.
@@ -160,8 +165,16 @@
160165
(bulletS url 1 args))
161166

162167
;; an at-exp function that creates a link
163-
(define (link url text)
164-
(linkS text url))
168+
(define (link url . texts)
169+
(linkS (apply string-append (map newline->string texts))
170+
url))
171+
172+
;; replace newlines with strings: because of the way that
173+
;; at-exp parsing works, newlines will occur in separate strings.
174+
(define (newline->string s)
175+
(match s
176+
["\n" " "]
177+
[other other]))
165178

166179
;; given a bullet, return a list of strings representing
167180
;; lines suitable for inclusion in a text file
@@ -227,7 +240,7 @@
227240
(define no-newlines-strs (map (λ (s) (cond [(equal? s "\n") " "]
228241
[else s]))
229242
strs))
230-
(list (string-append pad-str "- " (apply string-append no-newlines-strs))))
243+
(list (string-append pad-str bullet-start-string (apply string-append no-newlines-strs))))
231244

232245
;; list-of-strings -> string
233246
(define (display-lines los)
@@ -366,7 +379,54 @@
366379
(list "Matthew Flatt,"
367380
"Stephen Chang, and"
368381
"Robby Findler."))
382+
383+
384+
(check-equal? (link "https://zzz.com" "yay a string")
385+
(linkS "yay a string" "https://zzz.com"))
386+
(check-equal? (link "https://zzz.com" "yay a" "\n" "string")
387+
(linkS "yay a string" "https://zzz.com"))
369388
)
370389

390+
;; utility function for "going backward" from the markdown syntax to the release-notes format
391+
(define (flip-markdown-link txt)
392+
(match txt
393+
;; this is probably overly conservative?
394+
[(regexp (px ^ "[" (report (+ (chars (complement "]")))) "](" (report (+ (chars (complement ")")))) ")" $)
395+
(list _ text-part url-part))
396+
;; it would be really easy to get the quoting wrong here... I probably have,
397+
;; I'm not going to spend a long time thinking about it. Specifically, curly
398+
;; braces in the text part will definitely be a problem.
399+
;; ... okay, I can check for that anyway...
400+
(when (regexp-match? (px (chars "{}")) txt)
401+
(error "do this by hand, this string has curly braces in it."))
402+
(~a "@link[\"" url-part "\"]{" text-part "}")]
403+
[else #f]))
404+
405+
(define lines
406+
#<<|
407+
* The behavior of Racket BC on certain character operations (most notably `eq?`) is changed to match that of Racket CS, with a small performance penalty for these operations for BC programs.
408+
409+
[19 Performance](https://docs.racket-lang.org/guide/performance.html#%28tech._bc%29)
410+
411+
[1.5 Implementations](https://docs.racket-lang.org/reference/implementations.html#%28tech._bc%29)
412+
413+
* The `make-struct-type` procedure can inherit the current inspector using a `'current` flag. This is the default behavior, but there are situations in which it's not possible to refer to the current inspector.
414+
415+
[5.2 Creating Structure Types](https://docs.racket-lang.org/reference/creatingmorestructs.html)
416+
417+
* The `system-type` function can report on platform and shared-object-library conventions with new flags.
418+
419+
[15.8 Environment and Runtime Information](https://docs.racket-lang.org/reference/runtime.html)
420+
421+
* The `openssl/legacy` library makes it possible to access OpenSSL's built-in "legacy" provider, to get access to insecure and outdated algorithms.
422+
423+
[OpenSSL: Secure Communication](https://docs.racket-lang.org/openssl/index.html#%28mod-path._openssl%2Flegacy%29)
424+
|
425+
)
426+
427+
;; use this to translate all the links...
428+
#;(for ([line (regexp-split (px "\n") lines)])
429+
(define try-flip (flip-markdown-link line))
430+
(displayln (or try-flip line)))
371431

372432

0 commit comments

Comments
 (0)