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

add a preprocessor config that can modify the raw data payload from the parser before it goes to the doc generator #212

Closed
caridy opened this issue Feb 3, 2014 · 4 comments

Comments

@caridy
Copy link
Member

caridy commented Feb 3, 2014

This feature will allow anyone to control the data passed into the generator of the parser, and since the user controls the template, she/he will have full control over new flags and entries.

@caridy
Copy link
Member Author

caridy commented Feb 3, 2014

related to #210 and #211

@caridy
Copy link
Member Author

caridy commented Feb 3, 2014

we just need a volunteer for this one :)

@limikael
Copy link
Contributor

Ok I will give it a go as I also need this...

What do you think about this spec:

in options there would be an option like this:

options: {
preprocessor: 'my_processor'
}

The config option is called preprocessor (singular), and can be a single string because in most cases it would be probably be used that way. It can however also be an array of strings, in which case it would be considered to be a chain of preprocessors to be applied in the same order as they are defined. The preprocessors would refer to files that would be loaded with require, hence they would be node modules. The modules should export a single function. This function should accept a single parameter, which would be the data to be processed. The function is expected to modify the data as it see fit. The return value from the function is not important.

That's the first draft... Questions that arose when I wrote that:

  • Should the preprocessors be able to declare extra tags? The main program would then query the preprocessor for the extra tags, and not issue warnings for them. This would require the spec to be modified so that the module is an object containing a process function and a tags property.
  • Should the preprocessors be able to accept parameters from the config file?

@caridy
Copy link
Member Author

caridy commented Apr 22, 2014

the first installment of the preprocessors is in 0.3.50, try it, test it, feedback and lets iterate on it.

@caridy caridy closed this as completed Apr 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@caridy @limikael and others