Skip to content

Commit 8740a26

Browse files
authored
Merge pull request #2 from brokenhandsio/vapor-4
Update project name to avoid conflicts
2 parents 37ddb65 + 9570875 commit 8740a26

23 files changed

+35
-24
lines changed

β€Ž.github/workflows/ci.ymlβ€Ž

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# This workflow will build a Swift project
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift
3-
41
name: CI
52

63
on:

β€ŽPackage.swiftβ€Ž

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,28 @@
22
import PackageDescription
33

44
let package = Package(
5-
name: "bootstrap",
5+
name: "leaf-bootstrap",
66
platforms: [
77
.macOS(.v13)
88
],
99
products: [
10-
.library(name: "Bootstrap", targets: ["Bootstrap"])
10+
.library(name: "LeafBootstrap", targets: ["LeafBootstrap"]),
1111
],
1212
dependencies: [
1313
.package(url: "https://github.com/vapor/leaf.git", from: "4.0.0"),
1414
.package(url: "https://github.com/vapor/vapor.git", from: "4.0.0"),
1515
],
1616
targets: [
1717
.target(
18-
name: "Bootstrap",
18+
name: "LeafBootstrap",
1919
dependencies: [
2020
.product(name: "Leaf", package: "leaf"),
2121
.product(name: "Vapor", package: "vapor")
2222
]),
2323
.testTarget(
24-
name: "BootstrapTests",
24+
name: "LeafBootstrapTests",
2525
dependencies: [
26-
.target(name: "Bootstrap"),
26+
.target(name: "LeafBootstrap"),
2727
.product(name: "XCTVapor", package: "vapor")
2828
]
2929
)

β€ŽREADME.mdβ€Ž

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
# Bootstrap πŸƒ
1+
# LeafBootstrap πŸƒ
22

33
[![Swift Version](https://img.shields.io/badge/Swift-5.7-brightgreen.svg)](http://swift.org)
44
[![Vapor Version](https://img.shields.io/badge/Vapor-4-30B6FC.svg)](http://vapor.codes)
5-
[![Build Status](https://github.com/brokenhandsio/bootstrap/workflows/CI/badge.svg?branch=master)](https://github.com/brokenhandsio/bootstrap/actions)
6-
[![codecov](https://codecov.io/gh/nodes-vapor/bootstrap/branch/master/graph/badge.svg)](https://codecov.io/gh/nodes-vapor/bootstrap)
5+
[![Build Status](https://github.com/brokenhandsio/leaf-bootstrap/workflows/CI/badge.svg?branch=vapor-4)](https://github.com/brokenhandsio/leaf-bootstrap/actions)
6+
[![codecov](https://codecov.io/gh/brokenhandsio/bootstrap/branch/master/graph/badge.svg)](https://codecov.io/gh/nodes-vapor/leaf-bootstrap)
77
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/nodes-vapor/bootstrap/master/LICENSE)
88

99
This package wraps Bootstrap elements into convenient Leaf-Tags.
1010

1111

1212
# Installation
1313

14-
Add `Bootstrap` to the package dependencies (in your `Package.swift` file):
14+
Add `LeafBootstrap` to the package dependencies (in your `Package.swift` file):
1515

1616
```swift
17-
.package(url: "https://github.com/nodes-vapor/bootstrap.git", from: "1.0.0-beta")
17+
.package(url: "https://github.com/brokenhandsio/leaf-bootstrap.git", from: "1.0.0-beta")
1818
```
1919

2020
as well as to your target:
2121

2222
```swift
23-
.product(name: "Bootstrap", package: "bootstrap")
23+
.product(name: "LeafBootstrap", package: "leaf-bootstrap")
2424
```
2525

2626
## Getting started πŸš€
2727

28-
First import Bootstrap and Leaf inside your `configure.swift`
28+
First import LeafBootstrap and Leaf inside your `configure.swift`
2929

3030
```swift
31-
import Bootstrap
31+
import LeafBootstrap
3232
import Leaf
3333
```
3434

β€ŽSources/Bootstrap/Extensions/Application+Bootstrap.swiftβ€Ž renamed to β€ŽSources/LeafBootstrap/Extensions/Application+Bootstrap.swiftβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ extension Application.Leaf {
88
self.tags["bsButton"] = ButtonTag()
99
self.tags["bsInput"] = InputTag()
1010
self.tags["bsFileInput"] = FormFileTag()
11+
self.tags["bsFormCheckbox"] = FormCheckboxTag()
1112
self.tags["bsTextArea"] = TextAreaTag()
1213
self.tags["bsCheckbox"] = FormCheckboxTag()
1314
}

β€ŽSources/Bootstrap/Extensions/LeafContext+BodyParser.swiftβ€Ž renamed to β€ŽSources/LeafBootstrap/Extensions/LeafContext+BodyParser.swiftβ€Ž

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,17 @@ extension LeafContext {
1414
.filter { !$0.isEmpty }
1515
.joined()
1616
}
17+
18+
func getCustomTagBody() throws -> String {
19+
try self.requireBody().compactMap { element in
20+
guard case .custom(_) = element else {
21+
return nil
22+
}
23+
return "#" + element.description
24+
.replacingOccurrences(of: "\n", with: "")
25+
.trimmingCharacters(in: .whitespaces)
26+
}
27+
.filter { !$0.isEmpty }
28+
.joined()
29+
}
1730
}

0 commit comments

Comments
Β (0)