added feature synth-doc#99
Conversation
|
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. |
|
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. |
llogiq
left a comment
There was a problem hiding this comment.
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```")?; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Yes. I'll fix this. Thanks.
| }; | ||
| Ok(()) | ||
| } | ||
| fn write_coll_details((name, content ): (&Name,&Content), file: &mut BufWriter<File>) -> Result<()>{ |
There was a problem hiding this comment.
We usually have spaces after commas. Perhaps cargo fmt the whole thing?
| write_foreigns((&name, &object_content), file)?; | ||
| } | ||
| Content::Object(obj) => { | ||
| writeln!(file, "##### Fields")?; |
There was a problem hiding this comment.
5-level subheadings are clearly too far. We should remove one or two levels overall.
There was a problem hiding this comment.
I understand. I should probably keep it at three
| writeln!(file, "##### {} [Type: *Null*]", name)?; | ||
| writeln!(file, "> Description goes here: ")?; | ||
| writeln!(file, "")?; | ||
| writeln!(file, "")?; |
There was a problem hiding this comment.
There's no need to have multiple writeln! calls here:
| 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)?; |
There was a problem hiding this comment.
Oh.. No need? I'll do that
There was a problem hiding this comment.
I'll write it all once as a single formatted string
| writeln!(file, "##### {} [Type: *{}*]", name, content.kind())?; | ||
| writeln!(file, "> Description goes here: ")?; | ||
| writeln!(file, "")?; | ||
| writeln!(file, "")?; |
| writeln!(file, "##### {} [Type: *{}*]", name, content.kind())?; | ||
| writeln!(file, "> Description goes here: ")?; | ||
| writeln!(file, "**Variants:**")?; |
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!!