Skip to content

Commit 3ba23c1

Browse files
committed
modified: README.md
1 parent 9f7c79b commit 3ba23c1

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@
2121
- [Redis list -> Zsh array](#redis-list---zsh-array)
2222
- [Redis string key -> Zsh string](#redis-string-key---zsh-string)
2323
- [Installation](#installation)
24-
- [Zinit](#zinit)
25-
- [Antigen](#antigen)
26-
- [Oh-My-Zsh](#oh-my-zsh)
27-
- [Zgen](#zgen)
24+
- [Zinit](#zinit)
25+
- [Antigen](#antigen)
26+
- [Oh-My-Zsh](#oh-my-zsh)
27+
- [Zgen](#zgen)
2828
- [Zredis Zstyles](#zredis-zstyles)
2929

3030
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
3131

32-
# Introduction
32+
## Introduction
3333

3434
Zsh binary module written in C interfacing with `redis` database via `Zshell`
3535
`variables` mapped to `keys` or the whole `database`.
@@ -62,7 +62,7 @@ key1 key2
6262
2) "key2"
6363
```
6464

65-
## Rationale
65+
### Rationale
6666

6767
Building commands for `redis-cli` quickly becomes inadequate. For example, if copying
6868
of one hash to another one is needed, what `redis-cli` invocations are needed? With
@@ -103,7 +103,7 @@ Output: $reply array, to hold elements of the sorted set
103103
a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
104104
```
105105

106-
## Deleting From Database
106+
### Deleting From Database
107107

108108
Unsetting the first type of mapped variable (Zsh hash -> whole database) doesn't cause a deletion from
109109
database. If option `-D` is given to `ztie` when binding to concrete key in database, then unsets, also
@@ -114,15 +114,15 @@ More: in Redis, removing all elements from a set, list, etc. means the same as d
114114
all datatypes except string, by doing `variable=()`. For string you can unset key in whole-database mapped
115115
hash: `unset 'wholedb[key]'`.
116116

117-
## Compiling modules
117+
### Compiling modules
118118

119119
The Zsh modules provided by the plugin will build automatically (`hiredis` library is needed). You can
120120
start more than 1 shell, only the first one will be compiling. If a developer commits a new timestamp to
121121
`module/RECOMPILE_REQUEST`, the module will recompile (don't worry, at startup, `mtime` is checked
122122
first, so check for recompilation is fast). I do this when I add tested features or fixes. You can
123123
recompile the modules yourself by invoking Zsh function `zredis_compile`.
124124

125-
## Cache
125+
### Cache
126126

127127
By default, reads are cached. If a tied variable is read for the first time,
128128
then database is accessed. For the second read there's no database access.
@@ -137,7 +137,7 @@ ztclear my_hashset_var key # Also for types: whole-db mapping, zset
137137

138138
To disable the cache, pass `-z` ("zero-cache") option to ztie.
139139

140-
## News
140+
### News
141141

142142
- 2018-12-19
143143
- The builtin `zrpush` can have the param-name argument skipped – if it's called for the second
@@ -159,9 +159,9 @@ To disable the cache, pass `-z` ("zero-cache") option to ztie.
159159
- New option to `ztie`: `-D`, which causes mapped database key to be deleted on `unset` of the tied
160160
variable. Up to this moment this behavior was the default.
161161

162-
## Mapping Of Redis Types To Zsh Data Structures
162+
### Mapping Of Redis Types To Zsh Data Structures
163163

164-
### Database string keys -> Zsh hash
164+
#### Database string keys -> Zsh hash
165165

166166
Redis can store strings at given keys, using `SET` command. `Zredis` maps those to hash array
167167
(like Zsh `gdbm` module):
@@ -176,7 +176,7 @@ redis
176176
key1 value1 key2 value2
177177
```
178178

179-
### Redis hash -> Zsh hash
179+
#### Redis hash -> Zsh hash
180180

181181
By appending `/NAME` to the `host-spec` (`-f` option), one can select single
182182
key of type `HASH` and map it to `Zsh` hash:
@@ -195,7 +195,7 @@ value2
195195
key1 value1
196196
```
197197

198-
### Redis set -> Zsh array
198+
#### Redis set -> Zsh array
199199

200200
Can clear single elements by assigning `()` to array element. Can overwrite
201201
whole set by assigning via `=( ... )` to set, and delete set from database
@@ -219,7 +219,7 @@ value2 value3 value1
219219
(empty list or set)
220220
```
221221

222-
### Redis sorted set -> Zsh hash
222+
#### Redis sorted set -> Zsh hash
223223

224224
This variant maps `zset` as hash - keys are set elements, values are ranks.
225225
`zrzset` call outputs elements sorted according to the rank:
@@ -236,7 +236,7 @@ a 1
236236
b a
237237
```
238238

239-
### Redis list -> Zsh array
239+
#### Redis list -> Zsh array
240240

241241
There is no analogue of `zrzset` call because `Zsh` array already has correct order:
242242

@@ -256,7 +256,7 @@ value1 value2 value3
256256
3) "3"
257257
```
258258

259-
### Redis string key -> Zsh string
259+
#### Redis string key -> Zsh string
260260

261261
Single keys in main Redis storage are bound to `Zsh` string variables:
262262

@@ -278,7 +278,7 @@ value2
278278
"value2"
279279
```
280280

281-
# Installation
281+
## Installation
282282

283283
**The plugin is "standalone"**, which means that only sourcing it is needed. So to
284284
install, unpack `zredis` somewhere and add
@@ -315,7 +315,7 @@ cloning the plugin for you automatically the next time you start zsh.
315315
Add `zgen load z-shell/zredis` to your .zshrc file in the same place you're doing
316316
your other `zgen load` calls in.
317317

318-
# Zredis Zstyles
318+
## Zredis Zstyles
319319

320320
The values being set are the defaults. Change the values before loading `zredis` plugin.
321321

0 commit comments

Comments
 (0)