Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
cf2eec3
pop rework
tib Feb 24, 2024
aa15175
better protocols
tib Feb 24, 2024
7171257
experiment
tib Feb 24, 2024
ecdbe98
protocol wip
tib Feb 24, 2024
13bb6e3
element builder
tib Feb 24, 2024
b80b631
builder
tib Feb 24, 2024
f7c7573
add back tests
tib Feb 24, 2024
06570a4
restructure
tib Feb 24, 2024
d328487
add scripts
tib Feb 24, 2024
8c14ae1
update contributors
tib Feb 24, 2024
8b941eb
sitemap updates
tib Feb 24, 2024
e2804fa
sitemap
tib Feb 24, 2024
5f4ffa1
apply format
tib Feb 24, 2024
807c8c8
rss basics
tib Feb 24, 2024
fa0a655
rss impl
tib Feb 25, 2024
eb7c423
huge rework, again for Swift 6.0+ [wip] 🚧
tib Nov 22, 2025
516e02e
apply format & checks + gh wf
tib Nov 22, 2025
115040e
🚧 [wip] html, rss, sitemap, svg
tib Nov 22, 2025
7a19f92
🚧 [wip] attribute store
tib Nov 23, 2025
79f54ef
🚧 fix 6.0 trailing comas
tib Nov 23, 2025
9babccb
fix format
tib Nov 23, 2025
cc2b342
🚧 [wip] improved attributes a lot
tib Nov 23, 2025
48e93b3
🚧 [wip] improved tags
tib Nov 23, 2025
1c6e420
🚧 [wip] static tag names & readme updates
tib Nov 23, 2025
cd3eeef
🚧 [wip] cleanup builders, element builder, readme updates
tib Nov 23, 2025
fb45da0
🚧 [wip] generic builder, cleanup unnecesary builders
tib Nov 23, 2025
e429e02
🚧 [wip] attribute management api
tib Nov 23, 2025
76b13d4
reamde updates
tib Nov 23, 2025
dd08a6d
🚧 [wip] child elements api
tib Nov 23, 2025
db0e6ee
format
tib Nov 23, 2025
4cf47c4
remove unused class
tib Nov 23, 2025
11aa0ac
link attributes [wip]
tib Nov 23, 2025
53ab0b5
remove media query, should be in SwiftCSS
tib Nov 23, 2025
d430f98
🚧 [wip] new HTML attribute design pattern
tib Nov 23, 2025
554e018
🚧 [wip] renaming, rendering api changes, imports & export
tib Nov 23, 2025
012ed7f
🚧 [wip] raw text, pre & code support basics
tib Nov 24, 2025
5f12150
local docker tests
tib Nov 24, 2025
0c955fb
abbr
tib Nov 24, 2025
a1aa926
fix format, remove unnecessary imports
tib Nov 25, 2025
1446d5c
abbr docs & api
tib Nov 25, 2025
ccdee93
🚧 [wip] experiment with non-global attributes & docs
tib Nov 25, 2025
e6d96f6
🚧 [wip] more non-global attributes nested into tags
tib Nov 25, 2025
6290f4b
🚧 [wip] rework attributes api
tib Nov 26, 2025
9e00146
cleanup attribute protocols a bit
tib Nov 26, 2025
eee5828
🚧 [wip] rework content model
tib Nov 26, 2025
6e222e3
🚧 [wip] rework content model pt.2
tib Nov 26, 2025
41f29ff
fix 6.0
tib Nov 26, 2025
6b5048c
continue with tags
tib Nov 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
37 changes: 37 additions & 0 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Actions

on:
pull_request:
branches:
- main

jobs:

bb_checks:
name: BB Checks
uses: BinaryBirds/github-workflows/.github/workflows/extra_soundness.yml@main
with:
local_swift_dependencies_check_enabled : true

swiftlang_checks:
name: Swiftlang Checks
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main
with:
license_header_check_project_name: "Toucan"
format_check_enabled : true
broken_symlink_check_enabled : true
unacceptable_language_check_enabled : true
api_breakage_check_enabled : false
docs_check_enabled : false
license_header_check_enabled : false
shell_check_enabled : false
yamllint_check_enabled : false
python_lint_check_enabled : false

