Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to include comments in json output #24

Open
tomgenoni opened this issue Dec 6, 2017 · 3 comments
Open

Option to include comments in json output #24

tomgenoni opened this issue Dec 6, 2017 · 3 comments

Comments

@tomgenoni
Copy link

tomgenoni commented Dec 6, 2017

One use case is for documentation. For example, at the top of each CSS file I might include a title and a description. The JSON could then be used to output that meta information along with the actual CSS.

@cwdoh
Copy link
Owner

cwdoh commented Dec 17, 2017

Thanks for the request! I agree to your opinion.

I also wanted supporting comments, however, I was troubled because there is something difficult to solve. As we know, comments blocks can be located at anywhere in CSS. So, sometimes it's difficult to put comments informations into JSON:

/* field decorator */
.my-field {
    padding-left: 1em; /* left padding */
    /* background color */
    background-color: /* don't fix this */ #fff /* white */
}

I know this is ugly example. but, it's possible. :/
If you have any idea to handle these cases, please let me know. :)
Thanks! :)

@tomgenoni
Copy link
Author

Do you you mean it would be difficult to construct JSON from the example above or that its difficult to parse?

In any case what I wanted to do was use the comments for documentation, where the source would look like:

/*
# My Thing

This component does x, y, and z.
*/

.my-thing {
  padding-left: 1em;
}

Here only the comments at the root level would be captured, though I could see that may be too specific a use case for this script.

@cwdoh
Copy link
Owner

cwdoh commented Dec 18, 2017

Okay. I'll include this feature in the next release. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants