Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added sizes and alignments to WASI docs #268

Merged
merged 5 commits into from
May 2, 2020

Conversation

torch2424
Copy link
Contributor

closes #266

This adds documentation for all the sizes, alignments, and offset of data types, structs, and unions for .witx documents. 馃槃 馃憤

cc @pchickey for the review 馃槃

Screenshot

*I was using a local md to html converter to view the doc, which is why it looks a little funny 馃槃 *

Screenshot from 2020-04-30 17-37-08

Copy link
Contributor

@kubkon kubkon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @torch2424! Looks good! One thing only. Do you think we could get rid of the HTML links for union layout bullets?

let sizes_heading = heading_from_node(&node, 1);
node.new_child(MdSection::new(sizes_heading, "Union Layout"));
let union_layout = &self.union_layout();
node.new_child(MdNamedType::new(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you used a generic MdSection instead of an MdNamedType, then it won鈥檛 be HTML tagged by default.

@torch2424
Copy link
Contributor Author

@kubkon Thank you very much for the review! 馃槃 馃憤

I went ahead and made your requested changes. This should be good to go 馃槃

Screenshot from 2020-05-01 11-50-37

Copy link
Contributor

@kubkon kubkon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks @torch2424!

Since this PR affects only the witx tooling, I'm gonna go ahead and merge this. cc @sunfishcode

@kubkon
Copy link
Contributor

kubkon commented May 1, 2020

On second thought, I'll wait and see what @sunfishcode thinks since it does affect the docs, so I'm not sure whether it requires chairs approval or not ;-)

Copy link
Member

@sunfishcode sunfishcode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me too! I just have a few minor whitespace suggestions :-).

@@ -26,7 +27,13 @@ impl ToMarkdown for Document {
heading.new_level_down(),
name,
name,
&d.docs,
format!(
"{}Size: {}\n Alignment: {}",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this space before the "Alignment:" intended? It seems to make the spacing inconsistent with "Size:" and "Offset:".

@@ -184,7 +193,7 @@ impl ToMarkdown for StructDatatype {
MdHeading::new_bullet(),
id.as_str(),
name,
&member.docs,
format!("{}Offset: {}", &member.docs, &offset).as_str(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to add a newline after the offset here? Before this change, it looks like there's a blank line at that point, which creates a nice visual separation of different documentation items.

@@ -26,7 +27,13 @@ impl ToMarkdown for Document {
heading.new_level_down(),
name,
name,
&d.docs,
format!(
"{}Size: {}\n Alignment: {}",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, similar to the "Offset:", should there be a trailing newline here?

@torch2424
Copy link
Contributor Author

@sunfishcode @kubkon Thanks for the review / approval! 馃槃

@sunfishcode Nice catch on the whitespace stuff! My hack-y markdown to html thing made the Whitespace look a lot different than what Github was rendering. Fixing these now 馃槃

@torch2424
Copy link
Contributor Author

@sunfishcode @kubkon

Found a whitespace I think that looks good in Github. Let me know what you think 馃槃

Screenshot from 2020-05-01 15-59-53

Copy link
Contributor

@kubkon kubkon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good, thanks!

@kubkon kubkon merged commit 7e56336 into WebAssembly:master May 2, 2020
@torch2424 torch2424 deleted the layout-docs.md branch May 4, 2020 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Struct sizes of event and subscription
3 participants