Skip to content

Keep indent when line doesn't have comment prefix  #30

@SWW13

Description

@SWW13

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.

impl Struct {
    /**
    @Article Struct
    ## function
    
    Example:
    ```rust
    fn main() {
        // call function
        function();
    }
    ```
    */
    fn function() { }
}

Would result in:

## function

Example:
```rust
fn main() {
    // call function
    function();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions