Skip to content

API for adornments #988

Description

@Ducasse

figures, math equations and a code block can offers a caption.
We should be able to access these in a polymorphic way.

See the code of the MicLastPeriodInCaptionChecker class.

Here is a test for such functionality

generateFilesystemExample

	| file |
	file := fileSystem workingDirectory / 'codeCaptionMissingPeriod.md'.
	file writeStreamDo: [ :stream |
			stream nextPutAll: '

```caption=This is the famous missing period
setX: xInt setY: yInt

	...
```' ].

	file := fileSystem workingDirectory / 'figureCaptionMissingPeriod.md'.
	file writeStreamDo: [ :stream |
			stream nextPutAll: '

![This is the famous missing period](figures/f.png)
' ].

	file := fileSystem workingDirectory / 'equationCaptionMissingPeriod.md'.
	file writeStreamDo: [ :stream |
			stream nextPutAll: '
$$%caption=This is the famous missing period
\frac{1}{2}
$$
].
' ].

	file := fileSystem workingDirectory / 'codeCaptionEndingWithPeriod.md'.
	file writeStreamDo: [ :stream |
			stream nextPutAll: '

```caption=This is the famous correctly ending period.
setX: xInt setY: yInt

	...
```' ].

	file := fileSystem workingDirectory / 'figureCaptionEndingWithPeriod.md'.
	file writeStreamDo: [ :stream |
			stream nextPutAll: '

![This is the famous correctly ending period.](figures/f.png)
' ].

	file := fileSystem workingDirectory / 'equationCaptionEndingWithPeriod.md'.
	file writeStreamDo: [ :stream |
			stream nextPutAll: '
$$%caption=This is the famous correctly ending period.
\frac{1}{2}
$$
].
' ]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions