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

Renderer command line interface #94

Closed
Siemienik opened this issue May 25, 2020 · 1 comment
Closed

Renderer command line interface #94

Siemienik opened this issue May 25, 2020 · 1 comment

Comments

@Siemienik
Copy link
Owner

Introduction

Solving this issue should allow using xlsx-renderer from the command line.

Example:

image

proposed usages:

# Basic
sxr template.xlsx '{"jsonData":true"}' > output.xlsx
sxr -o output.xlsx  template.xlsx '{"jsonData":true"}'
cat vm.json | sxr template.xlsx > output.xlsx

# More advanced
sxr --model vm.json template.xlsx > output.xlsx
sxr --type json --model vm.json template.xlsx > output.xlsx
sxr --type xml --model vm.xml template.xlsx > output.xlsx
sxr --type xml template.xlsx '<someData></someData>'  > output.xlsx 
sxr --type xml --model vm.xml -o output.xlsx template.xlsx 


# Example how it will work with Xlsx-import-cli (sxi)
sxi -d books-def.json input.xlsx | sxr template.xlsx > beauty-books.xlsx

command body:

sxr [options] <template> [model]

Arguments

  • <template> indicate which file is used as the template
  • [model] view model as a json used to generate a spreadsheet,

Options

  • -o --output <filename> write to filename
  • -m --model <filename> read filename as a [model] (using both is denied)
  • -o --output <filename> write result into filename
  • Proposal: -t --type <type: json|xml> specify parser for a model, default it is a JSON.
@Siemienik Siemienik changed the title [Proposal] Command line interface Command line interface Jun 14, 2020
Siemienik referenced this issue in Siemienik/xlsx-renderer-cli Aug 16, 2020
ISSUE: https://github.com/Siemienik/xlsx-renderer/issues/25

todo:
* readme
* tests coverage
* further proposal: xml support
Siemienik referenced this issue in Siemienik/xlsx-renderer-cli Aug 29, 2020
Update: package.json define sections: bin, types, files
Update: Add documentation
Remove: tests because commanderjs is not test-friendly :( let's investigate it further
ISSUE: https://github.com/Siemienik/xlsx-renderer/issues/25

todo:
* further proposal: xml support
@Siemienik Siemienik transferred this issue from Siemienik/xlsx-renderer Nov 19, 2020
@Siemienik Siemienik changed the title Command line interface Renderer command line interface Nov 19, 2020
@Siemienik
Copy link
Owner Author

done in #97

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

1 participant