File tree 2 files changed +36
-0
lines changed
crates/rari-doc/src/templ/templs
2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ pub mod links;
9
9
pub mod listsubpages;
10
10
pub mod livesample;
11
11
pub mod quick_links_with_subpages;
12
+ pub mod secure_context;
12
13
pub mod seecompattable;
13
14
pub mod specification;
14
15
@@ -44,6 +45,8 @@ pub fn invoke(
44
45
"optional_inline" => badges:: optional_any,
45
46
"readonlyinline" => badges:: readonly_any,
46
47
"seecompattable" => seecompattable:: see_compat_table_any,
48
+ "securecontext_header" => secure_context:: secure_context_header_any,
49
+ "securecontext_inline" => secure_context:: secure_context_inline_any,
47
50
48
51
// links
49
52
"csp" => links:: csp:: csp_any,
Original file line number Diff line number Diff line change
1
+ use rari_templ_func:: rari_f;
2
+
3
+ use crate :: error:: DocError ;
4
+
5
+ #[ rari_f]
6
+ pub fn secure_context_inline ( ) -> Result < String , DocError > {
7
+ let title = rari_l10n:: l10n_json_data ( "Template" , "secure_context_label" , env. locale ) ?;
8
+ let copy = rari_l10n:: l10n_json_data ( "Template" , "secure_context_inline_copy" , env. locale ) ?;
9
+
10
+ Ok ( [
11
+ r#"<span class="badge inline secure" title=""# ,
12
+ & html_escape:: encode_double_quoted_attribute ( copy) ,
13
+ r#"">"# ,
14
+ title,
15
+ "</span>" ,
16
+ ]
17
+ . join ( "" ) )
18
+ }
19
+
20
+ #[ rari_f]
21
+ pub fn secure_context_header ( ) -> Result < String , DocError > {
22
+ let title = rari_l10n:: l10n_json_data ( "Template" , "secure_context_label" , env. locale ) ?;
23
+ let copy = rari_l10n:: l10n_json_data ( "Template" , "secure_context_header_copy" , env. locale ) ?;
24
+
25
+ Ok ( [
26
+ r#"<div class="notecard secure"><strong>"# ,
27
+ & html_escape:: encode_double_quoted_attribute ( title) ,
28
+ ":</strong> " ,
29
+ copy,
30
+ "</div>" ,
31
+ ]
32
+ . join ( "" ) )
33
+ }
You can’t perform that action at this time.
0 commit comments