diff options
author | wl <wl> | 2013-07-31 20:31:58 +0000 |
---|---|---|
committer | wl <wl> | 2013-07-31 20:31:58 +0000 |
commit | 81644eb09ab37c9d7c07965da199165c217c1d6e (patch) | |
tree | 19604e21d41969c66e54f371eae0fbb12f2fa3eb /tmac | |
parent | 71c84038822aae6954f01a7804d5aa8cca8af7bb (diff) | |
download | groff-81644eb09ab37c9d7c07965da199165c217c1d6e.tar.gz |
[mdoc] Implement `.%C'.
* tmac/doc.tmac, tmac/doc-common: Do it.
* tmac/groff_mdoc.man: Updated.
Diffstat (limited to 'tmac')
-rw-r--r-- | tmac/doc-common | 1 | ||||
-rw-r--r-- | tmac/doc.tmac | 69 | ||||
-rw-r--r-- | tmac/groff_mdoc.man | 8 |
3 files changed, 75 insertions, 3 deletions
diff --git a/tmac/doc-common b/tmac/doc-common index 6372a239..a82502c5 100644 --- a/tmac/doc-common +++ b/tmac/doc-common @@ -37,6 +37,7 @@ . .nr %A 1 .nr %B 1 +.nr %C 1 .nr %D 1 .nr %I 1 .nr %J 1 diff --git a/tmac/doc.tmac b/tmac/doc.tmac index bbec7c5b..e434eaf6 100644 --- a/tmac/doc.tmac +++ b/tmac/doc.tmac @@ -3423,6 +3423,8 @@ . . nr doc-book-count-saved \n[doc-book-count] . ds doc-book-name-saved "\*[doc-book-name] +. nr doc-city-count-saved \n[doc-city-count] +. ds doc-city-name-saved "\*[doc-city-name] . nr doc-date-count-saved \n[doc-date-count] . ds doc-date-saved "\*[doc-date] . nr doc-publisher-count-saved \n[doc-publisher-count] @@ -3565,6 +3567,8 @@ . . nr doc-book-count \n[doc-book-count-saved] . ds doc-book-name "\*[doc-book-name-saved] +. nr doc-city-count \n[doc-city-count-saved] +. ds doc-city-name "\*[doc-city-name-saved] . nr doc-date-count \n[doc-date-count-saved] . ds doc-date "\*[doc-date-saved] . nr doc-publisher-count \n[doc-publisher-count-saved] @@ -5190,6 +5194,8 @@ .\" NS doc-author-nameXXX .\" NS doc-book-count .\" NS doc-book-name +.\" NS doc-city-count +.\" NS doc-city-name .\" NS doc-corporate-count .\" NS doc-corporate-name .\" NS doc-date @@ -5228,6 +5234,7 @@ . nr doc-reference-title-count 0 . nr doc-url-count 0 . nr doc-volume-count 0 +. nr doc-city-count 0 . nr doc-date-count 0 . nr doc-page-number-count 0 . nr doc-book-count 0 @@ -5243,6 +5250,7 @@ . ds doc-reference-title-name-for-book . ds doc-url-name . ds doc-volume-name +. ds doc-city-name . ds doc-date . ds doc-page-number-string . ds doc-book-name @@ -5357,6 +5365,13 @@ . doc-finish-reference \n[doc-corporate-count] . \} . +. if \n[doc-city-count] \{\ +. unformat doc-city-name +. chop doc-city-name +. nop \*[doc-city-name]\c +. doc-finish-reference \n[doc-city-count] +. \} +. . if \n[doc-date-count] \{\ . unformat doc-date . chop doc-date @@ -5528,6 +5543,60 @@ .. . . +.\" NS doc-city-count global register +.\" NS counter of city references +. +.nr doc-city-count 0 +. +. +.\" NS doc-city-name global box +.\" NS string of collected city references +. +.ds doc-city-name +. +. +.\" NS %C user macro +.\" NS [reference] city +.\" NS +.\" NS modifies: +.\" NS doc-arg-ptr +.\" NS doc-curr-font +.\" NS doc-curr-size +.\" NS doc-city-count +.\" NS doc-macro-name +.\" NS doc-reference-count +.\" NS +.\" NS local variables: +.\" NS doc-env-%C +.\" NS +.\" NS width register `%C' set in doc-common +. +.de %C +. if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\ +. tm Usage: .%C city_name ... (#\n[.c]) +. return +. \} +. +. nr doc-city-count +1 +. nr doc-reference-count +1 +. +. ds doc-macro-name %C +. doc-parse-args \$@ +. +. nr doc-arg-ptr +1 +. nr doc-curr-font \n[.f] +. nr doc-curr-size \n[.ps] +. +. \" append to reference box +. boxa doc-city-name +. ev doc-env-%C +. evc 0 +. in 0 +. nf +. doc-do-references +.. +. +. .\" NS doc-date-count global register .\" NS counter of date references . diff --git a/tmac/groff_mdoc.man b/tmac/groff_mdoc.man index 43c61d3e..c3ad6b42 100644 --- a/tmac/groff_mdoc.man +++ b/tmac/groff_mdoc.man @@ -2637,7 +2637,7 @@ Reference author name; one name per invocation. .It Li .%B Book title. .It Li .%C -City/place (not implemented yet). +City/place. .It Li .%D Date. .It Li .%I @@ -2684,7 +2684,8 @@ Example: \&.%A "John Foo" \&.%T "Implementation Notes on foobar(1)" \&.%R "Technical Report ABC\-DE\-12\-345" -\&.%Q "Drofnats College, Nowhere" +\&.%Q "Drofnats College" +\&.%C "Nowhere" \&.%D "April 1991" \&.Re .Ed @@ -2697,7 +2698,8 @@ produces .%A "John Foo" .%T "Implementation Notes on foobar(1)" .%R "Technical Report ABC-DE-12-345" -.%Q "Drofnats College, Nowhere" +.%Q "Drofnats College" +.%C "Nowhere" .%D "April 1991" .Re .Ed |