Skip to content

Commit e5a49e8

Browse files
committed
documentation: Fix :macrocall: markup
The old way was to use `.. code-block:: dylan` followed by an example using `*` where it wanted italics. But inside code-block `*` isn't recognized, so this came out looking like lots of global variables. The new way used `.. parsed-literal:: ` (note the trailing space) followed by an example using backquotes to create italics. This has the additional advantage that when editing the source in emacs the italicized parts are colorized, but only when that trailing space is present in the parsed-literal directive! Go figure. (There's some risk that Future Me will compulsively do M-x delete-trailing-whitespace and break that.)
1 parent 473dc3d commit e5a49e8

File tree

10 files changed

+195
-222
lines changed

10 files changed

+195
-222
lines changed

documentation/library-reference/source/c-ffi/index.rst

+75-76
Original file line numberDiff line numberDiff line change
@@ -1285,9 +1285,9 @@ these classes.
12851285
designator class name.
12861286

12871287
:macrocall:
1288-
.. code-block:: dylan
1288+
.. parsed-literal::
12891289
1290-
define C-pointer-type *pointer-class-name* => *designator-class-name*
1290+
define C-pointer-type `pointer-class-name` => `designator-class-name`
12911291
12921292
:parameter pointer-class-name: A Dylan variable name.
12931293
:value designator-class: A Dylan name.
@@ -2263,27 +2263,27 @@ Defining specialized versions of designator classes
22632263
existing designator class for that type.
22642264

22652265
:macrocall:
2266-
.. code-block:: dylan
2266+
.. parsed-literal::
22672267
2268-
define [*modifiers* *] C-subtype name (superclasses)
2269-
[*slot-spec* ; ...] [;]
2270-
[*type-options* ] [;]
2271-
end [C-subtype] [*name* ]
2268+
define [`modifiers`] C-subtype `name` (`superclasses`)
2269+
[`slot-spec` ; ...] [;]
2270+
[`type-options` ] [;]
2271+
end [C-subtype] [name]
22722272
2273-
:parameter modifiers: The same as the modifiers allowed in :drm:`define class <class>`.
2273+
:parameter modifiers: The same as the modifiers allowed in :drm:`define class`.
22742274
:parameter name: A Dylan variable name.
22752275
:parameter superclasses: A list of Dylan names.
2276-
:parameter slot-spec: Same syntax as a slot definition in ``define class``.
2276+
:parameter slot-spec: Same syntax as a slot definition in :drm:`define class`.
22772277
:parameter type-options: A property list.
22782278

22792279
:description:
22802280

22812281
Defines a specialized designator class for a C type based on an
22822282
existing designator class for that type. It does this by defining a
22832283
subclass of the original designator class, and is a simple wrapper
2284-
around :drm:`define class <class>` from which it takes its syntax. The
2285-
superclasses, slot-specs, and *modifiers* are passed on to ``define
2286-
class`` unchanged. In effect, it expands to:
2284+
around :drm:`define class` from which it takes its syntax. The
2285+
superclasses, slot-specs, and *modifiers* are passed on to :drm:`define
2286+
class` unchanged. In effect, it expands to:
22872287

22882288
.. code-block:: dylan
22892289
@@ -2295,7 +2295,7 @@ Defining specialized versions of designator classes
22952295
single: define C-subtype definition macro
22962296
single: define C-subtype; define C-subtype
22972297

2298-
In terms of C, ``define C-subtype`` can be thought of as
2298+
In terms of C, :macro:`define C-subtype` can be thought of as
22992299
implementing a strongly typed version of ``typedef`` because a new
23002300
designator class is generated that Dylan's type system can
23012301
distinguish from the designator class on which it was based. As
@@ -2427,20 +2427,20 @@ Defining specialized designator classes
24272427
Allows you to define a name to which to bind a pointer designator.
24282428

24292429
:macrocall:
2430-
.. code-block:: dylan
2430+
.. parsed-literal::
2431+
2432+
define [`modifier` ...] C-mapped-subtype `type-name` (`superclass` )
2433+
[map `high-level-type`
2434+
[, import-function: `import-fun` ]
2435+
[, export-function: `export-fun` ];]
2436+
[import-map `high-level-type`,
2437+
import-function: `import-fun` ;]
2438+
[export-map `high-level-type`,
2439+
export-function: `export-fun` ;]
2440+
[`type-options`]
2441+
end
24312442
2432-
define *modifiers* C-mapped-subtype *type-name* (*superclasses*)
2433-
[map *high-level-type*
2434-
[, import-function: *import-fun* ]
2435-
[, export-function: *export-fun* ];]
2436-
[import-map *high-level-type*,
2437-
import-function: *import-fun* ;]
2438-
[export-map *high-level-type*,
2439-
export-function: *export-fun* ;]
2440-
[type-options]
2441-
end
2442-
2443-
:parameter modifiers: The same as the modifiers allowed in :drm:`define-class <class>`.
2443+
:parameter modifiers: The same as the modifiers allowed in :drm:`define-class`.
24442444
:parameter type-name: A Dylan variable name.
24452445
:parameter superclasses: A list of Dylan names.
24462446
:parameter high-level-type: An instance of a Dylan :drm:`<type>`.
@@ -2653,12 +2653,12 @@ Describing structure types
26532653
Describes C's aggregate structures.
26542654

26552655
:macrocall:
2656-
.. code-block:: dylan
2656+
.. parsed-literal::
26572657
2658-
define C-struct *name*
2659-
[*slot-spec* ; ...] [;]
2660-
[*type-options* ] [;]
2661-
end [C-struct] [*name* ]
2658+
define C-struct `name`
2659+
[`slot-spec` ; ...] [;]
2660+
[`type-options`] [;]
2661+
end [C-struct] [`name`]
26622662
26632663
:parameter name: A Dylan variable name.
26642664
:parameter slot-spec:
@@ -2831,12 +2831,12 @@ Describing union types
28312831
Describes C union types to the *c-ffi*.
28322832

28332833
:macrocall:
2834-
.. code-block:: dylan
2834+
.. parsed-literal::
28352835
2836-
define C-union *name*
2837-
[*slot-spec* ; ...] [;]
2838-
[*type-options* ] [;]
2839-
end [C-union] [*name* ]
2836+
define C-union `name`
2837+
[`slot-spec` ; ...] [;]
2838+
[`type-options` ] [;]
2839+
end [C-union] [`name`]
28402840
28412841
:parameter name: A Dylan variable name.
28422842
:parameter slot-spec:
@@ -2969,13 +2969,13 @@ Describing C functions to Dylan
29692969
Describes a C function to the *c-ffi*.
29702970

29712971
:macrocall:
2972-
.. code-block:: dylan
2972+
.. parsed-literal::
29732973
2974-
define C-function *name*
2975-
[*parameter-spec*; ...]
2976-
[*result-spec*;]
2977-
[*function-option*, ...;]
2978-
end [C-function] [*name*]
2974+
define C-function `name`
2975+
[`parameter-spec`; ...]
2976+
[`result-spec`;]
2977+
[`function-option`, ...;]
2978+
end [C-function] [`name`]
29792979
29802980
:parameter name: A Dylan variable name.
29812981
:parameter parameter-spec:
@@ -2994,7 +2994,7 @@ Describing C functions to Dylan
29942994
.. index::
29952995
single: definition macros; define C-function
29962996

2997-
The result of processing a ``define C-function`` definition is a
2997+
The result of processing a :macro:`define C-function` definition is a
29982998
Dylan function which is bound to name. This function takes Dylan
29992999
objects as arguments, converting them to their C representations
30003000
according to the types declared for the parameters of the C
@@ -3066,7 +3066,7 @@ Describing C functions to Dylan
30663066
Dylan function corresponding to each *input* *output* parameter of
30673067
the C function that is specialized as the union of the export type
30683068
of the referenced type of the type given for the parameter in
3069-
``define c-function``, and :drm:`#f`. When the C function returns, the
3069+
:macro:`define c-function`, and :drm:`#f`. When the C function returns, the
30703070
value in the location is accessed and returned as an extra result
30713071
from the Dylan function. If an *input* *output* parameter is passed
30723072
as :drm:`#f` from Dylan then a ``NULL`` pointer is passed to the C
@@ -3188,7 +3188,7 @@ Describing C functions to Dylan
31883188
.. index::
31893189
single: define C-callable-wrapper definition macro
31903190

