lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

dealing with unindented docstrings


From: Mark Polesky
Subject: dealing with unindented docstrings
Date: Fri, 21 Aug 2009 19:20:24 -0700 (PDT)

The unindented docstrings in define-markup-commands.scm make it
hard for me to see where definitions start and end:

-------------

(define-builtin-markup-command (fontCaps layout props arg)
  (markup?)
  font
  ()
  "Set @code{font-shape} to @code{caps}

Note: @code{\\fontCaps} requires the installation and selection of
fonts which support the @code{caps} font shape."
  (interpret-markup layout (prepend-alist-chain 'font-shape 'caps props) arg))

-------------

IIUC, the implicit newlines in the strings are significant WRT
texinfo commands, but are ignored for normal text, during document
generation. With this understanding, I came up with the idea of
defining a scheme procedure to take any number of strings, add a
newline to each, and then append them all into one string:

(define (string-append-with-newlines . strings)
  (apply string-append
         (map (lambda (str) (string-append str "\n"))
              strings)))

This procedure could then be used in the markup-command
definitions to keep the docstrings indented (without adding
extra spaces in the docs), which would improve the legibility
of the file:

(define-builtin-markup-command
  (fontCaps layout props arg)
  (markup?)
  font
  ()
  (string-append-with-newlines
    "Set @code{font-shape} to @code{caps}"
    ""
    "Note: @code{\\fontCaps} requires the installation and selection of"
    "fonts which support the @code{caps} font shape.")
  (interpret-markup
    layout
    (prepend-alist-chain 'font-shape 'caps props)
    arg))

Any reason why this would be a bad idea?
Anyone like the idea? Dislike it?

Thanks.
- Mark



      




reply via email to

[Prev in Thread] Current Thread [Next in Thread]