10 Commits
Author SHA1 Message Date
John Nguyen f83e9a2566 [Chore] Fix codecov report (#251)
* Move snapshot tests to main scheme

* Update config files

* Fix conditions

* Bump test deployment version

* Fix ignored paths

* Fix ignored paths... again

* Try uploading coverage after each test
2021-03-19 22:07:04 +01:00
Steve Baranskiandrob phillips 69a006cd1b Swift 5.1 Support (#204)
* Updated project for Swift 5.1 support

* Updated xcconfig files & removed superfluous project overrides

* [Example] Update example app settings

Co-authored-by: rob phillips <rob@robphillips.me>
2020-03-03 10:05:14 -10:00
John Nguyen 02d90cc5ff [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 72f7783d51.

* 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 95b2bf1205.

* 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
2019-10-06 08:52:00 +02:00
rob phillips 49b3ebae4d [Swift] Update to Swift 5.0 (#145)
* [Swift] Update to Swift 5.0

* [Swift] Update README

* [CI] Update travis to Xcode 10.2
2019-04-26 19:15:48 -04:00
rob phillips bc65c735bc [Cleanup] Comment docs, example apps, and whitespace (#136)
* [Examples] Clean up example code

* [Code] fileprivate --> private

* [Nits] Modernize code doc formats
2019-04-21 19:35:12 -04:00
Rob Phillips d71ec73d27 [Xcode] Remove teams, specify domain 2018-11-23 12:03:39 -05:00
Chris Zielinski 0c5cd04c76 Fix macOS Platform, Custom URL Scheme Handler, Polish Demos. (#110)
* Fix 'DownView' for the macOS platform.

* Remove unnecessary 'markdownString' property and refactoring (back to original).

* Add 'configuration' parameter to 'DownView' initializer.

* Support custom URL scheme handlers (macOS 10.13+, iOS 11+)

* Move DownView's init 'didLoadSuccessfully' parameter to end to allow trailing closures.

* Document DownView's 'configuration' parameter.

* Add test case for custom URL scheme handler.

* Polish macOS demo

* Polish iOS Demo

* Revert bundle IDs

* Throw '.nonStandardBundleFormatError' instead of ☠️

* Update demos

* Set macOS deployment target to '10.11'
2018-11-23 11:56:31 -05:00
Rob Phillips 2af0b93890 Fix/update example app 2017-10-28 18:18:04 -07:00
Rob Phillips 0b196213dd Update example app to Swift 4 2017-09-28 08:04:44 -07:00
Keaton Burleson e62d91c120 Added an example, closes #37 2017-07-01 18:00:40 -05:00