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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added feature synth-doc #99

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Conversation

OLUWAMUYIWA
Copy link
Contributor

In response to #31 , I'm submitting this Pull request.
I chose not to use another dependency as the crates currently available are not easily adaptable to my use case.
I included a new command in the cli.
Please check, @llogiq
Thank you!!

@llogiq llogiq self-requested a review August 9, 2021 10:05
@llogiq
Copy link
Contributor

llogiq commented Aug 9, 2021

On a cursory glance, this looks good. I'll have to test run it, and we'll need to rebase before merging though. I'll let you know when I've done the test run.

@OLUWAMUYIWA
Copy link
Contributor Author

Just let me know what I need to do after you test run it. If changes need to be made, I'll make them and rebase on master.
Thank you.

Copy link
Contributor

@llogiq llogiq left a comment

Choose a reason for hiding this comment

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

So I tested this and looked at the output. It's not perfect yet, but a very decent start. The biggest change I'd like to see would be tables for the fields. I'd also like to see less header depths. Otherwise it's just a few nitpicks.

}

fn write_colls(ns: &Namespace, file: &mut BufWriter<File>) -> Result<()> {
writeln!(file, "```text\n### Description\n\n\n\n\n```")?;
Copy link
Contributor

Choose a reason for hiding this comment

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

This "```text" makes the whole thing a code block. I don't think that's right here. Also below the Description header there should be a (please enter a descriptive text here) or some such.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. I'll fix this. Thanks.

};
Ok(())
}
fn write_coll_details((name, content ): (&Name,&Content), file: &mut BufWriter<File>) -> Result<()>{
Copy link
Contributor

Choose a reason for hiding this comment

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

We usually have spaces after commas. Perhaps cargo fmt the whole thing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure!

write_foreigns((&name, &object_content), file)?;
}
Content::Object(obj) => {
writeln!(file, "##### Fields")?;
Copy link
Contributor

Choose a reason for hiding this comment

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

5-level subheadings are clearly too far. We should remove one or two levels overall.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I understand. I should probably keep it at three

Comment on lines 84 to 87
writeln!(file, "##### {} [Type: *Null*]", name)?;
writeln!(file, "> Description goes here: ")?;
writeln!(file, "")?;
writeln!(file, "")?;
Copy link
Contributor

Choose a reason for hiding this comment

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

There's no need to have multiple writeln! calls here:

Suggested change
writeln!(file, "##### {} [Type: *Null*]", name)?;
writeln!(file, "> Description goes here: ")?;
writeln!(file, "")?;
writeln!(file, "")?;
writeln!(file, "##### {} [Type: *Null*]\n> Description goes here: \n\n", name)?;

Copy link
Contributor Author

@OLUWAMUYIWA OLUWAMUYIWA Aug 14, 2021

Choose a reason for hiding this comment

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

Oh.. No need? I'll do that

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll write it all once as a single formatted string

Comment on lines 90 to 93
writeln!(file, "##### {} [Type: *{}*]", name, content.kind())?;
writeln!(file, "> Description goes here: ")?;
writeln!(file, "")?;
writeln!(file, "")?;
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here

Comment on lines 96 to 98
writeln!(file, "##### {} [Type: *{}*]", name, content.kind())?;
writeln!(file, "> Description goes here: ")?;
writeln!(file, "**Variants:**")?;
Copy link
Contributor

Choose a reason for hiding this comment

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

And here.

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.

4 participants