Skip to content

Commit bd58672

Browse files
author
Richard Dodd
committed
Add more docs
1 parent 7c9fd8d commit bd58672

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

markup5ever/build.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,17 @@ fn named_entities_to_phf(from: &Path, to: &Path) {
9898
}
9999

100100
let mut file = File::create(to).unwrap();
101+
writeln!(&mut file, r#"
102+
/// A map of entity names to their codepoints. The second codepoint will
103+
/// be 0 if the entity contains a single codepoint. Entities have their preceeding '&' removed.
104+
///
105+
/// # Examples
106+
///
107+
/// ```
108+
/// use markup5ever::data::NAMED_ENTITIES;
109+
///
110+
/// assert_eq!(NAMED_ENTITIES.get("gt;").unwrap(), &(62, 0));
111+
"#).unwrap();
101112
write!(&mut file, "pub static NAMED_ENTITIES: Map<&'static str, (u32, u32)> = ").unwrap();
102113
phf_map.build(&mut file).unwrap();
103114
write!(&mut file, ";\n").unwrap();

0 commit comments

Comments
 (0)