Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature] Create default
Styler
for attributed string rendering (#177)
* Add stubs * Add some helper methods * Add very basic styling * Add custom dynamic type for code * Clean up * Allow DebugVisitor methods to be overridden * Add method to calculate list depth * Pass the list nest depth to the styler * Move nest depth property to base node * Add helper to get parent * Add property to check for top level paragraphs * Add test * Pass top level flag to paragraph styler * Only add pargraph style for top level paragraphs * Create ListItemPrefixGenerator * Use list item prefix generator * Fix debug description * WIP: list item styling * Add tests * Tidy up * Use paragraph separator code point * Add list markers * Add todo * Add tests * Tidy up * Calculate ranges of paragraphs excluding lists * Add item styling stubs * Format indentation of nested liists * Refactor item styling * Return self if prefix length exceeds bounds * Add spacing after heading * Tidy up * Add todo * Organize tests * Rename method * Add test stubs * Add tests * Reorganize files * Add tests * Loosen coupling between List and ListItemPrefixGenerator * Add snapshot testing framework * Bump minimum deployment to iOS 10 for test target * Refactor FontBook into FontCollection * Inject fonts into DefaultStyler * Create ParagraphStyleCollection & inject into DefaultStyler * Tidy up * Create ColorCollection & inject into Default Styler * Style block quote * Style code blocks * Add colors to headings, text and inline code * Move AttributeCollection into new file * Organize file structure * Rename item paragraph styler * Style list item prefix in the styler * Make ListItemParagraphStyler configurable * Add base test suite for styler * Tidy up * Add test stubs for list items * Fix prefix indentation * Add item prefix tests * Allow styler properties to be externally configured * Refactor styler test suite * Make ListItemParargraphStyler a class * Clean up * Add new item styling tests * Ignore some test stubs * Use snapshots for visitor tests * Add snapshots for strong, emphasized, code and html styles * Clean up * Explicitly set point size after adding font trait * Add monospace trait to font extension * Allow monospace font in headings * Use heading level when styling * Make test properties private * Add heading style tests * Add todos * Use line separators in code blocks * Add code paragraph style * Add support for custom thematic break attribute * Add DownTextView * Add thematic break to color collection * Add test for thematic break style * Append newline instead of line separator after thematic break * Add support for custom quote stripe attribute * Translate thematic break rect to container origin * Translate stripe by container origin * Clean up * Remove insets property & use origin parameter * Clean up * Add quote stripe options * Move list item options to new file * Add quote styling tests * Allow thematic break to be configured * Test thematic break preservation in block quote * Add todos * Add some more extension methods * Add support for rendering quotes in a list * Incrementally indent list items * Fix quote indentation in list item * Rename methods * Clean up * Add test * Fix line break after code blocks * Add code block style tests * Add assert helper * Clean up tests * Set text container inset before fitting size to content * Extract DownDebugLayoutManager and DownDebugTextView * Allow snapshots to show line fragments * Add color to links * Add link style tests * Clean up file structure * Remove redundant imports * Clean up file structure * Fix DownTextView init * Draw line fragments in DownDebugLayoutManager * Add debug style tests * Clean up file structure * Remove isTopLevel from Paragraph * Remove nestDepth from list item * Remove unused extension method * Remove unused attribute keys * Provide public init for ThematicBreakOptions * Move max prefix width calculation to ListItemParagraphStyler * Rename DefaultStyler to DownStyler * Extract styles into a configuration struct * Clean up * Clean up * Remove AttributeCollection * Remove color from QuoteStripeOptions * Clean up * Remove defaults from custom attributes * Render markdown within DownTextView * Fix quote stripe rendering * Revert "Fix quote stripe rendering" This reverts commit 72f7783. * Tidy up * Enrich code blocks with background color * Remove redundant initializers * Add CodeBlockOptions * Clean up * Make extension local and private * Remove some duplication * Rename method * Move non private extensions into new files * Remove duplication * Clean up * Add tests * Rename method * Add tests * Fix prefix generation * Add tests * File organization * Add tests * Clean up * Remove duplicate comment * Flatten code & html block descriptions into single line * Add tests * Clean up * Remove dynamic fonts * Initial steps to support macOS & tvOS * Rename font traits * Further support for macOS * Clean up * Use iPhone Xs simulator when testings on Travis * Clean up old todos * Add Styler documentation * Add documentation * Make setter private * Remove duplication * Fix typo * Name magic numbers * Make FontCollection and ColorCollection protocols * Return self instead of nil * Mark feature unavailable for watchOS * Update to snapshot testing 1.6 * Check in snapshot testing framework for iOS * Re-record list item snapshots * Remove old TODO * Fix compiler error for macOS * Compile snapshot tests for iOS only * Specify Xcode 11 for CI * Move snapshot tests into separate test target * Revert "Compile snapshot tests for iOS only" This reverts commit 95b2bf1. * Run snapshot tests on CI * Fix travis config * Fix travis config again * Fix missing file error * Re-record snapshots on iPhone 11 * Update travis config * slather DownShapshotTests * Provide explicit types in styler configuration * [Copyright] Update org name and years * [CI] Try using Codecov for merged reports * [Travis] Try doing Codecov after each slather * [Xcode] Share DownSnapshotTests scheme w/ code coverage * [CI] Use separate codecov report dirs * [CI] Don't slather, just use codecov
- Loading branch information