pseudomuto / protoc-gen-doc

Documentation generator plugin for Google Protocol Buffers
MIT License
2.61k stars 462 forks source link

Documentation generate with CR LF #403

Open lazorenkoigor96 opened 4 years ago

lazorenkoigor96 commented 4 years ago

I want write multi-line description, like this:

/*
Configurable:
no
---
Value range:
true or false
---
Sending rules:
Does not send if "false", and send in every packet if "true".
---
Description:
Set to "true" when the accelerometer in the device has some problems (poorly soldered or broken).
*/
optional  bool  accelerometer_is_fault = 1;

After documentation generating I have this: image

Can I create documentation with CRLF?

0v3rst33r commented 4 years ago

@lazorenkoigor96 have you had any luck with this?

0v3rst33r commented 4 years ago

@lazorenkoigor96 for HTML output I discovered this workaround:

Put a stylesheet.css file alongside your generated HTML file, with the contents:

p {
    white-space: pre;
}

This will render the following comment:

    /**
     * Line 1
     * Line 2
     * Line 3
     *
     * Line 5
     * etc.
     */
    bool someProperty = 30;

as:

Screen Shot 2019-11-01 at 08 53 10

Using your code example, you get:

Screen Shot 2019-11-01 at 08 59 03
huydangquoc commented 4 years ago

confirmed work for me. many thanks @0v3rst33r !