aboutsummaryrefslogtreecommitdiff
path: root/doc/store.md
blob: 5cb1cb683b93fcfde370de2d5b911e2d84eff119 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Store

The store file is supposed to be the only file used by mark. It is
used to store the actual data as well as all available and future options.

## Language

The store file is separated in different blocks. 
It is always terminated by "#end#".

### Block

+ A Block starts with its name in hashes.
+ Followed by the content of the block.
+ The end of the Block is reached if a new # is found.

Known Blocks are:

+ #store# : block to store the actual data
+ #colors# : block to assign colors to mark signs

Example:
```
#block#
foo
bar
#otherblock# | #end#
```

### Block content

The notation of a blocks content is block specific.

#### store content

The store block contains the actual mark data.
It stores mark bundles representing one year.

A mark bundle starts with the year its representing followed by a colon and a line break.
This is followed by 12 lines starting with their number [1-12], a colon and
(28-31) characters representing the (marked) days.
Every other character then '?' is interpreted as a mark. 

#### colors content

Every line of the color block is one pair of sign and color separated
only by a colon.

Example:
```
m:red
s:yellow
```

## Location

The path to the store file is stored in the environment variable `$__mark_store`.


## Example:

This is a store generated by the `__mark_new_store` function.


```
#colors#
#store#
2016:
1:???????????????????????????????
2:?????????????????????????????
3:???????????????????????????????
4:??????????????????????????????
5:???????????????????????????????
6:??????????????????????????????
7:???????????????????????????????
8:???????????????????????????????
9:??????????????????????????????
10:???????????????????????????????
11:??????????????????????????????
12:???????????????????????????????
#end#
```