Skip to content

Commit

Permalink
Linting and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisBrunner committed Nov 18, 2018
1 parent d852d99 commit 9a57952
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 6 deletions.
82 changes: 81 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,92 @@
# regenea [![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Go Report Card][report-image]][report-url] [![GoDoc][doc-image]][doc-url]
A program to manage your genealogy tree. It uses a JSON-based format called `genea`.
A program to manage your family tree. It uses a JSON-based format called `genea`.

# Install it

```
go get -u github.com/LouisBrunner/regenea
```

# Usage

Here is the list of supported actions:

## Check

This command checks that your family tree is correctly formatted, it will return a zero status code if it's valid and a non-zero otherwise.

Using a file:
```
regenea check tree.genea
```

Using stdin:
```
cat tree.genea | regenea check
```

## Report

This command prints a report of interesting facts and statistics that your family tree contains.

Using a file:
```
regenea report tree.genea
```

Using stdin:
```
cat tree.genea | regenea report
```

## Report

This command prints a report of interesting facts and statistics that your family tree contains.

Using a file:
```
regenea report tree.genea
```

Using stdin:
```
cat tree.genea | regenea report
```

## Transform

This command transforms a family tree from one format to another. Currently only `genea` is supported (V1 and V2).

Using files:
```
regenea transform -in treeV1.genea -inform genea -out treeV2.genea -outform genea
```

Using stdin/stdout:
```
cat treeV1.genea | regenea report -inform genea -outform genea > treeV2.genea
```

*Note:* you can use this command to upgrade/downgrade between `genea` versions.

Upgrade:
```
regenea transform -in treeV1.genea -inform genea -out treeV2.genea -outform genea
```

Downgrade (will result in loss of data):
```
regenea transform -in treeV2.genea -inform genea -out treeV1.genea -outform genea -outversion 1
```

## Display

Coming soon

# `genea` format

Coming soon

[travis-image]: https://travis-ci.org/LouisBrunner/regenea.svg?branch=master
[travis-url]: https://travis-ci.org/LouisBrunner/regenea
[coveralls-image]: https://coveralls.io/repos/github/LouisBrunner/regenea/badge.svg?branch=master
Expand Down
6 changes: 3 additions & 3 deletions genea/json/v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ type PersonV2 struct {
}

type Names struct {
First string `json:"first,omitempty"`
Middle string `json:"middle,omitempty"`
Last string `json:"last,omitempty"`
First string `json:"first,omitempty"`
Middle string `json:"middle,omitempty"`
Last string `json:"last,omitempty"`
Alternative string `json:"alternative,omitempty"`
}

Expand Down
2 changes: 1 addition & 1 deletion genea/parser_validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func (tree *Tree) validate() error {
}
return tree.IterateOverUnionErr(func(union *Union) error {
if !compareEvents(&union.Begin, union.End) {
return fmt.Errorf("relation between `%s` and '%s': start cannot be after end", union.Person1, union.Person2)
return fmt.Errorf("relation between `%v` and `%v`: start cannot be after end", union.Person1, union.Person2)
}
return nil
})
Expand Down
2 changes: 1 addition & 1 deletion report/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func Process(tree *genea.Tree, out io.Writer, marshaller func(v interface{}) ([]
}

processors2 := make([]core.Processor, len(processors), len(processors))
for i, _ := range processors {
for i := range processors {
processors2[i] = core.Processor(processors[i])
}

Expand Down

0 comments on commit 9a57952

Please sign in to comment.