3191-
In effect, a ``define C-function`` such as:
3191+
In effect, a :macro:`define C-function` such as:
31923192

31933193
.. code-block:: dylan
31943194
@@ -3235,14 +3235,13 @@ Describing Dylan functions for use by C
32353235
the function.
32363236

32373237
:macrocall:
3238-
.. code-block:: dylan
3238+
.. parsed-literal::
32393239
3240-
define C-callable-wrapper [*dylan-rep-name* ]
3241-
of *dylan-function*
3242-
[*parameter-spec* ; ...] [;]
3243-
[*result-spec* ] [;]
3244-
[*function-options* ][;]
3245-
end [C-callable-wrapper]
3240+
define C-callable-wrapper [`dylan-rep-name`] of `dylan-function`
3241+
[`parameter-spec` ; ...] [;]
3242+
[`result-spec` ] [;]
3243+
[`function-options` ][;]
3244+
end [C-callable-wrapper]
32463245
32473246
:parameter dylan-rep-name: A Dylan variable name.
32483247
:parameter dylan-function: An instance of :drm:`<function>`.
@@ -3264,7 +3263,7 @@ Describing Dylan functions for use by C
32643263
single: define C-function definition macro
32653264
single: definition macros; define C-callable wrapper
32663265

3267-
The result of processing a ``define C-callable-wrapper`` definition
3266+
The result of processing a :macro:`define C-callable-wrapper` definition
32683267
is a function with a C entry point with the contract described.
32693268
This function takes C values as arguments, converting them to Dylan
32703269
representations according to the types declared for the parameters
@@ -3405,7 +3404,7 @@ Describing Dylan functions for use by C
34053404
.. index::
34063405
single: definition macros; define C-callable wrapper
34073406

3408-
In effect, a ``define C-callable-wrapper`` such as:
3407+
In effect, a :macro:`define C-callable-wrapper` such as:
34093408

34103409
.. code-block:: dylan
34113410
@@ -3469,13 +3468,13 @@ of that bridge are implemented within this library.
34693468
Describe Objective C selectors to the *c-ffi*.
34703469

34713470
:macrocall:
3472-
.. code-block:: dylan
3471+
.. parsed-literal::
34733472
3474-
define objc-selector *name*
3475-
[*parameter-spec*; ...]
3476-
[*result-spec*;]
3477-
[*function-option*, ...;]
3478-
end [C-function] [*name*]
3473+
define objc-selector `name`
3474+
[`parameter-spec`; ...]
3475+
[`result-spec`;]
3476+
[`function-option`, ...;]
3477+
end [C-function] [`name`]
34793478
34803479
:parameter name: A Dylan variable name.
34813480
:parameter parameter-spec:
@@ -3524,11 +3523,11 @@ This section covers describing and accessing C variables.
35243523
Describes C variables to the *c-ffi*.
35253524

35263525
:macrocall:
3527-
.. code-block:: dylan
3526+
.. parsed-literal::
35283527
3529-
define C-variable *getter-name* :: *c-type*
3530-
#key *setter* *c-name* import: *boolean*
3531-
end [C-variable]
3528+
define C-variable `getter-name` :: `c-type`
3529+
#key `setter` `c-name` import: `boolean`
3530+
end [C-variable]
35323531
35333532
:parameter getter-name: A Dylan variable name.
35343533
:parameter c-type: A Dylan name.
@@ -3569,7 +3568,7 @@ This section covers describing and accessing C variables.
35693568
translation is not so simple. A C union or struct has no direct
35703569
representation in Dylan. You may only have a reference to the C
35713570
object in Dylan through a :class:`<c-pointer>` object. For this
3572-
reason, ``define c-variable`` is not permitted for variables with C
3571+
reason, :macro:`define c-variable` is not permitted for variables with C
35733572
aggregate types. Use :macro:`define C-address` for those variables.
35743573

