You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if fundoc could also keep indent when no comment prefix is used. I prefer using comment blocks without prefix as for me they are cleaner to read and write.
This could be implemented by trimming the lines by the indent of the first comment line. (In the example below this would be 4 spaces prepending @Article Struct).
I'm not sure if there are edge cases I haven't thought of, it could also be optional with a setting.
implStruct{/** @Article Struct ## function Example: ```rust fn main() { // call function function(); } ``` */fnfunction(){}}
Would result in:
## function
Example:
```rustfnmain() {
// call functionfunction();
}
The text was updated successfully, but these errors were encountered:
My workaround is to add the comment prefix * only to to the code blocks to keep the indent. As for the text blocks, I'm totally with you removing those prefixes for readability.
Indentation is quite tricky using this doc generator, same with @CodeBlockStart and @CodeBlockEnd which come with the same issue (stripping all whitespace and messing up indentation)
update: tried to update the parser.rs for this purpose (at least to keep the indentation for @CodeBlockStart and @CodeBlockEnd). Man, this is some wild state machine. It kinda worked, but I destroyed my file structure in the process.
It would be nice if fundoc could also keep indent when no comment prefix is used. I prefer using comment blocks without prefix as for me they are cleaner to read and write.
This could be implemented by trimming the lines by the indent of the first comment line. (In the example below this would be 4 spaces prepending
@Article Struct
).I'm not sure if there are edge cases I haven't thought of, it could also be optional with a setting.
Would result in:
The text was updated successfully, but these errors were encountered: