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

Allow multiple examples in template header #3

Closed
daroczig opened this issue Jan 2, 2012 · 6 comments
Closed

Allow multiple examples in template header #3

daroczig opened this issue Jan 2, 2012 · 6 comments
Assignees
Milestone

Comments

@daroczig
Copy link
Member

daroczig commented Jan 2, 2012

Letting template writers to specify multiple examples in a template (e.g. with different input settings for the same dataset) would be a cool feature.

It would allow users to check different settings of a template with ease.

Some parts of the code to be changed:

  • regexp checks in header
  • tpl.example (I would do that one)
  • gh-pages & generator-script (I would do that one)

Suggestion for format: comma separated list of rapport commands (in one line). You could easily write a regexp for that :)

Example: rapport('correlations', data=ius2009, vars=c('age', 'it.edu', 'it.leisure')), rapport('correlations', data=ius2009, vars=c('age', 'it.edu', 'it.leisure'), cor.plot=FALSE)

@aL3xa
Copy link
Contributor

aL3xa commented Jan 2, 2012

IMO, CSV is not an appropriate one for multiple examples, as it's not easily readable. Maybe it should be separated with newline (writing a regex for that would be easy too). Anyway, in that case, I'll take the tpl.example, and you can take the generator-scripts and stuff.

@ghost ghost assigned aL3xa Jan 2, 2012
@daroczig
Copy link
Member Author

daroczig commented Jan 2, 2012

Deal, thanks Alex!
Just ping me when you are ready with that regexp job, and will deal with the rest.

@aL3xa aL3xa closed this as completed Jan 3, 2012
@daroczig
Copy link
Member Author

daroczig commented Jan 3, 2012

Cool, thanks @aL3xa !
I've edited that function a bit to be able to run multiple examples at once in aL3xa/rapport@c266b4d

@daroczig daroczig reopened this Jan 7, 2012
@daroczig
Copy link
Member Author

daroczig commented Jan 7, 2012

Thank you @aL3xa for tweaking and improving tpl.example!

Two small issues I run into while writing docs:

  • tpl.example uses stdin for grabbing user input on multiple examples. It seems that it's killing Eclipse/STATET :( Which is not a big deal, but now I think a more traditional read.lines solution might be better. Please think about it, and if you agree, I could also modify the current code.
  • tpl.header and tpl.info only return the first example of a template. That would be cool if all could be found there. That would be great in the near future as I would not rewrite the docs again :)

@aL3xa
Copy link
Contributor

aL3xa commented Jan 8, 2012

OK @daroczig, thanks for spotting this one. This was a really simple bug, as required data was there, and the problem was related to print methods. If you run tpl.info you will not see those ugly NULL values any more, as invisible is added to print method.

@aL3xa aL3xa closed this as completed Jan 8, 2012
@daroczig
Copy link
Member Author

daroczig commented Jan 8, 2012

Cool, thanks!

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