swiftlang_tests:
name: Swiftlang Tests
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
with:
enable_windows_checks : false
linux_build_command: "swift test --parallel --enable-code-coverage"
linux_exclude_swift_versions: "[{\"swift_version\": \"5.8\"}, {\"swift_version\": \"5.9\"}, {\"swift_version\": \"5.10\"}, {\"swift_version\": \"nightly\"}, {\"swift_version\": \"nightly-main\"}, {\"swift_version\": \"nightly-6.0\"}, {\"swift_version\": \"nightly-6.1\"}]"
64 changes: 64 additions & 0 deletions .swift-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"version": 1,
"lineLength": 80,
"maximumBlankLines": 1,
"fileScopedDeclarationPrivacy": {
"accessLevel": "private"
},
"tabWidth": 4,
"indentation": {
"spaces": 4
},
"indentConditionalCompilationBlocks": false,
"indentSwitchCaseLabels": false,
"lineBreakAroundMultilineExpressionChainComponents": true,
"lineBreakBeforeControlFlowKeywords": true,
"lineBreakBeforeEachArgument": true,
"lineBreakBeforeEachGenericRequirement": true,
"prioritizeKeepingFunctionOutputTogether": false,
"respectsExistingLineBreaks": true,
"spacesAroundRangeFormationOperators": false,
"multiElementCollectionTrailingCommas": true,
"rules": {
"AllPublicDeclarationsHaveDocumentation": false,
"AlwaysUseLiteralForEmptyCollectionInit": true,
"AlwaysUseLowerCamelCase": true,
"AmbiguousTrailingClosureOverload": true,
"BeginDocumentationCommentWithOneLineSummary": true,
"DoNotUseSemicolons": true,
"DontRepeatTypeInStaticProperties": true,
"FileScopedDeclarationPrivacy": true,
"FullyIndirectEnum": true,
"GroupNumericLiterals": true,
"IdentifiersMustBeASCII": true,
"NeverForceUnwrap": false,
"NeverUseForceTry": true,
"NeverUseImplicitlyUnwrappedOptionals": true,
"NoAccessLevelOnExtensionDeclaration": true,
"NoAssignmentInExpressions": true,
"NoBlockComments": true,
"NoCasesWithOnlyFallthrough": true,
"NoEmptyTrailingClosureParentheses": true,
"NoLabelsInCasePatterns": true,
"NoLeadingUnderscores": true,
"NoParensAroundConditions": true,
"NoPlaygroundLiterals": true,
"NoVoidReturnOnFunctionSignature": true,
"OmitExplicitReturns": true,
"OneCasePerLine": true,
"OneVariableDeclarationPerLine": true,
"OnlyOneTrailingClosureArgument": true,
"OrderedImports": true,
"ReplaceForEachWithForLoop": true,
"ReturnVoidInsteadOfEmptyTuple": true,
"TypeNamesShouldBeCapitalized": true,
"UseEarlyExits": true,
"UseLetInEveryBoundCaseVariable": true,
"UseShorthandTypeNames": true,
"UseSingleLinePropertyGetter": true,
"UseSynthesizedInitializer": true,
"UseTripleSlashForDocumentationComments": true,
"UseWhereClausesInForLoops": true,
"ValidateDocumentationComments": true
}
}
1 change: 1 addition & 0 deletions .swiftformatignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Package.swift
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
MIT License

Copyright (c) 2018-2022 Tibor Bödecs
Copyright (c) 2022-2025 Binary Birds Ltd.

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
Expand Down
61 changes: 51 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,52 @@
SHELL=/bin/bash

.PHONY: docker

baseUrl = https://raw.githubusercontent.com/BinaryBirds/github-workflows/refs/heads/main/scripts

check: symlinks language deps lint

symlinks:
curl -s $(baseUrl)/check-broken-symlinks.sh | bash

language:
curl -s $(baseUrl)/check-unacceptable-language.sh | bash

deps:
curl -s $(baseUrl)/check-local-swift-dependencies.sh | bash

lint:
curl -s $(baseUrl)/run-swift-format.sh | bash

fmt:
swiftformat .

format:
curl -s $(baseUrl)/run-swift-format.sh | bash -s -- --fix

headers:
curl -s $(baseUrl)/check-swift-headers.sh | bash

fix-headers:
curl -s $(baseUrl)/check-swift-headers.sh | bash -s -- --fix

build:
swift build

release:
swift build -c release

test:
swift test --enable-test-discovery --parallel