35753574
:example:
@@ -3612,11 +3611,11 @@ This section covers describing and accessing C variables.
36123611
the location of a C global variable.
36133612

36143613
:macrocall:
3615-
.. code-block:: dylan
3614+
.. parsed-literal::
36163615
3617-
define C-address *name* :: *pointer-designator-type*
3618-
#key *c-name* import: *boolean*
3619-
end [C-address] [*name* ]
3616+
define C-address `name` :: `pointer-designator-type`
3617+
#key `c-name` import: `boolean`
3618+
end [C-address] [`name`]
36203619
36213620
:parameter name: A Dylan variable name.
36223621
:parameter pointer-designator-type:
@@ -3786,11 +3785,11 @@ function :func:`destroy`.
37863785
Allocates an object within the scope of the body of the code.
37873786

37883787
:macrocall:
3789-
.. code-block:: dylan
3788+
.. parsed-literal::
37903789
3791-
with-stack-structure (*name* :: *wrapper-type*
3792-
#key *element-count* *extra-bytes*)
3793-
*body*
3790+
with-stack-structure (`name` :: `wrapper-type`
3791+
#key `element-count` `extra-bytes`)
3792+
`body`
37943793
end [with-stack-structure]
37953794
37963795
:parameter name: A Dylan variable name.
@@ -3904,10 +3903,10 @@ using :macro:`define c-mapped-subtype`.
39043903
Passes a C pointer to the contents of a :drm:`<byte-string>`.
39053904

39063905
:macrocall:
3907-
.. code-block:: dylan
3906+
.. parsed-literal::
39083907
3909-
with-c-string (*variable* = *string-valued-expression*)
3910-
*body*
3908+
with-c-string (`variable` = `string-valued-expression`)
3909+
`body`
39113910
end
39123911
39133912
:parameter variable: A Dylan variable name.

documentation/library-reference/source/collections/plists.rst

+8-13
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,8 @@ Reference
7979
Modify the *plist*, adding *indicator* with the given *value*.
8080

8181
:macrocall:
82-
.. code-block:: dylan
83-
84-
put-property!(*plist*, *indicator*, *value*)
82+
.. parsed-literal::
83+
put-property!(`plist`, `indicator`, `value`)
8584
8685
:parameter plist: An instance of :drm:`<sequence>`.
8786
:parameter indicator: An instance of :drm:`<object>`.
@@ -120,9 +119,8 @@ Reference
120119
if any.
121120

122121
:macrocall:
123-
.. code-block:: dylan
124-
125-
remove-property!(*plist*, *indicator*)
122+
.. parsed-literal::
123+
remove-property!(`plist`, `indicator`)
126124
127125
:parameter plist: An instance of :drm:`<sequence>`.
128126
:parameter indicator: An instance of :drm:`<object>`.
@@ -157,16 +155,13 @@ Reference
157155
:statement:
158156

159157
:macrocall:
160-
.. code-block:: dylan
161-
162-
with-keywords-removed(*var* = *plist*, *keywords*)
163-
*body*
164-
end
158+
.. parsed-literal::
159+
with-keywords-removed(`var` = `plist`, `keywords`) `body` end
165160
166-
:parameter var: A Dylan name *bnf*.
161+
:parameter var: A Dylan name *BNF*.
167162
:parameter plist: An instance of :drm:`<sequence>`.
168163
:parameter keywords: An instance of :drm:`<sequence>`.
169-
:parameter body: A Dylan body *bnf*.
164+
:parameter body: A Dylan body *BNF*.
170165

171166
:description:
172167

0 commit comments

Comments
 (0)