From 71344ee9121c02d48e021713eada1d583f80892f Mon Sep 17 00:00:00 2001 From: Volker Schukai <volker.schukai@schukai.com> Date: Fri, 1 Jul 2022 10:09:13 +0200 Subject: [PATCH] chore: commit save point --- README.md | 28 +++++++++++++++++++++++++--- application/source/changelog.go | 12 +++++++++++- application/source/config.go | 2 +- application/source/defaults.go | 6 +++--- application/source/l10n.go | 12 ++++++++++-- application/source/overview.go | 18 ------------------ 6 files changed, 50 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 06e22b4..60ae8b2 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 c944df9..b3b1aa6 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 84ef8bc..26fd3db 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 a54ff24..4ed8228 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 b7ad9c2..fe5c3e8 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 137a642..47546fe 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 - } -- GitLab