[
  {
    "path": ".gitignore",
    "content": "# Xcode\n#\n# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore\n\n## Build generated\nbuild/\nDerivedData/\n\n## Various settings\n*.pbxuser\n!default.pbxuser\n*.mode1v3\n!default.mode1v3\n*.mode2v3\n!default.mode2v3\n*.perspectivev3\n!default.perspectivev3\nxcuserdata/\n\n## Other\n*.moved-aside\n*.xcuserstate\n\n## Obj-C/Swift specific\n*.hmap\n*.ipa\n*.dSYM.zip\n*.dSYM\n\n## Playgrounds\ntimeline.xctimeline\nplayground.xcworkspace\n\n# Swift Package Manager\n#\n# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.\n# Packages/\n.build/\n\n# CocoaPods\n#\n# We recommend against adding the Pods directory to your .gitignore. However\n# you should judge for yourself, the pros and cons are mentioned at:\n# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control\n#\n# Pods/\n\n# Carthage\n#\n# Add this line if you want to avoid checking in source code from Carthage dependencies.\n# Carthage/Checkouts\n\nCarthage/Build\n\n# fastlane\n#\n# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the\n# screenshots whenever they are needed.\n# For more information about the recommended setup visit:\n# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md\n\nfastlane/report.xml\nfastlane/Preview.html\nfastlane/screenshots\nfastlane/test_output\n"
  },
  {
    "path": ".travis.sh",
    "content": "#!/usr/bin/env bash\n# adapted from https://github.com/vapor/swift/blob/master/ci\n\necho \"Hypertext Continuous Integration\";\n\nUBUNTU_RELEASE=`lsb_release -a 2>/dev/null`;\nif [[ $UBUNTU_RELEASE == *\"15.10\"* ]];\nthen\n    OS=\"ubuntu1510\";\nelse\n    OS=\"ubuntu1404\";\nfi\n\necho \"Installing Dependencies\"\nsudo apt-get install -y clang libicu-dev uuid-dev\n\necho \"Installing Swift\";\nif [[ $OS == \"ubuntu1510\" ]];\nthen\n    SWIFTFILE=\"swift-3.0-RELEASE-ubuntu15.10\";\nelse\n    SWIFTFILE=\"swift-3.0-RELEASE-ubuntu14.04\";\nfi\nwget https://swift.org/builds/swift-3.0-release/$OS/swift-3.0-RELEASE/$SWIFTFILE.tar.gz\ntar -zxf $SWIFTFILE.tar.gz\nexport PATH=$PWD/$SWIFTFILE/usr/bin:\"${PATH}\"\n\necho \"Version: `swift --version`\";\n\necho \"Building\";\nswift build\nif [[ $? != 0 ]];\nthen\n    echo \"Build failed\";\n    exit 1;\nfi\n\necho \"🔎 Testing\";\n\nswift test\nif [[ $? != 0 ]];\nthen\n    echo \"Tests failed\";\n    exit 1;\nfi\n\necho \"Done.\"\n"
  },
  {
    "path": ".travis.yml",
    "content": "os:\n  - linux\nlanguage: generic\nsudo: required\ndist: trusty\nosx_image: xcode8\nscript:\n- eval \"$(curl -sL https://raw.githubusercontent.com/sahandnayebaziz/Hypertext/master/.travis.sh)\"\n"
  },
  {
    "path": "CHANGELOG.md",
    "content": "# Changelog\n\n## [2.1.1](https://github.com/sahandnayebaziz/Hypertext/releases/tag/2.1.1)\nSeptember 22, 2017\n\n#### Fixed\n- Fixed an extension that was adding a `description` property to all types that conformed to `Renderable`, instead of just to `tag`, that was causing duplication in standard types like `String` and `Int`\n\nthank you @briancprice for [#28](https://github.com/sahandnayebaziz/Hypertext/pull/28)\n\n## [2.1.0](https://github.com/sahandnayebaziz/Hypertext/releases/tag/2.1.0)\nJanuary 21st, 2017\n\n#### Added\n- Custom tags now, by default, render their tags with HTML-appropriate hyphenation if given a camel case name.\n```swift\npublic class myNewTag: tag {}\n\nmyNewTag().render()\n// <my-new-tag/>\n```\nthank you @stupergenius for [#23](https://github.com/sahandnayebaziz/Hypertext/pull/23)\n\n## [2.0.0](https://github.com/sahandnayebaziz/Hypertext/releases/tag/2.0.0)\nNovember 9th, 2016\n\n#### Improved\n- Creating a custom tag is easier. The `name` and `isSelfClosing` attributes of  `tag` have been changed to computed properties. By default, `name` takes the name of the subclass and `isSelfClosing` returns false. To override either, like we do to create the `img` tag, is simple:\n```swift\npublic class img : tag { \n  override public var isSelfClosing: Bool { \n    return true\n  } \n}\n```\n  thank you @Evertt for [#6](https://github.com/sahandnayebaziz/Hypertext/pull/6) \n- Initializing a tag with both attributes and children is easier. The order of attributes and children has been flipped so that you can set the attributes first and then set the children off the end of the initializer. Initializing a tag with both attributes and children now looks like:\n```swift\np([\"class\": \"greeting\"]) { \"Well hello there...\" }\n```\n  thank you @Evertt for [#10](https://github.com/sahandnayebaziz/Hypertext/pull/10) \n- Anything that is `Renderable` now also conforms to `CustomStringConvertible` so you can print and use `tag` subclasses and your own `Renderable` types in String outputs and see them rendered automatically.\n\nthank you @Evertt for [#9](https://github.com/sahandnayebaziz/Hypertext/pull/9)/[#17](https://github.com/sahandnayebaziz/Hypertext/pull/17)\n\n- The `Renderable` protocol's method for rendering formatted, indented HTML has a new signature takes an integer value that lets you specify the number of spaces to use when indenting. \n\n```swift\nfunc render(startingWithSpaces: Int, indentingWithSpaces: Int) -> String\n```\n\nthank you @Evertt for [#9](https://github.com/sahandnayebaziz/Hypertext/pull/9)/[#18](https://github.com/sahandnayebaziz/Hypertext/pull/18)\n\n#### Added\n- A new class called `doctype` that can be used to render the most common HTML doctypes. To render a doctype: \n```swift\ndoctype(.html5).render()\n\n// used in context\nlet document: Renderable = [\n    doctype(.html5),\n    html {[\n        head {\n            title { \"Hello there\" }\n        },\n        body { \"blabla\" }\n    ]}\n]\n```\n\nthank you @Evertt for [#16](https://github.com/sahandnayebaziz/Hypertext/pull/16)\n\n---\n\n## [1.0.1](https://github.com/sahandnayebaziz/Hypertext/releases/tag/1.0.1)\nOctober 31st, 2016\n\n#### Fixed\n- `attributes` being optional, even though it was being initialized to an empty dictionary. It is now guaranteed to be there and still initialized empty. thank you @Evertt for [#7](https://github.com/sahandnayebaziz/Hypertext/pull/7) \n\n#### Updated\n- code around rendering `children` in `tag` to use the nil-coalescing operator. thank you @Evertt for [#7](https://github.com/sahandnayebaziz/Hypertext/pull/7) \n"
  },
  {
    "path": "Hypertext.podspec",
    "content": "Pod::Spec.new do |s|\n  s.name             = \"Hypertext\"\n  s.version          = \"2.1.1\"\n  s.summary          = \"Compose valid HTML in Swift any way you want to.\"\n  s.description      = \"Hypertext provides a simple, powerful set of classes for composing HTML, including all standard HTML elements, and rendering composed HTML to a string. Best used with a Swift Server.\"\n\n  s.homepage         = \"https://github.com/sahandnayebaziz/Hypertext\"\n  s.license          = 'MIT'\n  s.author           = { \"sahandnayebaziz\" => \"sahand@sahand.me\" }\n  s.source           = { :git => \"https://github.com/sahandnayebaziz/Hypertext.git\", :tag => s.version.to_s }\n\n  s.ios.deployment_target  = '10.0'\n  s.osx.deployment_target  = '10.12'\n\n  s.source_files = 'Sources/*.swift'\nend\n"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2016 Sahand Nayebaziz\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "Package.swift",
    "content": "import PackageDescription\n\nlet package = Package(\n    name: \"Hypertext\"\n)\n"
  },
  {
    "path": "README.md",
    "content": "![header](header.jpg)\n\nCompose valid HTML in Swift any way you want to.\n\n### Usage\n\n````swift\n\nimport Hypertext\n\ntitle { \"hello world.\" }.render()\n// <title>hello world.</title>\n\nhead { title { \"hello world.\" } }.render()\n// <head><title>hello world.</title></head>\n\nhead { title { \"hello world.\" } }.render(startingWithSpaces: 0, indentingWithSpaces: 2)\n// <head>\n//   <title>\n//     hello world.\n//   </title>\n// </head>\n\n````\n\n\n\n### Requirements\n- Swift 3.0+\n\n### Full usage\n\n1. Rendering a tag\n\n    ```swift\n\n    div().render() \n    // <div></div>\n\n    ```\n    \n2. Rendering a tag with child text\n\n   ```swift\n   \n   div { \"hello world.\" }.render()\n   // <div>hello world.</div>\n   \n   ```\n   \n3. Rendering a tag with a child tag\n\n   ```swift\n   \n   div { img() }.render()\n   // <div><img/></div>\n   \n   ```\n   \n4. Rendering a tag with multiple child tags\n\n   ```swift\n   \n   div { [img(), img(), img()] }.render()\n   // <div><img/><img/><img/></div>\n   \n   ```\n   \n5. Rendering a tag with attributes\n\n   ```swift\n   \n   link([\"rel\": \"stylesheet\", \"type\":\"text/css\", \"href\":\"./style.css\"]).render()\n   // <link rel=\"stylesheet\" type=\"text/css\" href=\"./style.css\"/>\n   \n   ```\n   \n6. Rendering a tag with attributes and children\n\n   ```swift\n   \n   div([\"class\": \"container\"]) { \"hello world.\" }\n   // <div class=\"container\">hello world.</div>\n   \n   ```\n\n7. Rendering a doctype declaration\n\n   ```swift\n   doctype(.html5).render()\n   // <!DOCTYPE html>\n   ```\n\n8. Rendering unminified, with newlines and indentation\n\n    ```swift\n    \n    head { title { \"hello world.\" } }.render(startingWithSpaces: 0, indentingWithSpaces: 2)\n    // <head>\n    //   <title>\n    //     hello world.\n    //   </title>\n    // </head>\n    \n    ```\n    \n9. Rendering a tag in a novel way, any way you want to\n\n   ```swift\n   \n   func createTitleTag(forPageNamed pageName: String) -> title {\n     return title { \"Hypertext - \\(pageName)\" }\n   }\n   \n   head { createTitleTag(forPageNamed: \"Documentation\") }.render()\n   // <head><title>Hypertext - Documentation</title></head>\n   \n   ```\n   \n10. Rendering a custom tag\n\n       ```swift\n\n       public class myNewTag: tag {\n\n         override public var isSelfClosing: Bool { \n           return true \n         }\n       }\n\n       myNewTag().render()\n       // <my-new-tag/>\n\n       ```\n   \n11. Rendering a custom type by adopting the protocol `Renderable`\n\n       ```swift\n\n       extension MyType: Renderable {\n         public func render() -> String { ... }\n         public func render(startingWithSpaces: Int, indentingWithSpaces: Int) -> String { ... }\n       }\n\n       ```\n"
  },
  {
    "path": "Sources/Doctype.swift",
    "content": "public class doctype: Renderable {\n    public enum Doctype: String {\n        case html5 = \"<!DOCTYPE html>\"\n        case html4Strict = \"<!DOCTYPE HTML PUBLIC \\\"-//W3C//DTD HTML 4.01//EN\\\" \\\"http://www.w3.org/TR/html4/strict.dtd\\\">\"\n        case html4Transitional = \"<!DOCTYPE HTML PUBLIC \\\"-//W3C//DTD HTML 4.01 Transitional//EN\\\" \\\"http://www.w3.org/TR/html4/loose.dtd\\\">\"\n        case html4Frameset = \"<!DOCTYPE HTML PUBLIC \\\"-//W3C//DTD HTML 4.01 Frameset//EN\\\" \\\"http://www.w3.org/TR/html4/frameset.dtd\\\">\"\n        case xhtml1Strict = \"<!DOCTYPE html PUBLIC \\\"-//W3C//DTD XHTML 1.0 Strict//EN\\\" \\\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\\\">\"\n        case xhtml1Transitional = \"<!DOCTYPE html PUBLIC \\\"-//W3C//DTD XHTML 1.0 Transitional//EN\\\" \\\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\\\">\"\n        case xhtml1Frameset = \"<!DOCTYPE html PUBLIC \\\"-//W3C//DTD XHTML 1.0 Frameset//EN\\\" \\\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\\\">\"\n        case xhtml11 = \"<!DOCTYPE html PUBLIC \\\"-//W3C//DTD XHTML 1.1//EN\\\" \\\"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\\\">\"\n    }\n    \n    let docType: Doctype\n    public var description: String { return docType.rawValue }\n    public init(_ docType: Doctype) { self.docType = docType }\n}\n"
  },
  {
    "path": "Sources/Hypertext.swift",
    "content": "//\n//  Hypertext.swift\n//  Hypertext\n//\n//  Created by Sahand Nayebaziz on 10/29/16.\n//  Copyright © 2016 Sahand Nayebaziz. All rights reserved.\n//\n\nimport Foundation\n\npublic protocol Renderable: CustomStringConvertible {\n    func render() -> String\n    func render(startingWithSpaces: Int, indentingWithSpaces: Int) -> String\n}\n\npublic extension CustomStringConvertible {\n    public func render() -> String {\n        return String(describing: self)\n    }\n    \n    public func render(startingWithSpaces: Int, indentingWithSpaces: Int) -> String {\n        return String(repeating: \" \", count: startingWithSpaces) + render()\n    }\n}\n\nextension String: Renderable {}\nextension Int: Renderable {}\nextension Double: Renderable {}\nextension Float: Renderable {}\n\nextension Array: Renderable {\n    public func render() -> String {\n        return self.reduce(\"\") { renderedSoFar, item in\n            guard let renderableItem = item as? Renderable else {\n                print(\"Tried to render an item in an array that does not conform to Renderable.\")\n                return renderedSoFar\n            }\n            return renderedSoFar + renderableItem.render()\n        }\n    }\n    \n    public func render(startingWithSpaces: Int, indentingWithSpaces: Int) -> String {\n        return self.reduce(\"\") { renderedSoFar, item in\n            guard let renderableItem = item as? Renderable else {\n                print(\"Tried to render an item in an array that does not conform to Renderable.\")\n                return renderedSoFar\n            }\n            return renderedSoFar + (renderedSoFar != \"\" ? \"\\n\" : \"\") + renderableItem.render(startingWithSpaces: startingWithSpaces, indentingWithSpaces: indentingWithSpaces)\n        }\n    }\n}\n\nenum TagFormatter {\n    static func dashed(_ tag: String) -> String {\n        return delimited(tag, delimiter: \"-\")\n    }\n    static func snaked(_ tag: String) -> String {\n        return delimited(tag, delimiter: \"_\")\n    }\n    \n    static private func delimited(_ tag: String, delimiter: String) -> String {\n        let range = NSMakeRange(0, tag.characters.count)\n        let pattern = \"(.)(?=[A-Z])\"\n        #if !os(Linux)\n        let regex = try! NSRegularExpression(pattern: pattern, options: [])\n        #else\n        let regex = try! RegularExpression(pattern: pattern, options: [])\n        #endif\n        return regex.stringByReplacingMatches(in: tag, options: [], range: range, withTemplate: \"$1\\(delimiter)\").lowercased()\n    }\n}\n\nopen class tag: Renderable {\n    open var isSelfClosing: Bool { return false }\n    open var name: String {\n        let typeName = String(describing: type(of: self))\n        return TagFormatter.dashed(typeName)\n    }\n    \n    public var children: Renderable? = nil\n    public var attributes: [String: String] = [:]\n    \n    public var description: String {\n        return render()\n    }\n    \n    public init(_ attributes: [String: String] = [:], setChildren: (() -> Renderable?) = { nil }) {\n        self.attributes = attributes\n        self.children   = setChildren()\n    } \n\n    public func render() -> String {\n        if isSelfClosing {\n            return \"<\\(name)\\(renderAttributes())/>\"\n        } else {\n            return \"<\\(name)\\(renderAttributes())>\\(children?.render() ?? \"\")</\\(name)>\"\n        }\n    }\n\n    public func render(startingWithSpaces: Int, indentingWithSpaces: Int) -> String {\n        let leadingSpaces = String(repeating: \" \", count: startingWithSpaces)\n        if isSelfClosing {\n            return \"\\(leadingSpaces)<\\(name)\\(renderAttributes())/>\"\n        }\n        \n        guard let children = children else {\n            return \"\\(leadingSpaces)<\\(name)\\(renderAttributes())></\\(name)>\"\n        }\n        \n        return \"\\(leadingSpaces)<\\(name)\\(renderAttributes())>\\(\"\\n\\(children.render(startingWithSpaces: startingWithSpaces + indentingWithSpaces, indentingWithSpaces: indentingWithSpaces))\\n\")\\(leadingSpaces)</\\(name)>\"\n    }\n\n    private func renderAttributes() -> String {\n        return attributes.keys.reduce(\"\") { renderedSoFar, attributeKey in\n            return \"\\(renderedSoFar) \\(attributeKey)=\\\"\\(attributes[attributeKey]!)\\\"\"\n        }\n    }\n}\n"
  },
  {
    "path": "Sources/Tags.swift",
    "content": "//\n//  Tags.swift\n//  Hypertext\n//\n//  Created by Sahand Nayebaziz on 10/30/16.\n//  Copyright © 2016 Sahand Nayebaziz. All rights reserved.\n//\n\npublic class a          : tag {}\npublic class abbr       : tag {}\npublic class address    : tag {}\npublic class article    : tag {}\npublic class aside      : tag {}\npublic class audio      : tag {}\npublic class b          : tag {}\npublic class bb         : tag {}\npublic class bdo        : tag {}\npublic class blockquote : tag {}\npublic class body       : tag {}\npublic class button     : tag {}\npublic class canvas     : tag {}\npublic class caption    : tag {}\npublic class cite       : tag {}\npublic class code       : tag {}\npublic class colgroup   : tag {}\npublic class datagrid   : tag {}\npublic class datalist   : tag {}\npublic class dd         : tag {}\npublic class del        : tag {}\npublic class detail     : tag {}\npublic class dfn        : tag {}\npublic class dialog     : tag {}\npublic class div        : tag {}\npublic class dl         : tag {}\npublic class em         : tag {}\npublic class fieldset   : tag {}\npublic class figure     : tag {}\npublic class footer     : tag {}\npublic class form       : tag {}\npublic class h1         : tag {}\npublic class h2         : tag {}\npublic class h3         : tag {}\npublic class h4         : tag {}\npublic class h5         : tag {}\npublic class h6         : tag {}\npublic class head       : tag {}\npublic class header     : tag {}\npublic class html       : tag {}\npublic class i          : tag {}\npublic class iframe     : tag {}\npublic class ins        : tag {}\npublic class kbd        : tag {}\npublic class label      : tag {}\npublic class legend     : tag {}\npublic class li         : tag {}\npublic class map        : tag {}\npublic class mark       : tag {}\npublic class menu       : tag {}\npublic class meter      : tag {}\npublic class nav        : tag {}\npublic class noscript   : tag {}\npublic class object     : tag {}\npublic class ol         : tag {}\npublic class optgroup   : tag {}\npublic class option     : tag {}\npublic class output     : tag {}\npublic class p          : tag {}\npublic class pre        : tag {}\npublic class progress   : tag {}\npublic class q          : tag {}\npublic class rp         : tag {}\npublic class rt         : tag {}\npublic class ruby       : tag {}\npublic class samp       : tag {}\npublic class script     : tag {}\npublic class section    : tag {}\npublic class select     : tag {}\npublic class small      : tag {}\npublic class span       : tag {}\npublic class strong     : tag {}\npublic class style      : tag {}\npublic class sub        : tag {}\npublic class sup        : tag {}\npublic class table      : tag {}\npublic class tbody      : tag {}\npublic class td         : tag {}\npublic class textarea   : tag {}\npublic class tfoot      : tag {}\npublic class th         : tag {}\npublic class thead      : tag {}\npublic class time       : tag {}\npublic class title      : tag {}\npublic class tr         : tag {}\npublic class ul         : tag {}\npublic class `var`      : tag {}\npublic class video      : tag {}\n\npublic class area       : tag { override public var isSelfClosing: Bool { return true } }\npublic class base       : tag { override public var isSelfClosing: Bool { return true } }\npublic class br         : tag { override public var isSelfClosing: Bool { return true } }\npublic class col        : tag { override public var isSelfClosing: Bool { return true } }\npublic class command    : tag { override public var isSelfClosing: Bool { return true } }\npublic class dt         : tag { override public var isSelfClosing: Bool { return true } }\npublic class embed      : tag { override public var isSelfClosing: Bool { return true } }\npublic class hr         : tag { override public var isSelfClosing: Bool { return true } }\npublic class img        : tag { override public var isSelfClosing: Bool { return true } }\npublic class input      : tag { override public var isSelfClosing: Bool { return true } }\npublic class link       : tag { override public var isSelfClosing: Bool { return true } }\npublic class meta       : tag { override public var isSelfClosing: Bool { return true } }\npublic class param      : tag { override public var isSelfClosing: Bool { return true } }\npublic class source     : tag { override public var isSelfClosing: Bool { return true } }\n"
  },
  {
    "path": "Tests/HypertextTests/HypertextTests.swift",
    "content": "import XCTest\n@testable import Hypertext\n\n//MARK: Test Tags\n\nclass materialButton: tag {}\nclass camelButton: tag {\n  override public var name: String {\n    return String(describing: type(of: self))\n  }\n}\n\n//MARK: Test Cases\n\nclass HypertextTests: XCTestCase {\n\n  func testCanRenderString() {\n      let expected = \"hello world.\"\n      let actual = \"hello world.\".render()\n\n      XCTAssertEqual(expected, actual)\n  }\n\n  func testCanRenderIntRenderable() {\n      let expected = \"<div>2</div>\"\n      let actual = div { 2 }.render()\n\n      XCTAssertEqual(expected, actual)\n  }\n\n  func testCanRenderDoubleRenderable() {\n      let expected = \"<div>2.0</div>\"\n      let actual = div { 2.0 }.render()\n\n      XCTAssertEqual(expected, actual)\n  }\n\n  func testCanRenderFloatRenderable() {\n      let expected = \"<div>2.0</div>\"\n      let actual = div { Float(2.0) }.render()\n\n      XCTAssertEqual(expected, actual)\n  }\n\n  func testCanRenderTag() {\n      let expected = \"<title></title>\"\n      let actual = title().render()\n\n      XCTAssertEqual(expected, actual)\n  }\n\n  func testCanRenderSelfClosingTag() {\n      let expected = \"<img/>\"\n      let actual = img().render()\n\n      XCTAssertEqual(expected, actual)\n  }\n\n  func testCanRenderTagWithStringChild() {\n      let expected = \"<title>hello world.</title>\"\n      let actual = title { \"hello world.\" }.render()\n\n      XCTAssertEqual(expected, actual)\n  }\n\n  func testCanRenderSelfClosingTagWithoutRenderingChild() {\n      let expected = \"<img/>\"\n      let actual = img { \"hello world.\" }.render()\n\n      XCTAssertEqual(expected, actual)\n  }\n\n  func testCanRenderTagWithChildTag() {\n      let expected = \"<div><img/></div>\"\n      let actual = div { img() }.render()\n\n      XCTAssertEqual(expected, actual)\n  }\n\n  func testCanRenderTagWithMultipleChildTags() {\n      let expected = \"<div><img/><img/><img/></div>\"\n      let actual = div { [img(), img(), img()] }.render()\n\n      XCTAssertEqual(expected, actual)\n  }\n\n  func testCanRenderTagWithChildWithNestedChild() {\n      let expected = \"<div><div><img/></div></div>\"\n      let actual = div { div { img() } }.render()\n\n      XCTAssertEqual(expected, actual)\n  }\n\n  func testCanRenderTagWithChildWithNestedChildAbusingRender() {\n      let expected = \"<div><div><img/></div></div>\"\n      let actual = div { div { img().render() }.render() }.render()\n\n      XCTAssertEqual(expected, actual)\n  }\n\n  func testCanRenderTagWithManyNestedChildren() {\n      let expected = \"<div><div><div><div><div><div><div><div></div></div></div></div></div></div></div></div>\"\n      let actual = div { div { div { div { div { div { div { div() } } } } } } }.render()\n\n      XCTAssertEqual(expected, actual)\n  }\n\n  func testCanRenderAttributeOnTag() {\n      let expected = \"<link href=\\\"./style.css\\\"/>\"\n      let actual = link([\"href\":\"./style.css\"]).render()\n\n      XCTAssertEqual(expected, actual)\n  }\n\n  func testCanRenderAttributeOnNestedTag() {\n      let expected = \"<head><link href=\\\"./style.css\\\"/></head>\"\n      let actual = head { link([\"href\":\"./style.css\"]) }.render()\n\n      XCTAssertEqual(expected, actual)\n  }\n\n  func testCanRenderTagWithAttributesAndChildren() {\n      let expected = \"<div class=\\\"container\\\"><p>Well hello there...</p></div>\"\n      let actual = div([\"class\":\"container\"]) { p { \"Well hello there...\" } }.render()\n\n      XCTAssertEqual(expected, actual)\n  }\n\n  func testCanRenderTagsWithFormatting() {\n      let expected = \"<head>\\n  <title>\\n    hello world.\\n  </title>\\n</head>\"\n      let actual = head { title { \"hello world.\" } }.render(startingWithSpaces: 0, indentingWithSpaces: 2)\n\n      XCTAssertEqual(expected, actual)\n    \n      let expectedFourSpaces = \"<head>\\n    <title>\\n        hello world.\\n    </title>\\n</head>\"\n      let actualFourSpaces = head { title { \"hello world.\" } }.render(startingWithSpaces: 0, indentingWithSpaces: 4)\n    \n      XCTAssertEqual(expectedFourSpaces, actualFourSpaces)\n  }\n\n  func testCanRenderTagsWithFormattingWithMultipleSiblings() {\n      let expected = \"<div>\\n  <img/>\\n  <img/>\\n  <img/>\\n  <h1></h1>\\n</div>\"\n      let actual = div { [ img(), img(), img(), h1() ] }.render(startingWithSpaces: 0, indentingWithSpaces: 2)\n\n      XCTAssertEqual(expected, actual)\n  }\n\n  func testCanCreateCustomTagWithOverridenName() {\n      let expected = \"<mycustomtagname></mycustomtagname>\"\n\n      class mycustomtag : tag {\n        override public var name: String {\n          return \"mycustomtagname\"\n        }\n      }\n      let actual = mycustomtag().render()\n\n      XCTAssertEqual(expected, actual)\n  }\n\n  func testCanDescribeTagAsCustomStringConvertible() {\n      let expected = \"<div>hello world.</div>\"\n      let actual = \"\\(div { \"hello world.\" })\"\n\n      XCTAssertEqual(expected, actual)\n  }\n\n  func testCanRenderDoctype() {\n      let expected = \"<!DOCTYPE html>\"\n      let actual = doctype(.html5).render()\n\n      XCTAssertEqual(expected, actual)\n\n      let expectedHtml4 = \"<!DOCTYPE HTML PUBLIC \\\"-//W3C//DTD HTML 4.01//EN\\\" \\\"http://www.w3.org/TR/html4/strict.dtd\\\">\"\n      let actualHtml4 = doctype(.html4Strict).render()\n\n      XCTAssertEqual(expectedHtml4, actualHtml4)\n  }\n  \n  func testSnakeDelimiter() {\n    let expected = \"material_button\"\n    let actual = TagFormatter.snaked(\"materialButton\")\n    XCTAssertEqual(expected, actual)\n    \n    let expectedNoOp = \"materialbutton\"\n    let actualNoOp = TagFormatter.snaked(\"materialbutton\")\n    XCTAssertEqual(expectedNoOp, actualNoOp)\n  }\n  \n  func testDashDelimiter() {\n    let expected = \"material-button\"\n    let actual = TagFormatter.dashed(\"materialButton\")\n    XCTAssertEqual(expected, actual)\n    \n    let expectedNoOp = \"materialbutton\"\n    let actualNoOp = TagFormatter.dashed(\"materialbutton\")\n    XCTAssertEqual(expectedNoOp, actualNoOp)\n  }\n  \n  func testDefaultTagFormatIsDashed() {\n    let expected = \"<material-button></material-button>\"\n    let actual = materialButton().render()\n    XCTAssertEqual(expected, actual)\n  }\n  \n  func testCanOverrideDefaultTagFormat() {\n    let expected = \"<camelButton></camelButton>\"\n    let actual = camelButton().render()\n    XCTAssertEqual(expected, actual)\n  }\n\n  static var allTests : [(String, (HypertextTests) -> () throws -> Void)] {\n    return [\n        (\"testCanRenderString\", testCanRenderString),\n        (\"testCanRenderIntRenderable\", testCanRenderIntRenderable),\n        (\"testCanRenderDoubleRenderable\", testCanRenderDoubleRenderable),\n        (\"testCanRenderFloatRenderable\", testCanRenderFloatRenderable),\n        (\"testCanRenderTag\", testCanRenderTag),\n        (\"testCanRenderSelfClosingTag\", testCanRenderSelfClosingTag),\n        (\"testCanRenderTagWithStringChild\", testCanRenderTagWithStringChild),\n        (\"testCanRenderSelfClosingTagWithoutRenderingChild\", testCanRenderSelfClosingTagWithoutRenderingChild),\n        (\"testCanRenderTagWithChildTag\", testCanRenderTagWithChildTag),\n        (\"testCanRenderTagWithMultipleChildTags\", testCanRenderTagWithMultipleChildTags),\n        (\"testCanRenderTagWithChildWithNestedChild\", testCanRenderTagWithChildWithNestedChild),\n        (\"testCanRenderTagWithChildWithNestedChildAbusingRender\", testCanRenderTagWithChildWithNestedChildAbusingRender),\n        (\"testCanRenderTagWithManyNestedChildren\", testCanRenderTagWithManyNestedChildren),\n        (\"testCanRenderAttributeOnTag\", testCanRenderAttributeOnTag),\n        (\"testCanRenderAttributeOnNestedTag\", testCanRenderAttributeOnNestedTag),\n        (\"testCanRenderTagsWithFormatting\", testCanRenderTagsWithFormatting),\n        (\"testCanRenderTagsWithFormattingWithMultipleSiblings\", testCanRenderTagsWithFormattingWithMultipleSiblings),\n        (\"testCanCreateCustomTagWithOverridenName\", testCanCreateCustomTagWithOverridenName),\n        (\"testCanRenderTagWithAttributesAndChildren\", testCanRenderTagWithAttributesAndChildren),\n        (\"testCanDescribeTagAsCustomStringConvertible\", testCanDescribeTagAsCustomStringConvertible),\n        (\"testCanRenderDoctype\", testCanRenderDoctype),\n        (\"testSnakeDelimiter\", testSnakeDelimiter),\n        (\"testDashDelimiter\", testDashDelimiter),\n        (\"testDefaultTagFormatIsDashed\", testDefaultTagFormatIsDashed),\n        (\"testCanOverrideDefaultTagFormat\", testCanOverrideDefaultTagFormat)\n    ]\n  }\n\n}\n"
  },
  {
    "path": "Tests/LinuxMain.swift",
    "content": "import XCTest\n@testable import HypertextTests\n\nXCTMain([\n     testCase(HypertextTests.allTests),\n])\n"
  }
]