Skip to content

Commit 2aaa0bd

Browse files
committed
update readme: installation with deno, new way of doing directives
1 parent 3322355 commit 2aaa0bd

File tree

1 file changed

+66
-42
lines changed

1 file changed

+66
-42
lines changed

README.md

Lines changed: 66 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -20,104 +20,128 @@ It can be used to easily integrate Jevko formats into applications that deal wit
2020

2121
<!-- In the future, JevkoML could also be used directly by various tools, for increased efficiency. -->
2222

23-
## Usage
23+
## Installation
2424

25-
If Jevko CLI is [installed](#installation-with-deno) you can invoke it as:
25+
These instructions will guide you through installing Deno and then using it to install `jevko` as a command in your system, so that you can invoke it from anywhere.
26+
27+
### Install Deno
28+
29+
Jevko CLI has one dependency: [Deno](https://deno.land/).
30+
31+
Fortunately Deno is very nice and [easy to install](https://deno.land/[email protected]/getting_started/installation). Deno is distributed as a single binary executable with no external dependencies.
32+
33+
This command will run Deno's official installation script on Linux or macOS:
2634

2735
```
28-
jevko
36+
curl -fsSL https://deno.land/x/install/install.sh | sh
2937
```
3038

31-
Without arguments, `jevko` will accept input from standard input until you press CTRL+D.
39+
This one will do the same on Windows, if PowerShell is available:
3240

33-
<!-- todo?: mvp console highlighting? -->
41+
```
42+
irm https://deno.land/install.ps1 | iex
43+
```
3444

35-
You can also provide a path to a file as an argument:
45+
For more installation options or if you run into any problems, see the official instructions on [deno.land](https://deno.land/[email protected]/getting_started/installation) and on [denoland GitHub](https://github.com/denoland/deno_install).
3646

37-
<!-- get syntax highlighting for vscode -->
47+
### Install Jevko CLI with Deno
48+
49+
If you have [Deno installed](#install-deno) and Deno's installation root's bin directory (something like `/home/USER/.deno/bin`) [added to `PATH`](#tip-get-a-list-of-directories-in-your-path) then you can use the following command to install `jevko` directly from GitHub master branch:
3850

3951
```
40-
jevko filename.jevkoml
52+
deno install --allow-read --allow-write --allow-run https://raw.githubusercontent.com/jevko/jevko-cli/master/jevko.js
4153
```
4254

43-
This will convert a file named `filename.jevkoml` into HTML/XML and output the result to standard output.
55+
Note: if you haven't added Deno's installation root to `PATH`, then `jevko` won't be recognized as a command.
4456

45-
To output to a file instead of the standard output, you can either use the redirect facility of your shell:
57+
To install a specific version of the Jevko CLI, specify it in the URL in place of master:
4658

4759
```
48-
jevko filename.jevkoml > outputfile.html
60+
deno install --allow-read --allow-write --allow-run https://raw.githubusercontent.com/jevko/jevko-cli/v0.1.0/jevko.js
4961
```
5062

51-
Or you can put an `/output` directive with the output file name at the top of the input file:
63+
See the [Jevko CLI GitHub Releases](https://github.com/jevko/jevko-cli/releases) for a list of available versions.
64+
65+
### Alternative: install without editing PATH
66+
67+
If you can't or prefer not to change your `PATH`, you can alternatively install `jevko` to a [directory that is already in the `PATH`](#tip-get-a-list-of-directories-in-your-path), by adding the `--root` option to `deno install`. E.g. if your `PATH` contains `~/.local/bin`, then you can run:
5268

5369
```
54-
/output [outputfile.html]
70+
deno install --root ~/.local/ --allow-read --allow-write --allow-run https://raw.githubusercontent.com/jevko/jevko-cli/master/jevko.js
5571
```
5672

57-
now if you run:
73+
to install `jevko` under `~/.local/bin`.
74+
75+
### Tip: get a list of directories in your PATH
76+
77+
You can get a list of directories in your `PATH` by running:
5878

5979
```
60-
jevko filename.jevkoml
80+
echo $PATH
6181
```
6282

63-
it will output to `outputfile.html` instead of standard output.
64-
65-
By default, Jevko CLI infers the Jevko format of the input file by extension. You can also specify the format by putting the `/jevko` directive at the top of the input file:
83+
This should print something like:
6684

6785
```
68-
/jevko [jevkoml]
86+
/home/USER/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin
6987
```
7088

71-
## Dependencies
89+
## Usage
7290

73-
Jevko CLI has one dependency: [Deno](https://deno.land/).
91+
If Jevko CLI is [installed](#installation-with-deno) you can invoke it as:
7492

75-
Fortunately Deno is very nice and [easy to install](https://deno.land/[email protected]/getting_started/installation).
93+
```
94+
jevko
95+
```
7696

77-
<!-- I recommend installing it, as it makes installing and managing `jevko` easy and efficient. -->
97+
Without arguments, `jevko` will accept input from standard input until you press CTRL+D.
7898

79-
## Installation with Deno
99+
<!-- todo?: mvp console highlighting? -->
80100

81-
These instructions will guide you through using Deno to install `jevko` as a command in your system, so that you can invoke it from anywhere.
101+
You can also provide a path to a file as an argument:
82102

83-
If you have [Deno installed](#dependencies) and Deno's installation root's bin directory (something like `/home/USER/.deno/bin`) [added to `PATH`](#tip-get-a-list-of-directories-in-your-path) then you can use the following command to install `jevko` directly from GitHub master branch:
103+
<!-- get syntax highlighting for vscode -->
84104

85105
```
86-
deno install --allow-read --allow-write --allow-run https://raw.githubusercontent.com/jevko/jevko-cli/master/jevko.js
106+
jevko filename.jevkoml
87107
```
88108

89-
Note: if you haven't added Deno's installation root to `PATH`, then `jevko` won't be recognized as a command.
109+
This will convert a file named `filename.jevkoml` into HTML/XML and output the result to standard output.
90110

91-
To install a specific version of jevko-cli, specify it in the URL in place of master:
111+
To output to a file instead of the standard output, you can either use the redirect facility of your shell:
92112

93113
```
94-
deno install --allow-read --allow-write --allow-run https://raw.githubusercontent.com/jevko/jevko-cli/v0.1.0/jevko.js
114+
jevko filename.jevkoml > outputfile.html
95115
```
96116

97-
### Alternative: install without editing PATH
117+
Or you can put an `output` directive with the output file name at the top of the input file:
98118

99-
If you can't or prefer not to change your `PATH`, you can alternatively install `jevko` to a [directory that is already in the `PATH`](#tip-get-a-list-of-directories-in-your-path), by adding the `--root` option to `deno install`. E.g. if your `PATH` contains `~/.local/bin`, then you can run:
119+
<!-- todo: describe the new way of doing directives -- probly change name of directives to sth else -->
100120

101121
```
102-
deno install --root ~/.local/ --allow-read --allow-write --allow-run https://raw.githubusercontent.com/jevko/jevko-cli/master/jevko.js
122+
[
123+
output [outputfile.html]
124+
]
103125
```
104126

105-
to install `jevko` under `~/.local/bin`.
106-
107-
## Tip: get a list of directories in your PATH
108-
109-
You can get a list of directories in your `PATH` by running:
127+
now if you run:
110128

111129
```
112-
echo $PATH
130+
jevko filename.jevkoml
113131
```
114132

115-
This should print something like:
133+
it will output to `outputfile.html` instead of standard output.
134+
135+
By default, Jevko CLI infers the Jevko format of the input file by extension. You can also specify the format by putting the `format` directive at the top of the input file:
116136

117137
```
118-
/home/USER/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin
138+
[
139+
format [jevkoml]
140+
]
119141
```
120142

121-
# Features coming soon
122143

144+
## Features coming soon
145+
146+
<!-- todo: this should be a separate lib (perhaps local to this repo) -->
123147
* import files as jevkos or text (currently implemented in jevkoml)

0 commit comments

Comments
 (0)