\version "2.23.4" #(define (indent n lines) (let ((padding (make-string n #\space))) (string-join (map (lambda (line) (string-append padding line)) lines) "\n"))) #(define (wrap n str) (let ((components (filter (lambda (s) (not (string-null? s))) (apply append (map (lambda (s) (string-split s #\space)) (string-split str #\newline)))))) (let loop ((rest components) (lines-acc '()) (current-line-acc '()) (pos 0)) (if (null? rest) (map (lambda (line) (string-join line " ")) (reverse! (cons (reverse! current-line-acc) lines-acc))) (let* ((next (car rest)) (remaining (cdr rest)) (added-len (1+ (string-length next))) (new-pos (+ pos added-len))) (if (>= new-pos n) (loop remaining (cons (reverse! current-line-acc) lines-acc) (list next) added-len) (loop remaining lines-acc (cons next current-line-acc) new-pos))))))) #(define (format-symbol-list lst) (string-join (map symbol->string lst) ", ")) #(define (format-default default) (cond ((unspecified? default) "") ((procedure? default) (format #f " ~a\n" (procedure-name default))) (else (indent 2 (string-split (format #f "~y" default) #\newline))))) #(define (format-property-entry property default interfaces) (format #f "\ * ~a (from ~a) ~a ~a ~a" property (format-symbol-list interfaces) (make-string (string-length (symbol->string property)) #\-) (format-default default) (indent 5 (wrap 74 (object-property property 'backend-doc))))) #(define (basic-doc name classes interfaces) (format #f " ~a ~a ~a Classes: ~a " name (make-string (string-length (symbol->string name)) #\=) (let* ((formatted-list (format-symbol-list interfaces)) (formatted-text (format #f "Interfaces supported: ~a" formatted-list))) (string-join (wrap 79 formatted-text) "\n")) (format-symbol-list classes))) info = #(define-void-function (grob-name) (symbol?) (let* ((definition (assq-ref all-grob-descriptions grob-name)) (meta (assq-ref definition 'meta)) (properties (alist->hash-table (assq-remove! definition 'meta))) (classes (assq-ref meta 'classes)) (interfaces (assq-ref meta 'interfaces)) (basic (basic-doc grob-name classes interfaces)) (property-interfaces-table (make-hash-table)) (all-interfaces (ly:all-grob-interfaces))) (for-each (lambda (interface) (let ((interface-properties (third (hashq-ref all-interfaces interface)))) (for-each (lambda (property) (if (not (object-property property 'backend-internal)) (hashq-set! property-interfaces-table property (cons interface (hashq-ref property-interfaces-table property '()))))) interface-properties))) interfaces) (let* ((property-alist (hash-map->list cons property-interfaces-table)) (sorted-property-alist (sort property-alist (comparator-from-key (lambda (pair) (symbol->string (car pair))) string-ci