-
Notifications
You must be signed in to change notification settings - Fork 37
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
Custom fields support #57
Comments
I guess its possible to configure with custom parsers as well? |
@operatino Do you just want to add a new field, called "custom" in your example? – This is doable by adding a parser like:
|
@operatino Custom parsers are your friend here. Here's an example (basically the same as @ahx's): Example Custom CSS/Comment: // ...
// @custom Some custom info
// ... Example Custom JavaScript/Parsers: // Parser for @custom
dss.parser( 'custom', function( i, line, block ) {
return line;
}); Example Custom HTML/Template (using grunt-dss): {{#files}}
{{#blocks}}
<h1>{{custom}}</h1>
{{/blocks}}
{{/files}} |
Why you don't want to add custom fields automatically, without defining a custom parser? JSON could be just auto populated with custom fields, following default parsing strategy. |
Ahhh, sorry @operatino, I didn't realize what you meant before. We can definitely make a very simple change that would allow any custom variable to be parsed properly/fallback and then if you want to do something special on top of that default then you could define a custom parser. I like this and it makes a lot of sense. I'll reopen. |
Could you please add custom fields support in parser?
This fields will allow to integrate some custom features on top, like template include support. We would really love this feature for our SourceJS integration.
The text was updated successfully, but these errors were encountered: