Skip to content

Commit 5474a3e

Browse files
committed
improve Documentation.docc with comprehensive type catalog
- Replace placeholder content with detailed package overview - Add clear description of modular architecture and benefits - Include practical usage examples with type-safe HTML creation - Organize documentation into logical sections for discoverability - Focus on essential elements and attributes to avoid symbol ambiguity - Enhance developer experience with IDE-friendly symbol references
1 parent 9e3f6cf commit 5474a3e

File tree

1 file changed

+96
-5
lines changed

1 file changed

+96
-5
lines changed
Lines changed: 96 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,104 @@
1-
# ``swift-html-types``
1+
# ``HTMLTypes``
22

3-
<!--@START_MENU_TOKEN@-->Summary<!--@END_MENU_TOKEN@-->
3+
A comprehensive, accurate, and type-safe domain model of HTML elements and attributes in Swift.
44

55
## Overview
66

7-
<!--@START_MENU_TOKEN@-->Text<!--@END_MENU_TOKEN@-->
7+
The `swift-html-types` package provides a complete type-safe representation of HTML elements and their attributes. It ensures compile-time safety when working with HTML, preventing common errors like using invalid attributes on specific elements.
8+
9+
The package is organized into several focused modules:
10+
11+
- **HTMLTypes**: The main umbrella module that re-exports all core functionality
12+
- **HTMLAttributeTypes**: Type-safe HTML attribute definitions and protocols
13+
- **HTMLElementTypes**: HTML element types with their permitted attributes
14+
- **HTMLTypesFoundation**: Foundation integration for enhanced URL and string handling
15+
16+
### Key Benefits
17+
18+
- **Type Safety**: Compile-time validation of HTML structure and attributes
19+
- **Discoverability**: IDE autocompletion reveals valid attributes for each element
20+
- **Accuracy**: Faithful representation of HTML5 specification
21+
- **Composability**: Works seamlessly with other Swift HTML generation libraries
22+
23+
### Example Usage
24+
25+
```swift
26+
import HTMLTypes
27+
28+
// Type-safe element creation with appropriate attributes
29+
let anchor = Anchor(href: "https://example.com")
30+
let searchInput = Input.search(
31+
name: "query",
32+
placeholder: "Search...",
33+
required: true
34+
)
35+
```
836

937
## Topics
1038

11-
### <!--@START_MENU_TOKEN@-->Group<!--@END_MENU_TOKEN@-->
39+
### Core Protocols
40+
41+
- ``HTMLElement``
42+
- ``HTMLAttribute``
43+
- ``HTMLVoidElement``
44+
45+
### Essential HTML Elements
46+
47+
- ``Anchor``
48+
- ``Input``
49+
- ``Image``
50+
- ``ContentDivision``
51+
- ``ContentSpan``
52+
- ``Paragraph``
53+
54+
### Document Structure Elements
55+
56+
- ``HtmlRoot``
57+
- ``Head``
58+
- ``Body``
59+
- ``Base``
60+
61+
### Form Elements
62+
63+
- ``Textarea``
64+
- ``FieldSet``
65+
- ``Legend``
66+
67+
### Table Elements
68+
69+
- ``TableRow``
70+
- ``TableDataCell``
71+
- ``TableHeader``
72+
73+
### Essential HTML Attributes
74+
75+
- ``Href``
76+
- ``Src``
77+
- ``Alt``
78+
- ``Id``
79+
- ``Class``
80+
- ``Value``
81+
- ``Disabled``
82+
- ``Required``
83+
84+
### Form Attributes
85+
86+
- ``Action``
87+
- ``Method``
88+
- ``Autocomplete``
89+
- ``Pattern``
90+
- ``Placeholder``
91+
- ``Min``
92+
- ``Max``
93+
94+
### Media Attributes
95+
96+
- ``Width``
97+
- ``Height``
98+
- ``Autoplay``
99+
- ``Loop``
100+
- ``Crossorigin``
101+
102+
### Foundation Integration
12103

13-
- <!--@START_MENU_TOKEN@-->``Symbol``<!--@END_MENU_TOKEN@-->
104+
- ``HTMLTypesFoundation``

0 commit comments

Comments
 (0)