Skip to content
This repository has been archived by the owner on Jun 5, 2019. It is now read-only.

Custom indentation #18

Merged
merged 1 commit into from
Nov 9, 2016
Merged

Custom indentation #18

merged 1 commit into from
Nov 9, 2016

Conversation

sahandnayebaziz
Copy link
Owner

Originally introduced by @Evertt in #9.

The Renderable protocol now has a new signature for the render method that outputs formatted, space-indented HTML.

func render(startingWithSpaces: Int, indentingWithSpaces: Int) -> String

Now any type that conforms to Renderable can be rendered with specific formatting like so:

head { title { "hello world." } }.render(startingWithSpaces: 0, indentingWithSpaces: 2)
// <head>
//   <title>
//     hello world.
//   </title>
// </head>

@sahandnayebaziz sahandnayebaziz added this to the 2.0 milestone Nov 9, 2016
@sahandnayebaziz sahandnayebaziz merged commit 0581e94 into master Nov 9, 2016
@sahandnayebaziz sahandnayebaziz deleted the custom-indentation branch November 9, 2016 17:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant