vue-contrib/vuese

Multiline comments are trimmed too aggressively #85

ChristianKienle posted onGitHub

Description We are currently adopting vuese in our component library. So far it works pretty well – thank you for this wonderful project.

Some of our components are a bit more complex – for those components we have written guides using plain markdown (for example, our table component comes with such a guide) which explain step by step how this component works. In addition to those guide we also have API documentation generated by using @vuese/parser. Sometimes we also want to include short examples in the API documentation that show how to use the component. Just to avoid developers going back and forth between the guides and API documentation too much. The example below shows such an example:

<script>
// Use this component together wit `fd-table-fixed` and `fd-table` in order to create a table with a fixed column.
// Example:
// ```xml
// <fd-table-fixed-wrapper>
//   <fd-table-fixed>
//     <fd-table />
//   </fd-table-fixed>
// </fd-table-fixed-wrapper>
// ```
export default {
  name: "FdTableFixedWrapper"
};
</script>

Our own renderer uses the component description array produces by vuese/parser, joins it using \n and then feeds it into our markdown-component that also does syntax highlighting.

Unfortunately every line in the component description array is trimmed which means that the intention of our example code is gone making it hard to read.

<img width="982" alt="Screenshot 2019-07-05 at 15 34 54" src="https://user-images.githubusercontent.com/153225/60725888-76b4f100-9f3a-11e9-8294-36804fe8e59c.png">

To Reproduce Steps to reproduce the behavior:

  • copy the example above and
  • paste it into vuese explorer

Expected behavior I expect that multiline comments are not trimmed from both sides.

Screenshots See above

Which version do you use: latest as of this moment

Additional information I suggest either making the trimming lest aggressive (at least for multiline comments) or add the untrimmed comments as an additional property: "rawCommentDescription" or something like that. This way we could simply use that.


@issuehunt has funded $10.00 to this issue.


posted by issuehunt-app[bot] over 5 years ago

hey @ChristianKienle. How are you? Hope that well.

I just create a PR that solves the problem :)

posted by maykefreitas over 5 years ago

@maykefreitas super cool. :D Can't wait for it to get merged. ❤️

posted by ChristianKienle over 5 years ago

@ChristianKienle hope that it help you :)

posted by maykefreitas over 5 years ago

@ChristianKienle

 - @vuese/cli@2.6.0
 - @vuese/markdown-render@2.4.0
 - @vuese/parser@2.3.0
posted by HcySunYang over 5 years ago

@hcysunyang has rewarded $9.00 to @maykefreitas. See it on IssueHunt

  • :moneybag: Total deposit: $10.00
  • :tada: Repository reward(0%): $0.00
  • :wrench: Service fee(10%): $1.00
posted by issuehunt-app[bot] over 5 years ago

Fund this Issue

$10.00
Rewarded

Rewarded pull request

Recent activities

maykefreitas was rewarded by hcysunyang for vue-contrib/vuese# 85
over 5 years ago
maykefreitas submitted an output to  vue-contrib/ vuese# 85
over 5 years ago