docs:
jazzy \
--clean \
--author "Tibor Bödecs" \
--author_url https://twitter.com/tiborbodecs/ \
--module-version 1.6.0 \
--module SwiftHtml \
--output docs/
swift test --parallel

test-with-coverage:
swift test --parallel --enable-code-coverage

clean:
rm -rf .build

docker-run:
docker run --rm -v $(pwd):/app -it swift:6.0

docker-tests:
docker build -t swift-html-tests . -f ./docker/Dockerfile.testing && docker run --rm swift-html-tests
131 changes: 90 additions & 41 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,51 +1,100 @@
// swift-tools-version:5.3
// swift-tools-version:6.0
import PackageDescription

let defaultSwiftSettings: [SwiftSetting] = [
.swiftLanguageMode(.v6),
.enableExperimentalFeature("AvailabilityMacro=swiftHTML 1.0:macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0"),

// https://github.com/swiftlang/swift-evolution/blob/main/proposals/0444-member-import-visibility.md
.enableUpcomingFeature("MemberImportVisibility"),
]

let package = Package(
name: "swift-html",
platforms: [
.macOS(.v10_15)
],
products: [
.library(name: "SwiftSgml", targets: ["SwiftSgml"]),
.library(name: "SwiftHtml", targets: ["SwiftHtml"]),
.library(name: "SwiftSvg", targets: ["SwiftSvg"]),
.library(name: "DOM", targets: ["DOM"]),
.library(name: "SGML", targets: ["SGML"]),
.library(name: "SwiftHTML", targets: ["SwiftHTML"]),
.library(name: "SwiftRSS", targets: ["SwiftRSS"]),
.library(name: "SwiftSitemap", targets: ["SwiftSitemap"]),
.library(name: "SwiftRss", targets: ["SwiftRss"]),
],
dependencies: [

.library(name: "SwiftSVG", targets: ["SwiftSVG"]),
],
targets: [
.target(name: "SwiftSgml", dependencies: []),
.target(name: "SwiftHtml", dependencies: [
.target(name: "SwiftSgml")
]),
.target(name: "SwiftSvg", dependencies: [
.target(name: "SwiftSgml")
]),
.target(name: "SwiftSitemap", dependencies: [
.target(name: "SwiftSgml")
]),
.target(name: "SwiftRss", dependencies: [
.target(name: "SwiftSgml")
]),
.testTarget(name: "SwiftSgmlTests", dependencies: [
.target(name: "SwiftSgml"),
]),
.testTarget(name: "SwiftHtmlTests", dependencies: [
.target(name: "SwiftHtml"),
]),
.testTarget(name: "SwiftSvgTests", dependencies: [
.target(name: "SwiftSvg"),
]),
.testTarget(name: "SwiftSitemapTests", dependencies: [
.target(name: "SwiftSitemap"),
]),
.testTarget(name: "SwiftRssTests", dependencies: [
.target(name: "SwiftRss"),
]),
.target(
name: "DOM",
swiftSettings: defaultSwiftSettings
),
.target(
name: "SGML",
dependencies: [
.target(name: "DOM")
],
swiftSettings: defaultSwiftSettings
),
.target(
name: "SwiftHTML",
dependencies: [
.target(name: "SGML")
],
swiftSettings: defaultSwiftSettings
),
.target(
name: "SwiftRSS",
dependencies: [
.target(name: "SGML")
],
swiftSettings: defaultSwiftSettings
),
.target(
name: "SwiftSitemap",
dependencies: [
.target(name: "SGML")
],
swiftSettings: defaultSwiftSettings
),
.target(
name: "SwiftSVG",
dependencies: [
.target(name: "SGML")
],
swiftSettings: defaultSwiftSettings
),
// MARK: - test
.testTarget(
name: "DOMTests",
dependencies: [
.target(name: "DOM")
]
),
.testTarget(
name: "SGMLTests",
dependencies: [
.target(name: "SGML")
]
),
.testTarget(
name: "SwiftHTMLTests",
dependencies: [
.target(name: "SwiftHTML")
]
),
.testTarget(
name: "SwiftRSSTests",
dependencies: [
.target(name: "SwiftRSS")
]
),
.testTarget(
name: "SwiftSitemapTests",
dependencies: [
.target(name: "SwiftSitemap")
]
),
.testTarget(
name: "SwiftSVGTests",
dependencies: [
.target(name: "SwiftSVG")
]
),
]
)


Loading