This is the documentation page for Module:書名

Synopsis edit

{{#invoke:書名 |Syu1meng2 [ |mode=chapter ] }}
{{#invoke:書名 |Zyun1ming4 [ |mode=dotted ] }}
{{#invoke:書名 |Zoek6zung6}}

p .auto_build_citable( book title, chapter title );
p .cvs( value );
p .ref( value );
p .cjk_p( string );
p .array_p( value );

Description edit

This module implements the backend of several templates designed to typeset a number of Chinese-language punctuation marks that are difficult to typeset through normal means. It currently handles the ˈsyˌmiŋˍhou (book titles), ˈdzynˌmiŋˍhou (personal and geographical names) and ˍdzœkˍdzuŋˍhou (emphasis mark). Compatibility with text browsers and screen readers was a priority.

Typeset output aims to follow print. As a result titles marked with type 2 ˈsyˌmiŋˍhou (i.e., sinicized guillemets) are kerned, which is traditional for similar punctuation (for example quotation marks).[1] The module doesn’t actually do any actual formatting, but will add enough structuring and classes for formatting via CSS.

Parameters are normally retrieved directly from the frame’s parent, except when an entry point is shared between two templates, in which case the discriminating parameter is retrieved from the frame. These currently include mode=chapter (chapter title mode) for Syu1meng2 and mode=dotted (transliterated personal names mode) for Zyun1ming4.

Invocation from other modules edit

After importing this module, auto_build_citable can be directly invoked as a method. The method takes 1 to 2 strings (either can be nil) as input and returns a string as output, and is essentially the same as {{#invoke:書名|Syu1meng2}} except no CSS will be requested.

Auxiliaries edit

Other methods are available after importing this module. These include

  • cvs: takes any value as input, returns string as output. Produces a stringified form of the input that’s more useful (similar to PostScript’s cvs operator)
  • cjk_p: takes 1 string as input, returns boolean as output. Determines whether the input strings appears to consist purely of CJK characters.
  • array_p: takes any value as input, returns boolean as output. Determines whether the input appears to be an array.

There is also ref, which takes any value as input, and returns string as output. Similar to type except that if the input is an array, it will try to guess whether it’s a structure returned by parse_title (an internal function), and return “parsed-title” if this is the case.

History edit

This module was created specifically for the Cantonese Wikipedia and was derived from Javascript and PHP code that was already in use at the author’s own site.

Notes edit

This is a mostly complete translation of the original documentation at the Cantonese Wikipedia (in Cantonese). Please refer to the original documentation if you need information that might be more up to date.

The name of the module means “book title”.

See also edit

References edit

  1. See, for example, . Translated by Ān, Píng. "Overview of the Printing and Allied Trades Association in London" 倫敦伯特拉印刷研究所概況. The Graphic Printer 1 (6): 40–47. June 1, 1931. Archived from the original on October 31, 2022. Retrieved October 11, 2022.