@@ -68,7 +68,11 @@ like_uri({str}) *Vital.Web.URI.like_uri()*
6868
6969 *Vital.Web.URI.new_default_pattern_set()*
7070new_default_pattern_set()
71- Returns | Vital.Web.URI-PatternSet | .
71+ Creates a new | Vital.Web.URI-PatternSet | object.
72+
73+ *Vital.Web.URI.clone_pattern_set()*
74+ clone_pattern_set({patternset} )
75+ Clones a | Vital.Web.URI-PatternSet | object.
7276
7377encode({str} [, {char-enc} ]) *Vital.Web.URI.encode()*
7478 Encodes {str} to Percent-encoding string.
@@ -144,70 +148,70 @@ is_path({str})
144148is_query({str} )
145149is_fragment({str} )
146150
147- Returns non-zero value if {str} has right syntax
148- for each component. Returns zero otherwise.
151+ Returns non-zero value if {str} has right syntax
152+ for each component. Returns zero otherwise.
149153
150154*Vital.Web.URI-URI.clone()*
151155clone()
152156
153- This method clones a URI object itself. >
154- let s:URI = vital#{plugin-name}#new().import('Web.URI')
155- let uri = s:URI.new('http://example.com/')
156- let copyuri = uri.clone().relative('/a/b/c')
157- echo uri.to_string()
158- " => 'http://example.com/'
159- echo copyuri.to_string()
160- " => 'http://example.com/a/b/c'
157+ This method clones a URI object itself. >
158+ let s:URI = vital#{plugin-name}#new().import('Web.URI')
159+ let uri = s:URI.new('http://example.com/')
160+ let copyuri = uri.clone().relative('/a/b/c')
161+ echo uri.to_string()
162+ " => 'http://example.com/'
163+ echo copyuri.to_string()
164+ " => 'http://example.com/a/b/c'
161165<
162166*Vital.Web.URI-URI.relative()*
163167relative({reluri} )
164168
165- This method ...
166- * Calculates a URI from
167- base URI and relative URI({reluri} ).
168- * Changes the URI object itself (destructive).
169- * Returns the URI object itself.
170- * Calls | Vital.Web.URI-URI.relative() | implicitly.
171-
172- Example: >
173- let s:URI = vital#{plugin-name}#new().import('Web.URI')
174- let BASE_URI = 'http://example.com/foo/bar'
175- let RELATIVE_URI = '../baz'
176- echo s:URI.new(BASE_URI).relative(RELATIVE_URI).to_string()
177- " => 'http://example.com/baz'
178-
179- let BASE_URI = 'http://example.com/foo/bar/'
180- let RELATIVE_URI = '../baz'
181- echo s:URI.new(BASE_URI).relative(RELATIVE_URI).to_string()
182- " => 'http://example.com/foo/baz'
169+ This method ...
170+ * Calculates a URI from
171+ base URI and relative URI({reluri} ).
172+ * Changes the URI object itself (destructive).
173+ * Returns the URI object itself.
174+ * Calls | Vital.Web.URI-URI.relative() | implicitly.
175+
176+ Example: >
177+ let s:URI = vital#{plugin-name}#new().import('Web.URI')
178+ let BASE_URI = 'http://example.com/foo/bar'
179+ let RELATIVE_URI = '../baz'
180+ echo s:URI.new(BASE_URI).relative(RELATIVE_URI).to_string()
181+ " => 'http://example.com/baz'
182+
183+ let BASE_URI = 'http://example.com/foo/bar/'
184+ let RELATIVE_URI = '../baz'
185+ echo s:URI.new(BASE_URI).relative(RELATIVE_URI).to_string()
186+ " => 'http://example.com/foo/baz'
183187<
184188*Vital.Web.URI-URI.canonicalize()*
185189canonicalize()
186190
187- This method ...
188- * Canonicalizes the URI.
189- * Changes the URI object itself (destructive).
190- * Returns the URI object itself.
191-
192- See Web.URI.* modules for supported schemes.
193- For example, the following four URIs
194- becomes equivalent URI (http://example.com/ ).
195- * http://example.com
196- * http://example.com/
197- * http://example.com:/
198- * http://example.com:80/
199-
200- Example: >
201- let s:URI = vital#{plugin-name}#new().import('Web.URI')
202- echo s:URI.new('http://example.com:80/').to_string()
203- " => 'http://example.com/'
191+ This method ...
192+ * Canonicalizes the URI.
193+ * Changes the URI object itself (destructive).
194+ * Returns the URI object itself.
195+
196+ See Web.URI.* modules for supported schemes.
197+ For example, the following four URIs
198+ becomes equivalent URI (http://example.com/ ).
199+ * http://example.com
200+ * http://example.com/
201+ * http://example.com:/
202+ * http://example.com:80/
203+
204+ Example: >
205+ let s:URI = vital#{plugin-name}#new().import('Web.URI')
206+ echo s:URI.new('http://example.com:80/').to_string()
207+ " => 'http://example.com/'
204208<
205209*Vital.Web.URI-URI.default_port()*
206210default_port()
207211
208- This method returns the default port for current scheme.
209- (e.g.: 80 for "http" scheme)
210- See Web.URI.* modules for supported schemes.
212+ This method returns the default port for current scheme.
213+ (e.g.: 80 for "http" scheme)
214+ See Web.URI.* modules for supported schemes.
211215
212216------------------------------------------------------------------------------
213217PATTERNSET OBJECT *Vital.Web.URI-PatternSet*
@@ -232,28 +236,28 @@ According to RFC3986, URI allows
232236but these characters often appears in ordinary text.
233237This code lets the parser ignore these characters. >
234238
235- let s:LoosePatternSet = s:URI.new_default_pattern_set()
239+ let s:LoosePatternSet = s:URI.new_default_pattern_set()
236240
237- " Remove "'", "(", ")" from default sub_delims().
238- function! s:LoosePatternSet.sub_delims() abort
239- return '[!$&*+,;=]'
240- endfunction
241+ " Remove "'", "(", ")" from default sub_delims().
242+ function! s:LoosePatternSet.sub_delims() abort
243+ return '[!$&*+,;=]'
244+ endfunction
241245
242- " Ignore trailing string after URI.
243- let NONE = []
244- let ret = URI.new_from_seq_string(
245- \ 'http://example.com)', NONE, s:LoosePatternSet)
246- if ret isnot NONE
247- ...
248- endif
246+ " Ignore trailing string after URI.
247+ let NONE = []
248+ let ret = URI.new_from_seq_string(
249+ \ 'http://example.com)', NONE, s:LoosePatternSet)
250+ if ret isnot NONE
251+ ...
252+ endif
249253<
250254
251255get({component} ) *Vital.Web.URI-PatternSet.get()*
252256
253- Returns each component definition.
257+ Returns each component definition.
254258>
255- let s:PatternSet = s:URI.new_default_pattern_set()
256- echo s:PatternSet.get('scheme')
259+ let s:PatternSet = s:URI.new_default_pattern_set()
260+ echo s:PatternSet.get('scheme')
257261<
258262Listing all customizable components here (alphabetic order).
259263NOTE: DON'T call these methods directly.
0 commit comments