Open denysdovhan opened 8 years ago
I love Babel api with 'in', 'out' params and with 'preset' feature
Cheers, Vladimir Starkov, iamstarkov.com
@iamstarkov I can add them, in addition to textr [in] [out]
.
btw can we just use Babel as framework now when it is general build tool?
Cheers, Vladimir Starkov, iamstarkov.com
What do you mean when you say "use Babel as framework"?
Here is a --cycle option, that creates new tf instance on every cycle. Do we realy need that option?
I've used the -c
option just to benchmark textr. I think, now it's redundant. Feel free to kill it :D
What do you mean when you say "use Babel as framework"?
@iamstarkov Is it really useful for us? Are you suggest to make textr
plugin for babel? Or did you meant smth else?
@shuvalov-anton okay, I'll remove -c
.
I mean Babel is general build system from now on, so maybe we can use Babel with textr presets
Cheers, Vladimir Starkov, iamstarkov.com
Are you suggest to make textr plugin for babel?
I don't think that's a good idea. For example, typography-ellipses will break spread operator. Or are you talking about presets for text files.
I didn't intend to use it for js projects but if it's possible to use Babel cli infrastructure then it will be cool
Cheers, Vladimir Starkov, iamstarkov.com
@iamstarkov I still don't understand what you want. Can you explain with example?
yep, but only tomorrow
Cheers, Vladimir Starkov, iamstarkov.com
I got. But IMHO babel things isn't very useful for small CLI project. I want to take a look on it, but I guess it's about the other.
I'll also take a look tomorrow and hope It will work out
Cheers, Vladimir Starkov, iamstarkov.com
i take a look at babel plugins examples and it seems like the only purpose is javascript files
so yeah babel is not for us
but I definitely like its API with --out-file | -o
, --out-dir | -d
,--watch | -w
and piping files $ babel --out-file script-compiled.js < script.js
I think we can learn from them
$ textr -t typographic-single-spaces,typographic-quotes
is it possible to make it without coma? like this:
$ textr -t typographic-single-spaces typographic-quotes
I definitely like its API with
--out-file | -o
,--out-dir | -d
,--watch | -w
About -o
: I thought use second arg as output file, like this:
$ textr input.md output.md
So, if we use -o
, we should remove ability to output into second arg.
About -d
: It could be useful for few files. I'll try to implement this (but it conflicts with --diff
and -d
flags)
About -w
: Looks cool. Added to draft.
is it possible to make it without coma?
It can be cofused with arguments. For example:
$ cat input | textr -t typographic-single-spaces typographic-quotes output.md
Above, output.md
could be resolved as transformer.
But, we can use it, like this:
$ cat input | textr -t typographic-single-spaces -t typographic-quotes output.md
it's just a wish
Cheers, Vladimir Starkov, iamstarkov.com
is it possible to make it without coma?
It's confusing. -1
But, we can use it, like this:
$ cat input | textr -t typographic-single-spaces -t typographic-quotes output.md
+1
okay ⚡️
Cheers, Vladimir Starkov, iamstarkov.com
On 03 Nov 2015, at 9:31 AM, Shuvalov Anton notifications@github.com wrote:
is it possible to make it without coma? It's confusing. -1
But, we can use it, like this:
$ cat input | textr -t typographic-single-spaces -t typographic-quotes output.md +1
— Reply to this email directly or view it on GitHub.
What are you thinking about -o|--out-file
? Should I implement it, ot better to leave output file as second argument?:
$ textr input.md output.md
or
$ textr input.md -o output.md
P.S: If there isn't second argument, then result will be witten into stdout.
I would love explicit output param with default stdout
i prefer -o
okay, I'm gonna implement -o
param
btw, thank you for taking initiative over cli :clap:
I've finished first implementation with tests. Take a look here: https://github.com/denysdovhan/textr-cli/tree/dev
--diff
, --watch
and -o
aren't implemented yet, but I'm in progress.
Also, we've forgot about --locale
flag.
btw, @shuvalov-anton locale was bothering me and i think it shouldnt be 'en' by default and if not defined then textr plugins should not do anything impicitly. what do you think?
btw, thank you for taking initiative over cli :clap:
@iamstarkov that's bcoz i'm gonna use textr, but I need cli. It's profitable to me, at first ;)
I've finished --locale|-l
and --out-file|-o
. Now, I'm gonna to release 0.1.0
.
Take a look #2.
How about adding --config|-c
options for loading configuration from json file, like a .eslintrc
or .babelrc
? Because it's a little bit difficult to write in teminal:
textr some-article.md -t typographic-quotes,typographic-single-spaces,typographic-ellipses,typographic-em-dashes -o output.md -w
LGTM :D
But what's better loading textrrc, or give opportunity to chose any of json files? I think second case would be better.
I think, good case is specify .textrrc
in your dotfiles. This file should be connected automatically. But you should be able to redefine it w/ -c
option. Vim works same.
Yep, I've understood. It will be better.
Discussion about base options
@iamstarkov and @shuvalov-anton, please leave your suggestions bellow. If you don't mind, let's move the discussion about CLI here.
Transformers [Done #2]
Few
-t
or--transforms
options:-t
or--transforms
as list of transformers:-t
or--transforms
throught equal sign:Input [Done #2]
Read from
stdin
:Read from file:
Output [Done #2]
Write into
stdout
:Write into file using
--out-file
or-o
flags:Locale [Done #2]
Set local using
-l
and--locale
:Watch [Done #3]
--watch
and-w
:Diff
Output diff instead of result:
Config
.textrrc
with config. This file should be connected automatically. But user should be able to redefine it with-c
option (should works like a.vimrc
, '.babelrc`, etc)..textrrc
example:Ref to https://github.com/shuvalov-anton/textr/issues/1