diff --git a/README.md b/README.md index 06e22b4f9ad672eb4405435003726c1786fc6376..60ae8b257cfff31314ef10a35f99b49ecb550e9d 100644 --- a/README.md +++ b/README.md @@ -75,15 +75,37 @@ You can use a complete directory or a subdirectory as the path. ### Output of the tasks +Tasks are used to document open points in the document itself. + +For example, if a description is still missing or a picture needs to be added. + +A task can be defined by the notation `- [ ] task` or `- [] 2022-12-13 task with due date`. + +Completed tasks should at best be deleted from the document. +However, they can also be set as completed by writing `[x] 2022-12-13 done task`. + +example: + +```md +- [ ] task 1 +- [ ] tast 2 +- [x] 2022-12-13 task 3 with due date +``` + +The call is as follows: + ```bash reqman tasks print --path=examples/ ``` The output is then of the type: -| AUFGABE | BIS | ERLEDIGT | DATEI | -| -------------------------- | ----- | ---------- | -------------------- | -| das ist das erste todo 1 | — | — | ./req1/001-1425.md | +| AUFGABE | BIS | ERLEDIGT | DATEI | +|----------------------|------------|----------|---------| +| task 1 | — | — | file.md | +| tast 2 | — | — | file.md | +| task 3 with due date | 2022-12-13 | ✓ | file.md | + ### Output of the items diff --git a/application/source/changelog.go b/application/source/changelog.go index c944df9a2ae5ff4247e0af2d79162e1a1011fed1..b3b1aa61c583fd0671c865e405e3c8fa02207d0d 100644 --- a/application/source/changelog.go +++ b/application/source/changelog.go @@ -16,7 +16,17 @@ func buildChangelog(pageMap map[string]*requirement) (error, string, bool) { for _, q := range pageMap { p := *q - e := strings.Trim(p.Title+" ("+p.ID+")", " ") + id := p.ID + if id != "" { + id = " (" + strings.TrimSpace(id) + ")" + } + + title := strings.Trim(p.Title, " ") + if title == "" { + title = printer.Sprintf("Untitled") + } + + e := title + id d := p.Created.String() datemap[d] = p.Created.Format(config.Locale.DateFormat) diff --git a/application/source/config.go b/application/source/config.go index 84ef8bc49710418fff8cd1ed9e7b2b4e31549dd5..26fd3db624dc935ac833a1cd8abf9f3f8124793f 100644 --- a/application/source/config.go +++ b/application/source/config.go @@ -41,7 +41,7 @@ type Configuration struct { MarkdownContent string } } `yaml:"Template"` - } `yaml:"Overview"` + } `yaml:"Build"` Requirement struct { Table struct { diff --git a/application/source/defaults.go b/application/source/defaults.go index a54ff24e2ae423d78ba05e2c44fbdf8a86c6b52f..4ed8228086d17a8e41bc193e7e741c78deb1fd40 100644 --- a/application/source/defaults.go +++ b/application/source/defaults.go @@ -25,7 +25,7 @@ block-headings: true {{.Privacy}} {{ end}}{{ if .HasMeta }} -## Overview +## Build {{.Meta}} @@ -40,9 +40,9 @@ block-headings: true {{.Items}} {{ end}}{{ if .HasRequirements }} -## Requirements +## Document -{{.Requirements}} +{{.Document}} {{ end}} diff --git a/application/source/l10n.go b/application/source/l10n.go index b7ad9c2d1aa825f4904a3cee3ff30bb4848a01e2..fe5c3e8fefb273cd11f73980e62fe2bd5520a169 100644 --- a/application/source/l10n.go +++ b/application/source/l10n.go @@ -243,7 +243,7 @@ var l10nMap = []l10nKeyTranslation{ }, { "RequirementID", []l10nLocaleTranslation{ - {"de", "Requirements"}, + {"de", "Document"}, {"en", "Anforderungen"}, }, }, { @@ -420,13 +420,21 @@ var l10nMap = []l10nKeyTranslation{ {"de", "Zuweisungen"}, {"en", "Assignees"}, }, - }, { + }, + { "Statistics", []l10nLocaleTranslation{ {"de", "Statistiken"}, {"en", "Statistics"}, }, }, + { + "Untitled", + []l10nLocaleTranslation{ + {"de", "Unbenannt"}, + {"en", "Untitled"}, + }, + }, } func initL10n() { diff --git a/application/source/overview.go b/application/source/overview.go index 137a6428c3c27125fc5297fad0e5600fd730ca9f..47546feab5d3a904ec78b9a3d5a92f1d693015a1 100644 --- a/application/source/overview.go +++ b/application/source/overview.go @@ -278,23 +278,5 @@ func convertTemplateImages(content string, absolute string) string { } func validateColumns(columns []string) []string { - - //for i, column := range columns { - // columns[i] = printer.Sprintf(column) - //} - - // VALIDATE COLUMS NAME - - // - //for _, name := range config.Requirements.Columns { - // - // field := reflect.Indirect(r).FieldByName(name) - // if field == (reflect.Value{}) { - // printError("the specified column " + name + " for the table does not exist") - // continue - - // } - return columns - }