mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
import/utils: Add beautify-synopsis.
* guix/import/utils.scm (beautify-synopsis): New procedure.
This commit is contained in:
parent
e761ed7384
commit
7ea6e9f79f
1 changed files with 17 additions and 1 deletions
|
@ -72,6 +72,7 @@
|
||||||
|
|
||||||
snake-case
|
snake-case
|
||||||
beautify-description
|
beautify-description
|
||||||
|
beautify-synopsis
|
||||||
|
|
||||||
alist->package
|
alist->package
|
||||||
|
|
||||||
|
@ -295,7 +296,22 @@ LENGTH characters."
|
||||||
;; Use double spacing between sentences
|
;; Use double spacing between sentences
|
||||||
(fill-paragraph (regexp-substitute/global #f "\\. \\b"
|
(fill-paragraph (regexp-substitute/global #f "\\. \\b"
|
||||||
cleaned 'pre ". " 'post)
|
cleaned 'pre ". " 'post)
|
||||||
length)))
|
length)))
|
||||||
|
|
||||||
|
(define (beautify-synopsis synopsis)
|
||||||
|
"Improve the package SYNOPSIS."
|
||||||
|
(let ((cleaned (cond
|
||||||
|
((not (string? synopsis))
|
||||||
|
(G_ "This package lacks a synopsis. Run \
|
||||||
|
\"info '(guix) Synopses and Descriptions'\" for more information."))
|
||||||
|
((string-prefix? "A " synopsis)
|
||||||
|
(substring synopsis 1))
|
||||||
|
;; Remove trailing period.
|
||||||
|
((string-suffix? "." synopsis)
|
||||||
|
(substring synopsis 0
|
||||||
|
(1- (string-length synopsis))))
|
||||||
|
(else synopsis))))
|
||||||
|
(string-trim-both cleaned)))
|
||||||
|
|
||||||
(define* (package-names->package-inputs names #:optional (output #f))
|
(define* (package-names->package-inputs names #:optional (output #f))
|
||||||
"Given a list of PACKAGE-NAMES or (PACKAGE-NAME VERSION) pairs, and an
|
"Given a list of PACKAGE-NAMES or (PACKAGE-NAME VERSION) pairs, and an
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue