html_compose.attributes.link_attrs
1from . import BaseAttribute 2from typing import Literal 3from ..base_types import Resolvable, StrLike 4 5 6class LinkAttrs: 7 """ 8 This module contains functions for attributes in the 'link' element. 9 Which is inherited by a class so we can generate type hints 10 """ 11 12 @staticmethod 13 def as_(value) -> BaseAttribute: 14 """ 15 "link" attribute: as 16 Potential destination for a preload request (for rel="preload" and rel="modulepreload") 17 18 Args: 19 value: 20 Potential destination, for rel="preload"; script-like destination, for rel="modulepreload" 21 22 Returns: 23 An as attribute to be added to your element 24 25 """ 26 27 return BaseAttribute("as", value) 28 29 @staticmethod 30 def blocking(value: Resolvable) -> BaseAttribute: 31 """ 32 "link" attribute: blocking 33 Whether the element is potentially render-blocking 34 35 Args: 36 value: 37 Unordered set of unique space-separated tokens* 38 39 Returns: 40 An blocking attribute to be added to your element 41 42 """ 43 44 return BaseAttribute("blocking", value) 45 46 @staticmethod 47 def color(value) -> BaseAttribute: 48 """ 49 "link" attribute: color 50 Color to use when customizing a site's icon (for rel="mask-icon") 51 52 Args: 53 value: 54 CSS <color> 55 56 Returns: 57 An color attribute to be added to your element 58 59 """ 60 61 return BaseAttribute("color", value) 62 63 @staticmethod 64 def crossorigin( 65 value: Literal["anonymous", "use-credentials"], 66 ) -> BaseAttribute: 67 """ 68 "link" attribute: crossorigin 69 How the element handles crossorigin requests 70 71 Args: 72 value: 73 ['anonymous', 'use-credentials'] 74 75 Returns: 76 An crossorigin attribute to be added to your element 77 78 """ 79 80 return BaseAttribute("crossorigin", value) 81 82 @staticmethod 83 def disabled(value: bool) -> BaseAttribute: 84 """ 85 "link" attribute: disabled 86 Whether the link is disabled 87 88 Args: 89 value: 90 Boolean attribute 91 92 Returns: 93 An disabled attribute to be added to your element 94 95 """ 96 97 return BaseAttribute("disabled", value) 98 99 @staticmethod 100 def fetchpriority(value: Literal["auto", "high", "low"]) -> BaseAttribute: 101 """ 102 "link" attribute: fetchpriority 103 Sets the priority for fetches initiated by the element 104 105 Args: 106 value: 107 ['auto', 'high', 'low'] 108 109 Returns: 110 An fetchpriority attribute to be added to your element 111 112 """ 113 114 return BaseAttribute("fetchpriority", value) 115 116 @staticmethod 117 def href(value) -> BaseAttribute: 118 """ 119 "link" attribute: href 120 Address of the hyperlink 121 122 Args: 123 value: 124 Valid non-empty URL potentially surrounded by spaces 125 126 Returns: 127 An href attribute to be added to your element 128 129 """ 130 131 return BaseAttribute("href", value) 132 133 @staticmethod 134 def hreflang(value) -> BaseAttribute: 135 """ 136 "link" attribute: hreflang 137 Language of the linked resource 138 139 Args: 140 value: 141 Valid BCP 47 language tag 142 143 Returns: 144 An hreflang attribute to be added to your element 145 146 """ 147 148 return BaseAttribute("hreflang", value) 149 150 @staticmethod 151 def imagesizes(value) -> BaseAttribute: 152 """ 153 "link" attribute: imagesizes 154 Image sizes for different page layouts (for rel="preload") 155 156 Args: 157 value: 158 Valid source size list 159 160 Returns: 161 An imagesizes attribute to be added to your element 162 163 """ 164 165 return BaseAttribute("imagesizes", value) 166 167 @staticmethod 168 def imagesrcset(value) -> BaseAttribute: 169 """ 170 "link" attribute: imagesrcset 171 Images to use in different situations, e.g., high-resolution displays, small monitors, etc. (for rel="preload") 172 173 Args: 174 value: 175 Comma-separated list of image candidate strings 176 177 Returns: 178 An imagesrcset attribute to be added to your element 179 180 """ 181 182 return BaseAttribute("imagesrcset", value) 183 184 @staticmethod 185 def integrity(value: StrLike) -> BaseAttribute: 186 """ 187 "link" attribute: integrity 188 Integrity metadata used in Subresource Integrity checks [SRI] 189 190 Args: 191 value: 192 Text 193 194 Returns: 195 An integrity attribute to be added to your element 196 197 """ 198 199 return BaseAttribute("integrity", value) 200 201 @staticmethod 202 def media(value) -> BaseAttribute: 203 """ 204 "link" attribute: media 205 Applicable media 206 207 Args: 208 value: 209 Valid media query list 210 211 Returns: 212 An media attribute to be added to your element 213 214 """ 215 216 return BaseAttribute("media", value) 217 218 @staticmethod 219 def referrerpolicy(value) -> BaseAttribute: 220 """ 221 "link" attribute: referrerpolicy 222 Referrer policy for fetches initiated by the element 223 224 Args: 225 value: 226 Referrer policy 227 228 Returns: 229 An referrerpolicy attribute to be added to your element 230 231 """ 232 233 return BaseAttribute("referrerpolicy", value) 234 235 @staticmethod 236 def rel(value: Resolvable) -> BaseAttribute: 237 """ 238 "link" attribute: rel 239 Relationship between the document containing the hyperlink and the destination resource 240 241 Args: 242 value: 243 Unordered set of unique space-separated tokens* 244 245 Returns: 246 An rel attribute to be added to your element 247 248 """ 249 250 return BaseAttribute("rel", value) 251 252 @staticmethod 253 def sizes(value: Resolvable) -> BaseAttribute: 254 """ 255 "link" attribute: sizes 256 Sizes of the icons (for rel="icon") 257 258 Args: 259 value: 260 Unordered set of unique space-separated tokens, ASCII case-insensitive, consisting of sizes* 261 262 Returns: 263 An sizes attribute to be added to your element 264 265 """ 266 267 return BaseAttribute("sizes", value) 268 269 @staticmethod 270 def title(value) -> BaseAttribute: 271 """ 272 "link" attribute: title 273 Title of the link OR CSS style sheet set name 274 275 Args: 276 value: 277 Text OR Text 278 279 Returns: 280 An title attribute to be added to your element 281 282 """ 283 284 return BaseAttribute("title", value) 285 286 @staticmethod 287 def type(value) -> BaseAttribute: 288 """ 289 "link" attribute: type 290 Hint for the type of the referenced resource 291 292 Args: 293 value: 294 Valid MIME type string 295 296 Returns: 297 An type attribute to be added to your element 298 299 """ 300 301 return BaseAttribute("type", value)
7class LinkAttrs: 8 """ 9 This module contains functions for attributes in the 'link' element. 10 Which is inherited by a class so we can generate type hints 11 """ 12 13 @staticmethod 14 def as_(value) -> BaseAttribute: 15 """ 16 "link" attribute: as 17 Potential destination for a preload request (for rel="preload" and rel="modulepreload") 18 19 Args: 20 value: 21 Potential destination, for rel="preload"; script-like destination, for rel="modulepreload" 22 23 Returns: 24 An as attribute to be added to your element 25 26 """ 27 28 return BaseAttribute("as", value) 29 30 @staticmethod 31 def blocking(value: Resolvable) -> BaseAttribute: 32 """ 33 "link" attribute: blocking 34 Whether the element is potentially render-blocking 35 36 Args: 37 value: 38 Unordered set of unique space-separated tokens* 39 40 Returns: 41 An blocking attribute to be added to your element 42 43 """ 44 45 return BaseAttribute("blocking", value) 46 47 @staticmethod 48 def color(value) -> BaseAttribute: 49 """ 50 "link" attribute: color 51 Color to use when customizing a site's icon (for rel="mask-icon") 52 53 Args: 54 value: 55 CSS <color> 56 57 Returns: 58 An color attribute to be added to your element 59 60 """ 61 62 return BaseAttribute("color", value) 63 64 @staticmethod 65 def crossorigin( 66 value: Literal["anonymous", "use-credentials"], 67 ) -> BaseAttribute: 68 """ 69 "link" attribute: crossorigin 70 How the element handles crossorigin requests 71 72 Args: 73 value: 74 ['anonymous', 'use-credentials'] 75 76 Returns: 77 An crossorigin attribute to be added to your element 78 79 """ 80 81 return BaseAttribute("crossorigin", value) 82 83 @staticmethod 84 def disabled(value: bool) -> BaseAttribute: 85 """ 86 "link" attribute: disabled 87 Whether the link is disabled 88 89 Args: 90 value: 91 Boolean attribute 92 93 Returns: 94 An disabled attribute to be added to your element 95 96 """ 97 98 return BaseAttribute("disabled", value) 99 100 @staticmethod 101 def fetchpriority(value: Literal["auto", "high", "low"]) -> BaseAttribute: 102 """ 103 "link" attribute: fetchpriority 104 Sets the priority for fetches initiated by the element 105 106 Args: 107 value: 108 ['auto', 'high', 'low'] 109 110 Returns: 111 An fetchpriority attribute to be added to your element 112 113 """ 114 115 return BaseAttribute("fetchpriority", value) 116 117 @staticmethod 118 def href(value) -> BaseAttribute: 119 """ 120 "link" attribute: href 121 Address of the hyperlink 122 123 Args: 124 value: 125 Valid non-empty URL potentially surrounded by spaces 126 127 Returns: 128 An href attribute to be added to your element 129 130 """ 131 132 return BaseAttribute("href", value) 133 134 @staticmethod 135 def hreflang(value) -> BaseAttribute: 136 """ 137 "link" attribute: hreflang 138 Language of the linked resource 139 140 Args: 141 value: 142 Valid BCP 47 language tag 143 144 Returns: 145 An hreflang attribute to be added to your element 146 147 """ 148 149 return BaseAttribute("hreflang", value) 150 151 @staticmethod 152 def imagesizes(value) -> BaseAttribute: 153 """ 154 "link" attribute: imagesizes 155 Image sizes for different page layouts (for rel="preload") 156 157 Args: 158 value: 159 Valid source size list 160 161 Returns: 162 An imagesizes attribute to be added to your element 163 164 """ 165 166 return BaseAttribute("imagesizes", value) 167 168 @staticmethod 169 def imagesrcset(value) -> BaseAttribute: 170 """ 171 "link" attribute: imagesrcset 172 Images to use in different situations, e.g., high-resolution displays, small monitors, etc. (for rel="preload") 173 174 Args: 175 value: 176 Comma-separated list of image candidate strings 177 178 Returns: 179 An imagesrcset attribute to be added to your element 180 181 """ 182 183 return BaseAttribute("imagesrcset", value) 184 185 @staticmethod 186 def integrity(value: StrLike) -> BaseAttribute: 187 """ 188 "link" attribute: integrity 189 Integrity metadata used in Subresource Integrity checks [SRI] 190 191 Args: 192 value: 193 Text 194 195 Returns: 196 An integrity attribute to be added to your element 197 198 """ 199 200 return BaseAttribute("integrity", value) 201 202 @staticmethod 203 def media(value) -> BaseAttribute: 204 """ 205 "link" attribute: media 206 Applicable media 207 208 Args: 209 value: 210 Valid media query list 211 212 Returns: 213 An media attribute to be added to your element 214 215 """ 216 217 return BaseAttribute("media", value) 218 219 @staticmethod 220 def referrerpolicy(value) -> BaseAttribute: 221 """ 222 "link" attribute: referrerpolicy 223 Referrer policy for fetches initiated by the element 224 225 Args: 226 value: 227 Referrer policy 228 229 Returns: 230 An referrerpolicy attribute to be added to your element 231 232 """ 233 234 return BaseAttribute("referrerpolicy", value) 235 236 @staticmethod 237 def rel(value: Resolvable) -> BaseAttribute: 238 """ 239 "link" attribute: rel 240 Relationship between the document containing the hyperlink and the destination resource 241 242 Args: 243 value: 244 Unordered set of unique space-separated tokens* 245 246 Returns: 247 An rel attribute to be added to your element 248 249 """ 250 251 return BaseAttribute("rel", value) 252 253 @staticmethod 254 def sizes(value: Resolvable) -> BaseAttribute: 255 """ 256 "link" attribute: sizes 257 Sizes of the icons (for rel="icon") 258 259 Args: 260 value: 261 Unordered set of unique space-separated tokens, ASCII case-insensitive, consisting of sizes* 262 263 Returns: 264 An sizes attribute to be added to your element 265 266 """ 267 268 return BaseAttribute("sizes", value) 269 270 @staticmethod 271 def title(value) -> BaseAttribute: 272 """ 273 "link" attribute: title 274 Title of the link OR CSS style sheet set name 275 276 Args: 277 value: 278 Text OR Text 279 280 Returns: 281 An title attribute to be added to your element 282 283 """ 284 285 return BaseAttribute("title", value) 286 287 @staticmethod 288 def type(value) -> BaseAttribute: 289 """ 290 "link" attribute: type 291 Hint for the type of the referenced resource 292 293 Args: 294 value: 295 Valid MIME type string 296 297 Returns: 298 An type attribute to be added to your element 299 300 """ 301 302 return BaseAttribute("type", value)
This module contains functions for attributes in the 'link' element. Which is inherited by a class so we can generate type hints
13 @staticmethod 14 def as_(value) -> BaseAttribute: 15 """ 16 "link" attribute: as 17 Potential destination for a preload request (for rel="preload" and rel="modulepreload") 18 19 Args: 20 value: 21 Potential destination, for rel="preload"; script-like destination, for rel="modulepreload" 22 23 Returns: 24 An as attribute to be added to your element 25 26 """ 27 28 return BaseAttribute("as", value)
"link" attribute: as Potential destination for a preload request (for rel="preload" and rel="modulepreload")
Args: value: Potential destination, for rel="preload"; script-like destination, for rel="modulepreload"
Returns: An as attribute to be added to your element
30 @staticmethod 31 def blocking(value: Resolvable) -> BaseAttribute: 32 """ 33 "link" attribute: blocking 34 Whether the element is potentially render-blocking 35 36 Args: 37 value: 38 Unordered set of unique space-separated tokens* 39 40 Returns: 41 An blocking attribute to be added to your element 42 43 """ 44 45 return BaseAttribute("blocking", value)
"link" attribute: blocking Whether the element is potentially render-blocking
Args: value: Unordered set of unique space-separated tokens*
Returns: An blocking attribute to be added to your element
47 @staticmethod 48 def color(value) -> BaseAttribute: 49 """ 50 "link" attribute: color 51 Color to use when customizing a site's icon (for rel="mask-icon") 52 53 Args: 54 value: 55 CSS <color> 56 57 Returns: 58 An color attribute to be added to your element 59 60 """ 61 62 return BaseAttribute("color", value)
"link" attribute: color Color to use when customizing a site's icon (for rel="mask-icon")
Args:
value:
CSS
Returns: An color attribute to be added to your element
64 @staticmethod 65 def crossorigin( 66 value: Literal["anonymous", "use-credentials"], 67 ) -> BaseAttribute: 68 """ 69 "link" attribute: crossorigin 70 How the element handles crossorigin requests 71 72 Args: 73 value: 74 ['anonymous', 'use-credentials'] 75 76 Returns: 77 An crossorigin attribute to be added to your element 78 79 """ 80 81 return BaseAttribute("crossorigin", value)
"link" attribute: crossorigin How the element handles crossorigin requests
Args: value: ['anonymous', 'use-credentials']
Returns: An crossorigin attribute to be added to your element
83 @staticmethod 84 def disabled(value: bool) -> BaseAttribute: 85 """ 86 "link" attribute: disabled 87 Whether the link is disabled 88 89 Args: 90 value: 91 Boolean attribute 92 93 Returns: 94 An disabled attribute to be added to your element 95 96 """ 97 98 return BaseAttribute("disabled", value)
"link" attribute: disabled Whether the link is disabled
Args: value: Boolean attribute
Returns: An disabled attribute to be added to your element
100 @staticmethod 101 def fetchpriority(value: Literal["auto", "high", "low"]) -> BaseAttribute: 102 """ 103 "link" attribute: fetchpriority 104 Sets the priority for fetches initiated by the element 105 106 Args: 107 value: 108 ['auto', 'high', 'low'] 109 110 Returns: 111 An fetchpriority attribute to be added to your element 112 113 """ 114 115 return BaseAttribute("fetchpriority", value)
"link" attribute: fetchpriority Sets the priority for fetches initiated by the element
Args: value: ['auto', 'high', 'low']
Returns: An fetchpriority attribute to be added to your element
117 @staticmethod 118 def href(value) -> BaseAttribute: 119 """ 120 "link" attribute: href 121 Address of the hyperlink 122 123 Args: 124 value: 125 Valid non-empty URL potentially surrounded by spaces 126 127 Returns: 128 An href attribute to be added to your element 129 130 """ 131 132 return BaseAttribute("href", value)
"link" attribute: href Address of the hyperlink
Args: value: Valid non-empty URL potentially surrounded by spaces
Returns: An href attribute to be added to your element
134 @staticmethod 135 def hreflang(value) -> BaseAttribute: 136 """ 137 "link" attribute: hreflang 138 Language of the linked resource 139 140 Args: 141 value: 142 Valid BCP 47 language tag 143 144 Returns: 145 An hreflang attribute to be added to your element 146 147 """ 148 149 return BaseAttribute("hreflang", value)
"link" attribute: hreflang Language of the linked resource
Args: value: Valid BCP 47 language tag
Returns: An hreflang attribute to be added to your element
151 @staticmethod 152 def imagesizes(value) -> BaseAttribute: 153 """ 154 "link" attribute: imagesizes 155 Image sizes for different page layouts (for rel="preload") 156 157 Args: 158 value: 159 Valid source size list 160 161 Returns: 162 An imagesizes attribute to be added to your element 163 164 """ 165 166 return BaseAttribute("imagesizes", value)
"link" attribute: imagesizes Image sizes for different page layouts (for rel="preload")
Args: value: Valid source size list
Returns: An imagesizes attribute to be added to your element
168 @staticmethod 169 def imagesrcset(value) -> BaseAttribute: 170 """ 171 "link" attribute: imagesrcset 172 Images to use in different situations, e.g., high-resolution displays, small monitors, etc. (for rel="preload") 173 174 Args: 175 value: 176 Comma-separated list of image candidate strings 177 178 Returns: 179 An imagesrcset attribute to be added to your element 180 181 """ 182 183 return BaseAttribute("imagesrcset", value)
"link" attribute: imagesrcset Images to use in different situations, e.g., high-resolution displays, small monitors, etc. (for rel="preload")
Args: value: Comma-separated list of image candidate strings
Returns: An imagesrcset attribute to be added to your element
185 @staticmethod 186 def integrity(value: StrLike) -> BaseAttribute: 187 """ 188 "link" attribute: integrity 189 Integrity metadata used in Subresource Integrity checks [SRI] 190 191 Args: 192 value: 193 Text 194 195 Returns: 196 An integrity attribute to be added to your element 197 198 """ 199 200 return BaseAttribute("integrity", value)
"link" attribute: integrity Integrity metadata used in Subresource Integrity checks [SRI]
Args: value: Text
Returns: An integrity attribute to be added to your element
202 @staticmethod 203 def media(value) -> BaseAttribute: 204 """ 205 "link" attribute: media 206 Applicable media 207 208 Args: 209 value: 210 Valid media query list 211 212 Returns: 213 An media attribute to be added to your element 214 215 """ 216 217 return BaseAttribute("media", value)
"link" attribute: media Applicable media
Args: value: Valid media query list
Returns: An media attribute to be added to your element
219 @staticmethod 220 def referrerpolicy(value) -> BaseAttribute: 221 """ 222 "link" attribute: referrerpolicy 223 Referrer policy for fetches initiated by the element 224 225 Args: 226 value: 227 Referrer policy 228 229 Returns: 230 An referrerpolicy attribute to be added to your element 231 232 """ 233 234 return BaseAttribute("referrerpolicy", value)
"link" attribute: referrerpolicy Referrer policy for fetches initiated by the element
Args: value: Referrer policy
Returns: An referrerpolicy attribute to be added to your element
236 @staticmethod 237 def rel(value: Resolvable) -> BaseAttribute: 238 """ 239 "link" attribute: rel 240 Relationship between the document containing the hyperlink and the destination resource 241 242 Args: 243 value: 244 Unordered set of unique space-separated tokens* 245 246 Returns: 247 An rel attribute to be added to your element 248 249 """ 250 251 return BaseAttribute("rel", value)
"link" attribute: rel Relationship between the document containing the hyperlink and the destination resource
Args: value: Unordered set of unique space-separated tokens*
Returns: An rel attribute to be added to your element
253 @staticmethod 254 def sizes(value: Resolvable) -> BaseAttribute: 255 """ 256 "link" attribute: sizes 257 Sizes of the icons (for rel="icon") 258 259 Args: 260 value: 261 Unordered set of unique space-separated tokens, ASCII case-insensitive, consisting of sizes* 262 263 Returns: 264 An sizes attribute to be added to your element 265 266 """ 267 268 return BaseAttribute("sizes", value)
"link" attribute: sizes Sizes of the icons (for rel="icon")
Args: value: Unordered set of unique space-separated tokens, ASCII case-insensitive, consisting of sizes*
Returns: An sizes attribute to be added to your element
270 @staticmethod 271 def title(value) -> BaseAttribute: 272 """ 273 "link" attribute: title 274 Title of the link OR CSS style sheet set name 275 276 Args: 277 value: 278 Text OR Text 279 280 Returns: 281 An title attribute to be added to your element 282 283 """ 284 285 return BaseAttribute("title", value)
"link" attribute: title Title of the link OR CSS style sheet set name
Args: value: Text OR Text
Returns: An title attribute to be added to your element
287 @staticmethod 288 def type(value) -> BaseAttribute: 289 """ 290 "link" attribute: type 291 Hint for the type of the referenced resource 292 293 Args: 294 value: 295 Valid MIME type string 296 297 Returns: 298 An type attribute to be added to your element 299 300 """ 301 302 return BaseAttribute("type", value)
"link" attribute: type Hint for the type of the referenced resource
Args: value: Valid MIME type string
Returns: An type attribute to be added to your element