Repository navigation
Add style options for lists, task boxes, quotes, inline code and table headers - #33
Merged
Merged
Conversation
An app can now set the format, the weight and the color of the numbers of ordered list items. The defaults keep the numbers as the Markdown wrote them, in the body font and the text color. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An app can now set the bullet text and the bullet color for each list level. Levels past the end of a list use its last value. The defaults keep the bullets of today in the text color. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An app can now set the fill of a checked task box, its check mark, and the outline of an unchecked task box. The defaults keep the blue box, the white check mark and the text-colored outline of today. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An app can now set the color and the width of the quote bar, and the color of the text in a quote. The quote text color also applies to list markers, task box outlines and formulas inside the quote. Links, code colors and custom tags' colors win over it. The defaults keep the 3-point bar in the accent color and the text color of today. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An app can now set a fill behind inline code, and its corner radius. The fill is drawn like a custom tag's highlight, and a tag's highlight wins over it. The fill does not change the line breaks. The default draws no fill, as today. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An app can now set the fill behind the header row of a table, and the weight of its text. The column widths are measured with that weight. The defaults keep the code background fill and the bold body font of today. Table cells still wrap as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A table header weight of 0.3 or more now makes inline code in the header bold. Before, the code font replaced the weighted system font, so the code span was lighter than with the default weight. Other changes: - A negative quoteBarWidth draws no bar. Before, the bar drew to the left of its quote. - The doc comments and the README say that list numbers, bullets and unchecked task boxes use quoteTextColor in a block quote. - The default bullets are in one place. - The style fields are in the README order: lists, task boxes, quotes, inline code, table headers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The doc comment of taskCheckedColor gave the default as red 0, green 0.478, blue 1. That TranscriptColor draws in a different blue than the default fill. The comment now says only that the default is a system-like blue. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 3 of a stack of 13 pull requests. The base is #32 (
feature/ios-view-tests). #31 (part 1) tells how to merge the stack.On this stacked branch,
swift testpasses (209 tests), and the iOS build and build-for-testing pass.Summary
An app often must match a Markdown look that it already has. This change adds style fields to
TranscriptStylefor lists, task boxes, block quotes, inline code and table headers. Each default keeps the look of today, so an app that sets none of the fields sees no change.listNumberFormat(aTranscriptListNumberFormat:.asWritten,.period,.parenthesisor.custom(prefix:suffix:)),listNumberWeightandlistNumberColor.bulletsandbulletColors, one value for each list level. Levels past the end use the last value.taskCheckedColor,taskCheckmarkColorandtaskUncheckedColor.quoteBarColor,quoteBarWidthandquoteTextColor. The quote text color also applies to list markers, task box outlines and formulas in the quote. Links, code colors and custom tags' colors win over it.inlineCodeBackgroundColorandinlineCodeCornerRadius. The fill does not change the line breaks. A custom tag's highlight wins over it.tableHeaderBackgroundColorandtableHeaderWeight. The column widths use the header weight.TranscriptFont.weightscale. For a named body font, a weight of 0.3 or more uses its bold face.taskCheckedColorgives no color value for the default.Tests
swift teston macOS: 193 tests pass. The new tests inStyleOptionsTests.swiftcheck the marker text, the font weights and the colors. They count the pixels of the new fills, also in dark.xcodebuild build -scheme TranscriptKit -destination 'generic/platform=iOS' CODE_SIGNING_ALLOWED=NO: passes.Checked on an iPhone 12 mini
A check screen in a local test app ran on main first (2 runs). There, the new fields do not exist, and a live change of the style does nothing. Then it ran on this branch (5 runs). Stand-ins: dark mode is a trait override on the window. The check reads the accessibility labels from the view, and does not hear them.
Not checked
Known limits
listNumberFormat = .period, VoiceOver still reads "1)". The screen shows "1.", but the accessibility label of the item is "1) first".🤖 Generated with Claude Code