Skip to content

Commit 5a268fb

Browse files
committed
update rustdoc style
1 parent 7724fb3 commit 5a268fb

16 files changed

Lines changed: 649 additions & 228 deletions

crates/emmylua_doc_cli/src/html_generator/init.rs

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,23 @@ pub fn init_html_tl() -> Option<Tera> {
3434
pub fn write_static_assets(output: &Path) -> Result<(), Box<dyn std::error::Error>> {
3535
let static_dir = output.join("static");
3636
std::fs::create_dir_all(&static_dir)?;
37-
for file in STATIC_DIR.files() {
38-
let name = file.path().file_name().unwrap().to_str().unwrap();
39-
std::fs::write(static_dir.join(name), file.contents())?;
37+
write_dir_recursive(&STATIC_DIR, &static_dir)?;
38+
Ok(())
39+
}
40+
41+
/// `Dir::files()` is non-recursive, so walk subdirectories (e.g. `fonts/`)
42+
/// explicitly and mirror the relative path structure under `output`.
43+
fn write_dir_recursive(dir: &Dir, dest_root: &Path) -> Result<(), Box<dyn std::error::Error>> {
44+
for file in dir.files() {
45+
let rel = file.path().to_string_lossy().replace('\\', "/");
46+
let dest = dest_root.join(&rel);
47+
if let Some(parent) = dest.parent() {
48+
std::fs::create_dir_all(parent)?;
49+
}
50+
std::fs::write(dest, file.contents())?;
51+
}
52+
for sub in dir.dirs() {
53+
write_dir_recursive(sub, dest_root)?;
4054
}
4155
Ok(())
4256
}
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
// REUSE-IgnoreStart
2+
3+
Digitized data copyright (c) 2012-2015, The Mozilla Foundation and Telefonica S.A.
4+
with Reserved Font Name < Fira >,
5+
6+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
7+
This license is copied below, and is also available with a FAQ at:
8+
http://scripts.sil.org/OFL
9+
10+
11+
-----------------------------------------------------------
12+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
13+
-----------------------------------------------------------
14+
15+
PREAMBLE
16+
The goals of the Open Font License (OFL) are to stimulate worldwide
17+
development of collaborative font projects, to support the font creation
18+
efforts of academic and linguistic communities, and to provide a free and
19+
open framework in which fonts may be shared and improved in partnership
20+
with others.
21+
22+
The OFL allows the licensed fonts to be used, studied, modified and
23+
redistributed freely as long as they are not sold by themselves. The
24+
fonts, including any derivative works, can be bundled, embedded,
25+
redistributed and/or sold with any software provided that any reserved
26+
names are not used by derivative works. The fonts and derivatives,
27+
however, cannot be released under any other type of license. The
28+
requirement for fonts to remain under this license does not apply
29+
to any document created using the fonts or their derivatives.
30+
31+
DEFINITIONS
32+
"Font Software" refers to the set of files released by the Copyright
33+
Holder(s) under this license and clearly marked as such. This may
34+
include source files, build scripts and documentation.
35+
36+
"Reserved Font Name" refers to any names specified as such after the
37+
copyright statement(s).
38+
39+
"Original Version" refers to the collection of Font Software components as
40+
distributed by the Copyright Holder(s).
41+
42+
"Modified Version" refers to any derivative made by adding to, deleting,
43+
or substituting -- in part or in whole -- any of the components of the
44+
Original Version, by changing formats or by porting the Font Software to a
45+
new environment.
46+
47+
"Author" refers to any designer, engineer, programmer, technical
48+
writer or other person who contributed to the Font Software.
49+
50+
PERMISSION & CONDITIONS
51+
Permission is hereby granted, free of charge, to any person obtaining
52+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
53+
redistribute, and sell modified and unmodified copies of the Font
54+
Software, subject to the following conditions:
55+
56+
1) Neither the Font Software nor any of its individual components,
57+
in Original or Modified Versions, may be sold by itself.
58+
59+
2) Original or Modified Versions of the Font Software may be bundled,
60+
redistributed and/or sold with any software, provided that each copy
61+
contains the above copyright notice and this license. These can be
62+
included either as stand-alone text files, human-readable headers or
63+
in the appropriate machine-readable metadata fields within text or
64+
binary files as long as those fields can be easily viewed by the user.
65+
66+
3) No Modified Version of the Font Software may use the Reserved Font
67+
Name(s) unless explicit written permission is granted by the corresponding
68+
Copyright Holder. This restriction only applies to the primary font name as
69+
presented to the users.
70+
71+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
72+
Software shall not be used to promote, endorse or advertise any
73+
Modified Version, except to acknowledge the contribution(s) of the
74+
Copyright Holder(s) and the Author(s) or with their explicit written
75+
permission.
76+
77+
5) The Font Software, modified or unmodified, in part or in whole,
78+
must be distributed entirely under this license, and must not be
79+
distributed under any other license. The requirement for fonts to
80+
remain under this license does not apply to any document created
81+
using the Font Software.
82+
83+
TERMINATION
84+
This license becomes null and void if any of the above conditions are
85+
not met.
86+
87+
DISCLAIMER
88+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
89+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
90+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
91+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
92+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
93+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
94+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
95+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
96+
OTHER DEALINGS IN THE FONT SOFTWARE.
97+
98+
// REUSE-IgnoreEnd
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
// REUSE-IgnoreStart
2+
3+
Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries.
4+
5+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
6+
7+
This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL
8+
9+
10+
-----------------------------------------------------------
11+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
12+
-----------------------------------------------------------
13+
14+
PREAMBLE
15+
The goals of the Open Font License (OFL) are to stimulate worldwide
16+
development of collaborative font projects, to support the font creation
17+
efforts of academic and linguistic communities, and to provide a free and
18+
open framework in which fonts may be shared and improved in partnership
19+
with others.
20+
21+
The OFL allows the licensed fonts to be used, studied, modified and
22+
redistributed freely as long as they are not sold by themselves. The
23+
fonts, including any derivative works, can be bundled, embedded,
24+
redistributed and/or sold with any software provided that any reserved
25+
names are not used by derivative works. The fonts and derivatives,
26+
however, cannot be released under any other type of license. The
27+
requirement for fonts to remain under this license does not apply
28+
to any document created using the fonts or their derivatives.
29+
30+
DEFINITIONS
31+
"Font Software" refers to the set of files released by the Copyright
32+
Holder(s) under this license and clearly marked as such. This may
33+
include source files, build scripts and documentation.
34+
35+
"Reserved Font Name" refers to any names specified as such after the
36+
copyright statement(s).
37+
38+
"Original Version" refers to the collection of Font Software components as
39+
distributed by the Copyright Holder(s).
40+
41+
"Modified Version" refers to any derivative made by adding to, deleting,
42+
or substituting -- in part or in whole -- any of the components of the
43+
Original Version, by changing formats or by porting the Font Software to a
44+
new environment.
45+
46+
"Author" refers to any designer, engineer, programmer, technical
47+
writer or other person who contributed to the Font Software.
48+
49+
PERMISSION & CONDITIONS
50+
Permission is hereby granted, free of charge, to any person obtaining
51+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
52+
redistribute, and sell modified and unmodified copies of the Font
53+
Software, subject to the following conditions:
54+
55+
1) Neither the Font Software nor any of its individual components,
56+
in Original or Modified Versions, may be sold by itself.
57+
58+
2) Original or Modified Versions of the Font Software may be bundled,
59+
redistributed and/or sold with any software, provided that each copy
60+
contains the above copyright notice and this license. These can be
61+
included either as stand-alone text files, human-readable headers or
62+
in the appropriate machine-readable metadata fields within text or
63+
binary files as long as those fields can be easily viewed by the user.
64+
65+
3) No Modified Version of the Font Software may use the Reserved Font
66+
Name(s) unless explicit written permission is granted by the corresponding
67+
Copyright Holder. This restriction only applies to the primary font name as
68+
presented to the users.
69+
70+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
71+
Software shall not be used to promote, endorse or advertise any
72+
Modified Version, except to acknowledge the contribution(s) of the
73+
Copyright Holder(s) and the Author(s) or with their explicit written
74+
permission.
75+
76+
5) The Font Software, modified or unmodified, in part or in whole,
77+
must be distributed entirely under this license, and must not be
78+
distributed under any other license. The requirement for fonts to
79+
remain under this license does not apply to any document created
80+
using the Font Software.
81+
82+
TERMINATION
83+
This license becomes null and void if any of the above conditions are
84+
not met.
85+
86+
DISCLAIMER
87+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
88+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
89+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
90+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
91+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
92+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
93+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
94+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
95+
OTHER DEALINGS IN THE FONT SOFTWARE.
96+
97+
// REUSE-IgnoreEnd
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)