Skip to content

Enable --template and --stdin to be used together? #36

@msabramo

Description

@msabramo

Currently --template and --stdin are mutually exclusive.

In other words, you can use --template:

$ node cli.js --template 'How about some {red.bold chocolate} & {blue.bold peanut butter}?'
How about some chocolate & peanut butter?

and you can use data from stdin:

$ echo 'How about some chocolate & peanut butter?' | node cli.js --stdin yellow
How about some chocolate & peanut butter?

but you can't use --template with data from stdin:

$ echo 'How about some {red.bold chocolate} & {blue.bold peanut butter}?' | node cli.js --template --stdin
Input required

I think it would be cool if this were possible. The last example with echo is a little silly because it can so easily be changed to the first command, but imagine if the "chalk markup" string were a lot longer and it were in a file, say chocolate-and-peanut-butter.chalk.txt and then you could do:

$ node cli.js --stdin < chocolate-and-peanut-butter.chalk.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions