Copy doc comments from Rust to JS (#265)

* backend comments complete

* better matching

* gen comments

* Add example

* Move test bindings gen to own fn

* move build step into build fn

* add fn to read js, refactor gen_bindings/test to allow for this

* Add comments test

* Update readmes

* add comments to travis

* fix broken tests

* +x on build.sh

* fix wbg cmd in build.sh

* Address fitzgen's comments
This commit is contained in:
Robert Masen
2018-06-15 11:20:56 -05:00
committed by Nick Fitzgerald
parent 3ad9bac599
commit 19d6cf1488
16 changed files with 555 additions and 59 deletions

View File

@ -64,12 +64,14 @@ pub struct Export {
pub method: bool,
pub constructor: Option<String>,
pub function: Function,
pub comments: Vec<String>,
}
#[derive(Deserialize, Serialize)]
pub struct Enum {
pub name: String,
pub variants: Vec<EnumVariant>,
pub comments: Vec<String>,
}
#[derive(Deserialize, Serialize)]
@ -87,12 +89,14 @@ pub struct Function {
pub struct Struct {
pub name: String,
pub fields: Vec<StructField>,
pub comments: Vec<String>,
}
#[derive(Deserialize, Serialize)]
pub struct StructField {
pub name: String,
pub readonly: bool,
pub comments: Vec<String>,
}
pub fn new_function(struct_name: &str) -> String {