Skip to content

Commit 88efc76

Browse files
committed
Support pods; update documentations
1 parent 17c408a commit 88efc76

File tree

20 files changed

+304
-253
lines changed

20 files changed

+304
-253
lines changed

CONTRIBUTING.md renamed to .github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Contributing to `HTMLEntities`
1+
# Contributing to IBM-Swift
22

33
We welcome contributions, and request you follow these guidelines.
44

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!--- Provide a general summary of your changes in the Title above -->
2+
3+
## Description
4+
<!--- Describe your changes in detail -->
5+
6+
## Motivation and Context
7+
<!--- Why is this change required? What problem does it solve? -->
8+
<!--- If it fixes an open issue, please link to the issue here. -->
9+
10+
## How Has This Been Tested?
11+
<!--- Please describe in detail how you tested your changes. -->
12+
<!--- Include details of your testing environment, and the tests you ran to -->
13+
<!--- see how your change affects other areas of the code, etc. -->
14+
15+
## Checklist:
16+
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
17+
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
18+
- [ ] I have submitted a [CLA form](https://github.com/IBM-Swift/CLA)
19+
- [ ] If applicable, I have updated the documentation accordingly.
20+
- [ ] If applicable, I have added tests to cover my changes.

HTMLEntities.podspec

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
#
2+
# Be sure to run `pod spec lint HTMLEntities.podspec' to ensure this is a
3+
# valid spec and to remove all comments including this before submitting the spec.
4+
#
5+
# To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html
6+
# To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/
7+
#
8+
9+
Pod::Spec.new do |s|
10+
11+
# ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
12+
#
13+
# These will help people to find your library, and whilst it
14+
# can feel like a chore to fill in it's definitely to your advantage. The
15+
# summary should be tweet-length, and the description more in depth.
16+
#
17+
18+
s.name = "HTMLEntities"
19+
s.version = "3.0.4"
20+
s.summary = "HTML5 spec-compliant character encoder/decoder for Swift"
21+
22+
# This description is used to generate tags and improve search results.
23+
# * Think: What does it do? Why did you write it? What is the focus?
24+
# * Try to keep it short, snappy and to the point.
25+
# * Write the description between the DESC delimiters below.
26+
# * Finally, don't worry about the indent, CocoaPods strips it!
27+
s.description = <<-DESC
28+
Pure Swift HTML encode/decode utility tool for Swift 3.
29+
30+
Includes support for HTML5 named character references. You can find the list of all 2231 HTML5 named character references [here](https://www.w3.org/TR/html5/syntax.html#named-character-references).
31+
32+
`HTMLEntities` can escape ALL non-ASCII characters as well as the characters `<`, `>`, `&`, `"`, `’`, as these five characters are part of the HTML tag and HTML attribute syntaxes.
33+
34+
In addition, `HTMLEntities` can unescape encoded HTML text that contains decimal, hexadecimal, or HTML5 named character references.
35+
DESC
36+
37+
s.homepage = "https://github.com/IBM-Swift/swift-html-entities"
38+
# s.screenshots = "www.example.com/screenshots_1.gif", "www.example.com/screenshots_2.gif"
39+
40+
41+
# ――― Spec License ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
42+
#
43+
# Licensing your code is important. See http://choosealicense.com for more info.
44+
# CocoaPods will detect a license file if there is a named LICENSE*
45+
# Popular ones are 'MIT', 'BSD' and 'Apache License, Version 2.0'.
46+
#
47+
48+
s.license = { :type => "Apache License, Version 2.0", :file => "LICENSE" }
49+
# s.license = { :type => "MIT", :file => "FILE_LICENSE" }
50+
51+
52+
# ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
53+
#
54+
# Specify the authors of the library, with email addresses. Email addresses
55+
# of the authors are extracted from the SCM log. E.g. $ git log. CocoaPods also
56+
# accepts just a name if you'd rather not provide an email address.
57+
#
58+
# Specify a social_media_url where others can refer to, for example a twitter
59+
# profile URL.
60+
#
61+
62+
s.author = "Youming Lin"
63+
64+
# ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
65+
#
66+
# If this Pod runs only on iOS or OS X, then specify the platform and
67+
# the deployment target. You can optionally include the target after the platform.
68+
#
69+
70+
# s.platform = :ios
71+
# s.platform = :ios, "5.0"
72+
73+
# When using multiple platforms
74+
# s.ios.deployment_target = "5.0"
75+
# s.osx.deployment_target = "10.7"
76+
# s.watchos.deployment_target = "2.0"
77+
# s.tvos.deployment_target = "9.0"
78+
79+
80+
# ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
81+
#
82+
# Specify the location from where the source should be retrieved.
83+
# Supports git, hg, bzr, svn and HTTP.
84+
#
85+
86+
s.source = { :git => "https://github.com/IBM-Swift/swift-html-entities.git", :tag => "#{s.version}" }
87+
88+
89+
# ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
90+
#
91+
# CocoaPods is smart about how it includes source code. For source files
92+
# giving a folder will include any swift, h, m, mm, c & cpp files.
93+
# For header files it will include any header in the folder.
94+
# Not including the public_header_files will make all headers public.
95+
#
96+
97+
s.source_files = "Sources/**/*.swift"
98+
# s.exclude_files = "Classes/Exclude"
99+
100+
# s.public_header_files = "Classes/**/*.h"
101+
102+
103+
# ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
104+
#
105+
# A list of resources included with the Pod. These are copied into the
106+
# target bundle with a build phase script. Anything else will be cleaned.
107+
# You can preserve files from being cleaned, please don't preserve
108+
# non-essential files like tests, examples and documentation.
109+
#
110+
111+
# s.resource = "icon.png"
112+
# s.resources = "Resources/*.png"
113+
114+
# s.preserve_paths = "FilesToSave", "MoreFilesToSave"
115+
116+
117+
# ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
118+
#
119+
# Link your library with frameworks, or libraries. Libraries do not include
120+
# the lib prefix of their name.
121+
#
122+
123+
# s.framework = "SomeFramework"
124+
# s.frameworks = "SomeFramework", "AnotherFramework"
125+
126+
# s.library = "iconv"
127+
# s.libraries = "iconv", "xml2"
128+
129+
130+
# ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
131+
#
132+
# If your library depends on compiler flags you can set them in the xcconfig hash
133+
# where they will only apply to your library. If you depend on other Podspecs
134+
# you can include multiple dependencies to ensure it works.
135+
136+
# s.requires_arc = true
137+
138+
# s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" }
139+
# s.dependency "JSONKit", "~> 1.4"
140+
141+
end

README.md

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@
99
## Summary
1010
Pure Swift HTML encode/decode utility tool for Swift 3.
1111

12-
Now includes support for HTML5 named character references. You can find the list of all 2231 HTML5 named character references [here](https://www.w3.org/TR/html5/syntax.html#named-character-references).
12+
Includes support for HTML5 named character references. You can find the list of all 2231 HTML5 named character references [here](https://www.w3.org/TR/html5/syntax.html#named-character-references).
1313

1414
`HTMLEntities` can escape ALL non-ASCII characters as well as the characters `<`, `>`, `&`, `"`, ``, as these five characters are part of the HTML tag and HTML attribute syntaxes.
1515

1616
In addition, `HTMLEntities` can unescape encoded HTML text that contains decimal, hexadecimal, or HTML5 named character references.
1717

18+
## API Documentation
19+
1820
API documentation for `HTMLEntities` is located [here](https://ibm-swift.github.io/swift-html-entities/).
1921

2022
## Features
@@ -27,11 +29,11 @@ API documentation for `HTMLEntities` is located [here](https://ibm-swift.github.
2729

2830
## Version Info
2931

30-
HTMLEntities 3.0 runs on Swift 3, on both macOS and Ubuntu Linux.
32+
`HTMLEntities` 3.0 requires Swift 3, on both macOS and Ubuntu Linux.
3133

32-
## Usage
34+
## Installation
3335

34-
### Install via Swift Package Manager (SPM)
36+
### Via Swift Package Manager
3537

3638
Add `HTMLEntities` to your `Package.swift`:
3739

@@ -46,7 +48,25 @@ let package = Package(
4648
)
4749
```
4850

49-
### In code
51+
### Via CocoaPods
52+
53+
Add `HTMLEntities` to your `Podfile`:
54+
55+
```
56+
target '<project-name>' do
57+
pod 'HTMLEntities', :git => 'https://github.com/IBM-Swift/swift-html-entities.git'
58+
end
59+
```
60+
61+
### Via Carthage
62+
63+
Add `HTMLEntities` to your `Cartfile`:
64+
65+
```
66+
github "IBM-Swift/swift-html-entities"
67+
```
68+
69+
## Usage
5070

5171
```swift
5272
import HTMLEntities
@@ -139,7 +159,7 @@ print(html.htmlEscape(useNamedReferences: true))
139159
// Prints “&lt;script&gt;alert(&quot;abc&quot;)&lt;/script&gt;”
140160
```
141161

142-
#### Set escape options globally
162+
#### Set Escape Options Globally
143163

144164
HTML escape options can be set globally so that you don't have to set them everytime you want to escape a string. The options are managed in the `String.HTMLEscapeOptions` struct.
145165

docs/Enums.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ <h1>Enums</h1>
8787
<li class="item">
8888
<div>
8989
<code>
90-
<a name="/s:O12HTMLEntities10ParseError"></a>
90+
<a name="/s:12HTMLEntities10ParseErrorO"></a>
9191
<a name="//apple_ref/swift/Enum/ParseError" class="dashAnchor"></a>
92-
<a class="token" href="#/s:O12HTMLEntities10ParseError">ParseError</a>
92+
<a class="token" href="#/s:12HTMLEntities10ParseErrorO">ParseError</a>
9393
</code>
9494
</div>
9595
<div class="height-container">
@@ -123,7 +123,7 @@ <h4>Declaration</h4>
123123
</article>
124124
</div>
125125
<section class="footer">
126-
<p>&copy; 2017 <a class="link" href="" target="_blank" rel="external">IBM</a>. All rights reserved. (Last updated: 2017-05-24)</p>
126+
<p>&copy; 2017 <a class="link" href="https://github.com/IBM-Swift/swift-html-entities" target="_blank" rel="external">IBM</a>. All rights reserved. (Last updated: 2017-07-31)</p>
127127
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
128128
</section>
129129
</body>

docs/Enums/ParseError.html

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ <h1>ParseError</h1>
9797
<li class="item">
9898
<div>
9999
<code>
100-
<a name="/s:FO12HTMLEntities10ParseError26DeprecatedNumericReferenceFMS0_FSSS0_"></a>
100+
<a name="/s:12HTMLEntities10ParseErrorO26DeprecatedNumericReferenceACSScACmF"></a>
101101
<a name="//apple_ref/swift/Element/DeprecatedNumericReference" class="dashAnchor"></a>
102-
<a class="token" href="#/s:FO12HTMLEntities10ParseError26DeprecatedNumericReferenceFMS0_FSSS0_">DeprecatedNumericReference</a>
102+
<a class="token" href="#/s:12HTMLEntities10ParseErrorO26DeprecatedNumericReferenceACSScACmF">DeprecatedNumericReference</a>
103103
</code>
104104
</div>
105105
<div class="height-container">
@@ -129,9 +129,9 @@ <h4>Declaration</h4>
129129
<li class="item">
130130
<div>
131131
<code>
132-
<a name="/s:FO12HTMLEntities10ParseError26DisallowedNumericReferenceFMS0_FSSS0_"></a>
132+
<a name="/s:12HTMLEntities10ParseErrorO26DisallowedNumericReferenceACSScACmF"></a>
133133
<a name="//apple_ref/swift/Element/DisallowedNumericReference" class="dashAnchor"></a>
134-
<a class="token" href="#/s:FO12HTMLEntities10ParseError26DisallowedNumericReferenceFMS0_FSSS0_">DisallowedNumericReference</a>
134+
<a class="token" href="#/s:12HTMLEntities10ParseErrorO26DisallowedNumericReferenceACSScACmF">DisallowedNumericReference</a>
135135
</code>
136136
</div>
137137
<div class="height-container">
@@ -166,9 +166,9 @@ <h4>Declaration</h4>
166166
<li class="item">
167167
<div>
168168
<code>
169-
<a name="/s:FO12HTMLEntities10ParseError15IllegalArgumentFMS0_FSSS0_"></a>
169+
<a name="/s:12HTMLEntities10ParseErrorO15IllegalArgumentACSScACmF"></a>
170170
<a name="//apple_ref/swift/Element/IllegalArgument" class="dashAnchor"></a>
171-
<a class="token" href="#/s:FO12HTMLEntities10ParseError15IllegalArgumentFMS0_FSSS0_">IllegalArgument</a>
171+
<a class="token" href="#/s:12HTMLEntities10ParseErrorO15IllegalArgumentACSScACmF">IllegalArgument</a>
172172
</code>
173173
</div>
174174
<div class="height-container">
@@ -198,9 +198,9 @@ <h4>Declaration</h4>
198198
<li class="item">
199199
<div>
200200
<code>
201-
<a name="/s:FO12HTMLEntities10ParseError21InvalidNamedReferenceFMS0_FSSS0_"></a>
201+
<a name="/s:12HTMLEntities10ParseErrorO21InvalidNamedReferenceACSScACmF"></a>
202202
<a name="//apple_ref/swift/Element/InvalidNamedReference" class="dashAnchor"></a>
203-
<a class="token" href="#/s:FO12HTMLEntities10ParseError21InvalidNamedReferenceFMS0_FSSS0_">InvalidNamedReference</a>
203+
<a class="token" href="#/s:12HTMLEntities10ParseErrorO21InvalidNamedReferenceACSScACmF">InvalidNamedReference</a>
204204
</code>
205205
</div>
206206
<div class="height-container">
@@ -231,9 +231,9 @@ <h4>Declaration</h4>
231231
<li class="item">
232232
<div>
233233
<code>
234-
<a name="/s:FO12HTMLEntities10ParseError25MalformedNumericReferenceFMS0_FSSS0_"></a>
234+
<a name="/s:12HTMLEntities10ParseErrorO25MalformedNumericReferenceACSScACmF"></a>
235235
<a name="//apple_ref/swift/Element/MalformedNumericReference" class="dashAnchor"></a>
236-
<a class="token" href="#/s:FO12HTMLEntities10ParseError25MalformedNumericReferenceFMS0_FSSS0_">MalformedNumericReference</a>
236+
<a class="token" href="#/s:12HTMLEntities10ParseErrorO25MalformedNumericReferenceACSScACmF">MalformedNumericReference</a>
237237
</code>
238238
</div>
239239
<div class="height-container">
@@ -264,9 +264,9 @@ <h4>Declaration</h4>
264264
<li class="item">
265265
<div>
266266
<code>
267-
<a name="/s:FO12HTMLEntities10ParseError16MissingSemicolonFMS0_FSSS0_"></a>
267+
<a name="/s:12HTMLEntities10ParseErrorO16MissingSemicolonACSScACmF"></a>
268268
<a name="//apple_ref/swift/Element/MissingSemicolon" class="dashAnchor"></a>
269-
<a class="token" href="#/s:FO12HTMLEntities10ParseError16MissingSemicolonFMS0_FSSS0_">MissingSemicolon</a>
269+
<a class="token" href="#/s:12HTMLEntities10ParseErrorO16MissingSemicolonACSScACmF">MissingSemicolon</a>
270270
</code>
271271
</div>
272272
<div class="height-container">
@@ -296,9 +296,9 @@ <h4>Declaration</h4>
296296
<li class="item">
297297
<div>
298298
<code>
299-
<a name="/s:FO12HTMLEntities10ParseError24OutsideValidUnicodeRangeFMS0_FSSS0_"></a>
299+
<a name="/s:12HTMLEntities10ParseErrorO24OutsideValidUnicodeRangeACSScACmF"></a>
300300
<a name="//apple_ref/swift/Element/OutsideValidUnicodeRange" class="dashAnchor"></a>
301-
<a class="token" href="#/s:FO12HTMLEntities10ParseError24OutsideValidUnicodeRangeFMS0_FSSS0_">OutsideValidUnicodeRange</a>
301+
<a class="token" href="#/s:12HTMLEntities10ParseErrorO24OutsideValidUnicodeRangeACSScACmF">OutsideValidUnicodeRange</a>
302302
</code>
303303
</div>
304304
<div class="height-container">
@@ -329,7 +329,7 @@ <h4>Declaration</h4>
329329
</article>
330330
</div>
331331
<section class="footer">
332-
<p>&copy; 2017 <a class="link" href="" target="_blank" rel="external">IBM</a>. All rights reserved. (Last updated: 2017-05-24)</p>
332+
<p>&copy; 2017 <a class="link" href="https://github.com/IBM-Swift/swift-html-entities" target="_blank" rel="external">IBM</a>. All rights reserved. (Last updated: 2017-07-31)</p>
333333
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
334334
</section>
335335
</body>

docs/Extensions.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ <h4>Declaration</h4>
119119
</article>
120120
</div>
121121
<section class="footer">
122-
<p>&copy; 2017 <a class="link" href="" target="_blank" rel="external">IBM</a>. All rights reserved. (Last updated: 2017-05-24)</p>
122+
<p>&copy; 2017 <a class="link" href="https://github.com/IBM-Swift/swift-html-entities" target="_blank" rel="external">IBM</a>. All rights reserved. (Last updated: 2017-07-31)</p>
123123
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
124124
</section>
125125
</body>

0 commit comments

Comments
 (0)