jbt / docker

Documentation generator
http://jbt.github.com/docker
MIT License
233 stars 56 forks source link

SASS/SCSS Support? #60

Closed jasonseney closed 10 years ago

jasonseney commented 10 years ago

Is there a reason that the multiline support for SASS/SCSS is commented out?

On this line, there are only inline comment options. I've changed this to use the same commenting format as Javascript, and added JSDoc without any noticeable issues. The JSDoc processing is useful for mixins.

I've only tested this for SCSS.

Suggested Update:

  scss: {
    extensions: [ 'scss' ],
    comment: '//', multiLine: [ /\/\*\*?/, /\*\// ], jsDoc: true
  },
jbt commented 10 years ago

IIRC this was because SASS has its quirk of using /* to open single-line comments as well as multi-line comments and at the time I didn't have the time to figure out how to make it behave properly, so this was the safe bet without breaking stuff really badly in the case that there were any /* single-line ocmments

jasonseney commented 10 years ago

Ahh I see, I've never used single line /*... */ syntax in SCSS so wouldn't have noticed if it was broken.

I'll try to take a look into this more and loop back.

jasonseney commented 10 years ago

SASS does allow /* on one line, however they don't really encourage it specifically. SASS Comment Reference.

The only thing I see special, is that they strip out the // syntax and retain comments with /* syntax when building the resulting CSS file.

I updated with the following and tested without any issues:

scss: {
    extensions: [ 'scss' ],
    comment: '//', multiLine: [ /\/\*\*?/, /\*\// ], jsDoc: true
},

and tested with the following SCSS code:

/* # Test file
 * This is a test `SCSS` file
 */
body {
    color: black; // This works
}

// Multi line comment,  
// in single line format.  
// SASS will _strip_ this.
p {
    font-size: 14px;
}

/* Single line of **multiline** syntax */
blockquote {
    text-decoration: italic;
}

The generated documentation skips over single line /* syntax, which I think is alright. This also matches the behavior of the same syntax in the PHP docker documentation.

jasonseney commented 10 years ago

Resolved by merging in referenced pull request.