|
2 | 2 | @(require scribble/manual "utils.rkt" |
3 | 3 | (for-syntax racket/base) |
4 | 4 | (for-label scribble/manual-struct |
| 5 | + scribble/manual-def |
5 | 6 | racket/list |
| 7 | + racket/format |
| 8 | + racket/serialize |
6 | 9 | version/utils |
7 | 10 | syntax/quote |
8 | 11 | (only-in scribble/html-properties |
@@ -1846,6 +1849,109 @@ signature as a whole to appear right after the signature declaration.} |
1846 | 1849 | Typesets the identifier @racket[id] with a hyperlink to its definition |
1847 | 1850 | as a member of the signature named by @racket[sig-id].} |
1848 | 1851 |
|
| 1852 | +@; ------------------------------------------------------------------------ |
| 1853 | +@section[#:tag "doc-create"]{Defining Documentation Forms} |
| 1854 | + |
| 1855 | +@defmodule[scribble/manual-def]{The |
| 1856 | +@racketmodname[scribble/manual-def] module provides utilities for |
| 1857 | +building new documentation forms like @racket[defform] and |
| 1858 | +@racket[defproc]. See also @racket[boxed-style] and |
| 1859 | +@racket[add-background-label].} |
| 1860 | + |
| 1861 | +@history[#:added "1.64"] |
| 1862 | + |
| 1863 | +@defproc[(make-id-element [id identifier?] |
| 1864 | + [str string?] |
| 1865 | + [defn? any/c] |
| 1866 | + [#:space space (or/c #f symbol?) #f] |
| 1867 | + [#:suffix suffix (or/c #f symbol? serializable?) #f] |
| 1868 | + [#:link-style link-style (or/c #f style?) #f] |
| 1869 | + [#:unlinked-ok? unlinked-ok? any/c #f]) |
| 1870 | + content?]{ |
| 1871 | + |
| 1872 | +Creates an element that typesets @racket[id] as code hyperlinked to |
| 1873 | +its definition. The given @racket[str] is used as the identifier's |
| 1874 | +typeset form, while @racket[id] is used for its @racket[for-label] |
| 1875 | +binding information. If @racket[defn?] is true, the identifier is a |
| 1876 | +typeset as the defining instance (for use in a definition box, |
| 1877 | +normally). |
| 1878 | + |
| 1879 | +The @racket[space] argument indicates a space (in the sense of |
| 1880 | +@racket[only-space-in]) for the binding. The @racket[suffix] argument |
| 1881 | +provides an additional suffix on the documentation key, when not |
| 1882 | +@racket[#f], and it normally should include @racket[space] if |
| 1883 | +@racket[space] is not @racket[#f]. The @racket[suffix] might have |
| 1884 | +additional components to, for example, indicate a name syntactically |
| 1885 | +accessible via @racket[id], such as through a field-selecting dot |
| 1886 | +notation. |
| 1887 | + |
| 1888 | +If @racket[unlinked-ok?] is @racket[#false], then if no link target is |
| 1889 | +found based on the @racket[for-label] binding of @racket[id] in |
| 1890 | +@racket[space], the identifier is typeset as a failed hyperlink. |
| 1891 | +Otherwise, it is typeset without linking. |
| 1892 | + |
| 1893 | +} |
| 1894 | + |
| 1895 | +@defproc[(id-to-target-maker [id identifier?] |
| 1896 | + [dep? any/c] |
| 1897 | + [#:space space (or/c #f symbol?) #f] |
| 1898 | + [#:suffix suffix (or/c #f symbol? serializable?) #f]) |
| 1899 | + (content? (-> tag? content?) . -> . content?)]{ |
| 1900 | + |
| 1901 | +Produces a function to wrap content as a cross-reference link target |
| 1902 | +for the defining instance of the binding indicated by @racket[id], |
| 1903 | +@racket[space] and @racket[suffix]---which are used as in |
| 1904 | +@racket[make-id-element]. |
| 1905 | + |
| 1906 | +The resulting @racket[_make-target] procedure expects content that is |
| 1907 | +used before the @tech{resolve pass} (e.g., to extract content text) |
| 1908 | +plus a procedure that takes a cross-reference tag and produces a |
| 1909 | +content representing the specific cross reference target. The |
| 1910 | +procedure passed to @racket[_make-target] receives a tag representing |
| 1911 | +the binding, and it typically generates a @racket[target-element] |
| 1912 | +(possibly a @racket[toc-target2-element]) using that tag. The |
| 1913 | +generated @racket[target-element] may also include indexing |
| 1914 | +information using the same tag, and where |
| 1915 | +@racket[with-exporting-libraries] is used to construct the index |
| 1916 | +description. |
| 1917 | + |
| 1918 | +} |
| 1919 | + |
| 1920 | +@defproc[(id-to-form-target-maker [id identifier?] |
| 1921 | + [dep? any/c] |
| 1922 | + [#:space space (or/c #f symbol?) #f] |
| 1923 | + [#:suffix suffix (or/c #f symbol? serializable?) #f]) |
| 1924 | + (content? (-> tag? content?) . -> . content?)]{ |
| 1925 | + |
| 1926 | + Like @racket[id-to-target-maker], but intended for syntactic forms |
| 1927 | + instead than value bindings. In the default manual style, both are |
| 1928 | + style the same. |
| 1929 | + |
| 1930 | +} |
| 1931 | + |
| 1932 | + |
| 1933 | +@defproc[(annote-exporting-library [content content?] |
| 1934 | + [#:format-module-path fmt (any/c . -> . string?) ~s]) |
| 1935 | + content?]{ |
| 1936 | + |
| 1937 | +Wraps content for a defining instance of some identifier to indicate |
| 1938 | +the module path that exports the identifier. This module will be |
| 1939 | +determined via @racket[defmodule] or @racket[declare-exporting] in an |
| 1940 | +enclosing section. |
| 1941 | + |
| 1942 | +} |
| 1943 | + |
| 1944 | +@defproc[(with-exporting-libraries [make-desc (list? . -> . exported-index-desc?)]) |
| 1945 | + delayed-index-desc?]{ |
| 1946 | + |
| 1947 | +Creates an index description that incorporates information about |
| 1948 | +relevant modules. Relevant module paths will be determined via |
| 1949 | +@racket[defmodule] or @racket[declare-exporting] in an enclosing |
| 1950 | +section and passed to @racket[make-desc], whose result will replace |
| 1951 | +the result of @racket[with-exporting-libraries] for indexing. |
| 1952 | + |
| 1953 | +} |
| 1954 | + |
1849 | 1955 | @; ------------------------------------------------------------------------ |
1850 | 1956 | @section[#:tag "doc-strings"]{Various String Forms} |
1851 | 1957 |
|
@@ -2257,6 +2363,20 @@ initial deprecation message.} |
2257 | 2363 |
|
2258 | 2364 | An alias for @racket[image] for backward compatibility.} |
2259 | 2365 |
|
| 2366 | +@defthing[boxed-style style?]{ |
| 2367 | + |
| 2368 | +The style used for a @racket[table] for defining a binding, such as |
| 2369 | +the one produced by @racket[defform] or @racket[defproc]. |
| 2370 | + |
| 2371 | +} |
| 2372 | + |
| 2373 | +@defproc[(add-background-label [kind string?]) |
| 2374 | + (-> (list/c block?) block?)]{ |
| 2375 | + |
| 2376 | +Produces a function that adds a label to a block in the same way as |
| 2377 | +the block produces by @racket[defform], @racket[defproc], etc. The |
| 2378 | +block is provided in a flow that has a single block.} |
| 2379 | + |
2260 | 2380 | @; ------------------------------------------------------------------------ |
2261 | 2381 | @section[#:tag "index-entries"]{Index-Entry Descriptions} |
2262 | 2382 |
|
|
0 commit comments