diff --git a/.idea/runConfigurations/go_build_requirements_manager_and_run_add_requirement.xml b/.idea/runConfigurations/go_build_requirements_manager_and_run_add_requirement.xml new file mode 100644 index 0000000000000000000000000000000000000000..8040ce9d3a61dfba151b89af68dc1ecdeedda8a9 --- /dev/null +++ b/.idea/runConfigurations/go_build_requirements_manager_and_run_add_requirement.xml @@ -0,0 +1,13 @@ +<component name="ProjectRunConfigurationManager"> + <configuration default="false" name="go build requirements-manager and run add requirement" type="GoApplicationRunConfiguration" factoryName="Go Application"> + <module name="requirements-manager" /> + <working_directory value="$PROJECT_DIR$/application/source" /> + <parameters value="requirements add --id 144444 -p $PROJECT_DIR$/development/examples/example1" /> + <kind value="DIRECTORY" /> + <package value="gitlab.schukai.com/oss/utilities/requirements-manager" /> + <directory value="$PROJECT_DIR$/application/source" /> + <filePath value="$PROJECT_DIR$/application/source/main.go" /> + <output_directory value="$PROJECT_DIR$/deployment/build" /> + <method v="2" /> + </configuration> +</component> \ No newline at end of file diff --git a/.idea/runConfigurations/go_build_requirements_manager_and_run_print_overview.xml b/.idea/runConfigurations/go_build_requirements_manager_and_run_print_overview.xml index 3f22cf19de72e3fcd8592c9265be7a505172c007..3510644b0fc735b58df4340e0e4d04abf049bb39 100644 --- a/.idea/runConfigurations/go_build_requirements_manager_and_run_print_overview.xml +++ b/.idea/runConfigurations/go_build_requirements_manager_and_run_print_overview.xml @@ -2,7 +2,7 @@ <configuration default="false" name="go build requirements-manager and run print overview" type="GoApplicationRunConfiguration" factoryName="Go Application"> <module name="requirements-manager" /> <working_directory value="$PROJECT_DIR$/application/source" /> - <parameters value="overview print -c ID -c Title -c Version -p $PROJECT_DIR$/development/examples/example1 -o /tmp/overview.pdf -f pdf -t $PROJECT_DIR$/development/examples/example1/overview.template" /> + <parameters value="overview print -c ID -c Title -c Version -p $PROJECT_DIR$/development/examples/example1 -o /tmp/overview.pdf -f pdf -t $PROJECT_DIR$/development/examples/overview.template" /> <kind value="DIRECTORY" /> <package value="gitlab.schukai.com/oss/utilities/requirements-manager" /> <directory value="$PROJECT_DIR$/application/source" /> diff --git a/application/source/commandline.go b/application/source/commandline.go new file mode 100644 index 0000000000000000000000000000000000000000..89b5c0cdb2b3a51fa483968f08d7aca8d4e547ff --- /dev/null +++ b/application/source/commandline.go @@ -0,0 +1,93 @@ +package main + +import "fmt" + +type commandLineOptions struct { + Path string `short:"p" long:"path" description:"define the path where the specifications are located" default:"."` + DateFormat string `short:"f" long:"date-format" description:"date format" default:"2006-01-02"` + Requirements struct { + Print struct { + Columns []string `short:"c" long:"column" description:"defines the columns used"` + } `command:"print"` + Add struct { + ID string `long:"id" required:"true" description:"new requirement id"` + } `command:"add"` + } `command:"requirements"` + Tasks struct { + Print struct { + } `command:"print"` + } `command:"tasks"` + Items struct { + Print struct { + } `command:"print"` + } `command:"items"` + Overview struct { + Print struct { + Columns []string `short:"c" long:"column" description:"defines the columns used"` + TemplatePath string `short:"t" long:"template" description:"file name of the template of the overview page"` + Output string `short:"o" long:"output" description:"redirect output to a file"` + Format string `short:"f" long:"format" description:"the desired output format (pdf, md)"` + } `command:"print"` + } `command:"overview"` + Version struct { + } `command:"version"` +} + +func executeCommand() { + + activeCommand, arguments, config := NewConfiguration() + + version = "development" + build = "1.1.1" + // + switch activeCommand.Name { + + case "version": + fmt.Println("Version " + version + " (" + build + ")") + case "overview": + subcommand := activeCommand.Active + switch subcommand.Name { + case "print": + err := PrintOverview(config, arguments) + if err != nil { + printErrorAndExit(2, err.Error()) + } + } + + case "requirements": + subcommand := activeCommand.Active + switch subcommand.Name { + case "add": + err := addRequirement(config, arguments) + if err != nil { + printErrorAndExit(2, err.Error()) + } + case "print": + err := printRequirements(config) + if err != nil { + printErrorAndExit(2, err.Error()) + } + } + + case "tasks": + subcommand := activeCommand.Active + switch subcommand.Name { + case "print": + err := printTaskTable(config) + if err != nil { + printErrorAndExit(2, err.Error()) + } + } + + case "items": + subcommand := activeCommand.Active + switch subcommand.Name { + case "print": + err := printItemTable(config) + if err != nil { + printErrorAndExit(2, err.Error()) + } + } + + } +} diff --git a/application/source/config.go b/application/source/config.go index 189e3ec52960caf2d1caa7938b90e66fe8258ce5..c37593a4b9fe3a4e618fc13a7c788f64e65ab06b 100644 --- a/application/source/config.go +++ b/application/source/config.go @@ -1,9 +1,13 @@ package main import ( + "log" "os" "os/user" "path" + "path/filepath" + "regexp" + "strings" "github.com/jessevdk/go-flags" "gopkg.in/yaml.v3" @@ -23,28 +27,6 @@ var ( } ) -const defaultTemplate = ` -## Overview - -Created: {{ .created }} - -{{.Meta}} - -## Tasks - -{{.Tasks}} - -## Items - -{{.Items}} - -## requirements - -{{.Requirements}} - - -` - // Exporting interface instead of struct //type Configuration interface{} @@ -63,6 +45,10 @@ type Configuration struct { Overview struct { Template string `yaml:"template"` } `yaml:"overview"` + + Requirement struct { + Template string `yaml:"template"` + } `yaml:"requirement"` } func fileExists(name string) (found bool) { @@ -72,34 +58,6 @@ func fileExists(name string) (found bool) { return false } -type commandLineOptions struct { - Path string `short:"p" long:"path" description:"define the path where the specifications are located" default:"."` - DateFormat string `short:"f" long:"date-format" description:"date format" default:"2006-01-02"` - Meta struct { - Print struct { - Columns []string `short:"c" long:"column" description:"defines the columns used"` - } `command:"print"` - } `command:"meta"` - ToDos struct { - Print struct { - } `command:"print"` - } `command:"todos"` - Items struct { - Print struct { - } `command:"print"` - } `command:"items"` - Overview struct { - Print struct { - Columns []string `short:"c" long:"column" description:"defines the columns used"` - TemplatePath string `short:"t" long:"template" description:"file name of the template of the overview page"` - Output string `short:"o" long:"output" description:"redirect output to a file"` - Format string `short:"f" long:"format" description:"the desired output format (pdf, md)"` - } `command:"print"` - } `command:"overview"` - Version struct { - } `command:"version"` -} - // NewConfiguration func NewConfiguration() (*flags.Command, *commandLineOptions, *Configuration) { @@ -161,22 +119,37 @@ func NewConfiguration() (*flags.Command, *commandLineOptions, *Configuration) { } if arguments.Overview.Print.TemplatePath != "" { - template, err := os.ReadFile(arguments.Overview.Print.TemplatePath) + p := arguments.Overview.Print.TemplatePath + + current, err := os.Getwd() + if err != nil { + log.Println(err) + } + + if !filepath.IsAbs(p) { + p = path.Clean(current + "/" + p) + } + + template, err := os.ReadFile(p) if err != nil { printErrorAndExit(exitCodeCatchAll, "the specified template", arguments.Overview.Print.TemplatePath) } - cfg.Overview.Template = string(template) + + cfg.Overview.Template = convertTemplateImages(string(template), path.Dir(p)) } else { - cfg.Overview.Template = defaultTemplate + cfg.Overview.Template = defaultOverviewTemplate } } - case "meta": + case "requirements": subcommand := activeCommand.Active switch subcommand.Name { + case "add": + cfg.Requirement.Template = defaultNewRequirementTemplate + case "print": - if len(arguments.Meta.Print.Columns) > 0 { - cfg.Table.Columns = validateColumns(arguments.Meta.Print.Columns) + if len(arguments.Requirements.Print.Columns) > 0 { + cfg.Table.Columns = validateColumns(arguments.Requirements.Print.Columns) } } } @@ -184,6 +157,71 @@ func NewConfiguration() (*flags.Command, *commandLineOptions, *Configuration) { return p.Command.Active, arguments, &cfg } +func convertTemplateLogo(content string, absolute string) string { + todoRegEx := regexp.MustCompile(`(?m)^(?P<match>logo:\s*"?(?P<path>[^"\n]*)"?\s*)$`) + + matches := todoRegEx.FindAllStringSubmatch(content, -1) + if matches == nil { + return content + } + + for _, match := range matches { + result := make(map[string]string) + for i, name := range todoRegEx.SubexpNames() { + if i != 0 && name != "" { + result[name] = match[i] + } + } + + if filepath.IsAbs(result["path"]) { + continue + } + + path := path.Clean(absolute + "/" + result["path"]) + content = strings.Replace(content, result["match"], "logo: \""+path+"\"", -1) + + } + + return content +} +func convertTemplateLatexLogo(content string, absolute string) string { + todoRegEx := regexp.MustCompile(`(?m)(?P<match>\\includegraphics[^{]*\{(?P<path>[^}]*)\})`) + + matches := todoRegEx.FindAllStringSubmatch(content, -1) + if matches == nil { + return content + } + + for _, match := range matches { + result := make(map[string]string) + for i, name := range todoRegEx.SubexpNames() { + if i != 0 && name != "" { + result[name] = match[i] + } + } + + if filepath.IsAbs(result["path"]) { + continue + } + + path := path.Clean(absolute + "/" + result["path"]) + a := strings.Replace(result["match"], result["path"], path, -1) + + content = strings.Replace(content, result["match"], a, -1) + + } + + return content +} + +func convertTemplateImages(content string, absolute string) string { + content = convertTemplateLogo(content, absolute) + content = convertTemplateLatexLogo(content, absolute) + + return content + +} + func validateColumns(columns []string) []string { //for i, column := range columns { @@ -193,7 +231,7 @@ func validateColumns(columns []string) []string { // VALIDATE COLUMS NAME // - //for _, name := range config.Meta.Columns { + //for _, name := range config.Requirements.Columns { // // field := reflect.Indirect(r).FieldByName(name) // if field == (reflect.Value{}) { diff --git a/application/source/const.go b/application/source/const.go deleted file mode 100644 index b9c15c9ca9a2cc281980ec7c6cdee79f457f1efb..0000000000000000000000000000000000000000 --- a/application/source/const.go +++ /dev/null @@ -1,9 +0,0 @@ -package main - -const exitOK = 0 - -// - Catchall for general errors -const exitCodeCatchAll = 1 - -// Invalid argument to exit -const exitCodeInvalidArgument = 128 diff --git a/application/source/defaults.go b/application/source/defaults.go new file mode 100644 index 0000000000000000000000000000000000000000..e88fb778d0009863cbe080c4487b65e69e4fafb2 --- /dev/null +++ b/application/source/defaults.go @@ -0,0 +1,63 @@ +package main + +const exitOK = 0 + +// - Catchall for general errors +const exitCodeCatchAll = 1 + +// Invalid argument to exit +const exitCodeInvalidArgument = 128 + +const defaultOverviewTemplate = ` + +--- +titlepage: false +... + +## Overview + +{{.Meta}} + +## Tasks + +{{.Tasks}} + +## Items + +{{.Items}} + +## Requirements + +{{.Requirements}} + +` + +// +const defaultNewRequirementTemplate = ` +--- +ID: {{ .ID }} +title: +subtitle: +tags: [] +percent: +Estimation: +items: + - + Group: + ID: + Name: + Description: + Delivery until: + Provided by: + Provided on: + Type: +... + +## Headline + +### Subheading + +- [ ] task 1 +- [ ] task 2 + +` diff --git a/application/source/files.go b/application/source/files.go index b114593585348cce6f60bf8c5d889f7db850f58f..073fe9bb9e9a39561b3085d3b2c0fdeaf3fd05b1 100644 --- a/application/source/files.go +++ b/application/source/files.go @@ -12,10 +12,13 @@ import ( ) // -func GetPageData(directory string) (error, []pageData) { +func GetPageData(directory string) (error, map[string]requirement) { cleanedDirectory := path.Clean(directory) - pageDataList := []pageData{} + + pageMap := make(map[string]requirement) + + //pageMap := []requirement{} err := filepath.Walk(cleanedDirectory, func(current string, info os.FileInfo, err error) error { @@ -25,48 +28,55 @@ func GetPageData(directory string) (error, []pageData) { cleanedPath := path.Clean(current) - if !info.IsDir() { + if info.IsDir() { + return nil + } - content, err := ioutil.ReadFile(cleanedPath) + ext := filepath.Ext(cleanedPath) + if ext != ".md" { + return nil + } - if err != nil { - return err - } + content, err := ioutil.ReadFile(cleanedPath) - err, p := importData(content) + if err != nil { + return err + } - if err != nil { - printError("does not contain a valid yaml definition", cleanedPath) - return nil - } + err, p := importData(content) - bd := []byte(cleanedDirectory) - bp := []byte(cleanedPath) - bs := string(bp[len(bd):len(bp)]) + if err != nil { + printError("does not contain a valid yaml definition", cleanedPath) + return nil + } - p.File = "." + bs - p.Absolute = cleanedPath - p.ToDos = findToDos(content) - //pageData[cleanedPath] = pageData + bd := []byte(cleanedDirectory) + bp := []byte(cleanedPath) + bs := string(bp[len(bd):len(bp)]) - pageDataList = append(pageDataList, p) + p.File = "." + bs + p.Absolute = cleanedPath + p.ToDos = findTask(content) + //requirement[cleanedPath] = requirement - } + k := cleanedPath + + pageMap[k] = p return nil }) - return err, pageDataList + return err, pageMap } -func importData(content []byte) (error, pageData) { +func importData(content []byte) (error, requirement) { - data := pageData{} + data := requirement{} s := string(content) a := strings.Index(s, "\n---") if a == -1 { - return errors.New("the file does not contain a definition block"), pageData{} + return errors.New("the file does not contain a definition block"), requirement{} } s = s[a+4 : len(s)-1] b := strings.Index(s, "\n...") @@ -82,7 +92,7 @@ func importData(content []byte) (error, pageData) { err := yaml.Unmarshal([]byte(s), &data) if err != nil { - return err, pageData{} + return err, requirement{} } return nil, data diff --git a/application/source/items.go b/application/source/items.go index 48ae39e5860ab9275ec08a0fb6f16254322b789c..7dd0ff6a4ac210068ddd3052c4b96be55b72125c 100644 --- a/application/source/items.go +++ b/application/source/items.go @@ -9,6 +9,9 @@ import ( ) type Item struct { + ID string `yaml:"ID"` + Name string `yaml:"Name"` + Type string `yaml:"Type"` Group string `yaml:"Group"` Description string `yaml:"Description"` DeliveryUntil time.Time `yaml:"Delivery until"` @@ -16,47 +19,115 @@ type Item struct { ProvidedBy string `yaml:"Provided by"` } -func buildItemTable(config *Configuration, pageDataList []pageData) (error, string) { +func buildItemOverviewTable(config *Configuration, pageMap map[string]requirement, extended bool) (error, string) { buf := new(bytes.Buffer) table := tablewriter.NewWriter(buf) - table.SetHeader([]string{ - printer.Sprintf("Group"), - printer.Sprintf("Description"), - printer.Sprintf("Delivery until"), - printer.Sprintf("Provided on"), - printer.Sprintf("Provided by"), - printer.Sprintf("File"), - }) + var header []string + + if extended { + header = []string{ + printer.Sprintf("ID"), + printer.Sprintf("Group"), + printer.Sprintf("Name"), + printer.Sprintf("Type"), + printer.Sprintf("Description"), + printer.Sprintf("Delivery until"), + printer.Sprintf("Checked"), + printer.Sprintf("Provided on"), + printer.Sprintf("Provided by"), + printer.Sprintf("File"), + } + } else { + header = []string{ + printer.Sprintf("ID"), + printer.Sprintf("Name"), + printer.Sprintf("Delivery until"), + printer.Sprintf("Checked"), + } + + } + + table.SetHeader(header) + table.SetBorders(tablewriter.Border{Left: true, Top: false, Right: true, Bottom: false}) table.SetCenterSeparator("|") var tableData [][]string - for _, pageData := range pageDataList { + for _, pageData := range pageMap { for _, info := range pageData.Items { - var db, do string + var deliveryUntilFormatted, providedOnDate, checked string if info.DeliveryUntil.IsZero() { - db = "—" + deliveryUntilFormatted = "—" } else { - db = info.DeliveryUntil.Format(config.Locale.DateFormat) + deliveryUntilFormatted = info.DeliveryUntil.Format(config.Locale.DateFormat) } + if info.ProvidedOn.IsZero() { - do = "—" + providedOnDate = "—" } else { - do = info.ProvidedOn.Format(config.Locale.DateFormat) + providedOnDate = info.ProvidedOn.Format(config.Locale.DateFormat) + } + + if info.DeliveryUntil.IsZero() { + deliveryUntilFormatted = "—" + } else { + deliveryUntilFormatted = info.DeliveryUntil.Format(config.Locale.DateFormat) + } + + if info.ProvidedOn.IsZero() { + checked = "—" + } else { + checked = "✓" + } + + id := "—" + if info.ID != "" { + id = info.ID } //text := info.Description + ", " //text += printer.Sprintf("Group") + ": " + info.Group + ", " - //text += printer.Sprintf("File") + ": " + pageData.File + //text += printer.Sprintf("File") + ": " + requirement.File + + var col []string + + /* + header = []string{ + printer.Sprintf("ID"), + printer.Sprintf("Name"), + printer.Sprintf("Delivery until"), + printer.Sprintf("Checked"), + } + } else { + header = []string{ + printer.Sprintf("ID"), + printer.Sprintf("Group"), + printer.Sprintf("Name"), + printer.Sprintf("Type"), + printer.Sprintf("Description"), + printer.Sprintf("RequirementID"), + printer.Sprintf("Delivery until"), + printer.Sprintf("Checked"), + printer.Sprintf("Provided on"), + printer.Sprintf("Provided by"), + } + + */ + + if extended { + col = []string{id, info.Group, info.Name, info.Type, info.Description, deliveryUntilFormatted, checked, providedOnDate, info.ProvidedBy, pageData.File} + } else { + col = []string{id, info.Name, deliveryUntilFormatted, deliveryUntilFormatted, checked} + } - tableData = append(tableData, []string{info.Group, info.Description, db, do, info.ProvidedBy, pageData.File}) - //tableData = append(tableData, []string{text, db, do, info.ProvidedBy}) + tableData = append(tableData, col) + //tableData = append(tableData, []string{text, deliveryUntilFormatted, checked, info.ProvidedBy}) } } @@ -69,12 +140,12 @@ func buildItemTable(config *Configuration, pageDataList []pageData) (error, stri } func printItemTable(config *Configuration) error { - err, pageData := GetPageData(config.Path) + err, pageMap := GetPageData(config.Path) if err != nil { return err } - err, table := buildItemTable(config, pageData) + err, table := buildItemOverviewTable(config, pageMap, true) fmt.Println(table) return nil diff --git a/application/source/l10n.go b/application/source/l10n.go index 23e642a6a796517d548a680ac6a969367391dd9f..7bdcc26586f761ab21033b4a542b12876576fab0 100644 --- a/application/source/l10n.go +++ b/application/source/l10n.go @@ -125,6 +125,18 @@ var l10nMap = []l10nKeyTranslation{ {"de", "Schlüsselwörter"}, {"en", "Keywords"}, }, + }, { + "Estimation", + []l10nLocaleTranslation{ + {"de", "Schätzung"}, + {"en", "Estimation"}, + }, + }, { + "Source", + []l10nLocaleTranslation{ + {"de", "Quelle"}, + {"en", "Source"}, + }, }, { "Author", @@ -208,6 +220,44 @@ var l10nMap = []l10nKeyTranslation{ {"de", "Es kann keine temporäre Datei angelegt werden (%s)."}, {"en", "A temporary file cannot be created (%s)."}, }, + }, { + "Checked", + []l10nLocaleTranslation{ + {"de", "Erledigt"}, + {"en", "done"}, + }, + }, + { + "Name", + []l10nLocaleTranslation{ + {"de", "Name"}, + {"en", "Name"}, + }, + }, + { + "Type", + []l10nLocaleTranslation{ + {"de", "Typ"}, + {"en", "Type"}, + }, + }, { + "RequirementID", + []l10nLocaleTranslation{ + {"de", "Requirements"}, + {"en", "Anforderungen"}, + }, + }, { + "the id must not be empty", + []l10nLocaleTranslation{ + {"de", "Die ID muss angegeben werden"}, + {"en", "the id must not be empty"}, + }, + }, { + "the request with id already exists", + []l10nLocaleTranslation{ + {"de", "Die Anforderung mit der ID %s existiert bereits (%s)."}, + {"en", "the request with id %s already exists (%s)."}, + }, }, } diff --git a/application/source/main.go b/application/source/main.go index 076308f824e8dc3a24998ad91904a24732912868..16d1ece5ecbea05e85c94bae34ce4a1866f02f2d 100644 --- a/application/source/main.go +++ b/application/source/main.go @@ -1,7 +1,6 @@ package main import ( - "fmt" "os" "golang.org/x/text/language" @@ -65,55 +64,6 @@ func initEnvironment() { */ func main() { - activeCommand, arguments, config := NewConfiguration() - - version = "development" - build = "1.1.1" - // - switch activeCommand.Name { - - case "version": - fmt.Println("Version " + version + " (" + build + ")") - case "overview": - subcommand := activeCommand.Active - switch subcommand.Name { - case "print": - err := PrintOverview(config, arguments) - if err != nil { - printErrorAndExit(2, err.Error()) - } - } - - case "meta": - subcommand := activeCommand.Active - switch subcommand.Name { - case "print": - err := printMeta(config) - if err != nil { - printErrorAndExit(2, err.Error()) - } - } - - case "todos": - subcommand := activeCommand.Active - switch subcommand.Name { - case "print": - err := printToDoTable(config) - if err != nil { - printErrorAndExit(2, err.Error()) - } - } - - case "items": - subcommand := activeCommand.Active - switch subcommand.Name { - case "print": - err := printItemTable(config) - if err != nil { - printErrorAndExit(2, err.Error()) - } - } - - } + executeCommand() } diff --git a/application/source/meta.go b/application/source/meta.go deleted file mode 100644 index 92b63e55d758454ee3e125f5506b482a74066f4e..0000000000000000000000000000000000000000 --- a/application/source/meta.go +++ /dev/null @@ -1,112 +0,0 @@ -package main - -import ( - "bytes" - "fmt" - "reflect" - "time" - - "github.com/olekukonko/tablewriter" -) - -func translateMetaHeaders(columns []string) []string { - - result := []string{} - - for _, column := range columns { - result = append(result, printer.Sprintf(column)) - } - - return result - -} - -func buildMeta(config *Configuration, pageDataList []pageData) (error, string) { - - buf := new(bytes.Buffer) - - table := tablewriter.NewWriter(buf) - - translateMetaColumns := translateMetaHeaders(config.Table.Columns) - - table.SetHeader(translateMetaColumns) - table.SetBorders(tablewriter.Border{Left: true, Top: false, Right: true, Bottom: false}) - table.SetCenterSeparator("|") - - var tableData [][]string - - for _, pd := range pageDataList { - - r := reflect.ValueOf(pd) - - var row []string - found := false - for _, name := range config.Table.Columns { - - field := reflect.Indirect(r).FieldByName(name) - if field == (reflect.Value{}) { - row = append(row, "") - continue - } - - t := field.Type() - - switch t.Name() { - case "string": - found = true - row = append(row, field.String()) - case "Time": - found = true - t := field.Interface().(time.Time) - if t.IsZero() { - row = append(row, "—") - } else { - row = append(row, field.Interface().(time.Time).Format(config.Locale.DateFormat)) - } - case "int": - found = true - row = append(row, field.String()) - case "float64": - found = true - row = append(row, field.String()) - case "nil": - row = append(row, field.String()) - case "bool": - found = true - expr := field.Bool() - if expr { - row = append(row, "true") - } else { - row = append(row, "false") - } - - default: - row = append(row, "") - } - - } - - if found { - tableData = append(tableData, row) - } - - } - - table.AppendBulk(tableData) // Add Bulk Data - table.SetHeaderAlignment(tablewriter.ALIGN_LEFT) - table.Render() - - return nil, buf.String() - -} - -func printMeta(config *Configuration) error { - err, pageData := GetPageData(config.Path) - if err != nil { - return err - } - - err, table := buildMeta(config, pageData) - fmt.Println(table) - return err -} diff --git a/application/source/overview.go b/application/source/overview.go index fb619e34eba26651e60bcf31e4453e80c299315a..a91be6437776fce29ec6b28318f66ba9e978cc7b 100644 --- a/application/source/overview.go +++ b/application/source/overview.go @@ -4,17 +4,22 @@ import ( "html/template" "io/ioutil" "os" + "path" + "path/filepath" + "regexp" + "sort" "strings" "time" ) type Dataset struct { - Config *Configuration - Meta string - Tasks string - Items string - Requirements string - Created time.Time + Config *Configuration + Meta string + Tasks string + Items string + Requirements string + Created time.Time + CreatedFormat string } func PrintOverview(config *Configuration, arguments *commandLineOptions) error { @@ -24,17 +29,17 @@ func PrintOverview(config *Configuration, arguments *commandLineOptions) error { return err } - err, meta := buildMeta(config, pageData) + err, meta := buildRequirements(config, pageData) if err != nil { return err } - err, tasks := buildToDosTable(config, pageData) + err, tasks := buildTasksTable(config, pageData, false) if err != nil { return err } - err, items := buildItemTable(config, pageData) + err, items := buildItemOverviewTable(config, pageData, false) if err != nil { return err } @@ -46,8 +51,16 @@ func PrintOverview(config *Configuration, arguments *commandLineOptions) error { requirements := "" - for _, p := range pageData { - requirements = requirements + getOverviewContent(p.Absolute) + keys := make([]string, 0, len(pageData)) + for k := range pageData { + keys = append(keys, k) + } + + sort.Strings(keys) + + for _, k := range keys { + p := pageData[k] + requirements = requirements + getAdjustedContent(p.Absolute) } d := new(Dataset) @@ -57,7 +70,8 @@ func PrintOverview(config *Configuration, arguments *commandLineOptions) error { d.Items = items d.Requirements = requirements d.Created = time.Now() - //d.pageData = pageData + d.CreatedFormat = time.Now().Format(config.Locale.DateFormat) + //d.requirement = requirement if arguments.Overview.Print.Output == "" { err = t.Execute(os.Stdout, d) @@ -107,7 +121,7 @@ func PrintOverview(config *Configuration, arguments *commandLineOptions) error { } -func getOverviewContent(absolute string) string { +func getAdjustedContent(absolute string) string { content, err := os.ReadFile(absolute) if err != nil { @@ -132,5 +146,36 @@ func getOverviewContent(absolute string) string { s = s[b+4 : len(s)-1] } + s = convertImages(s, path.Dir(absolute)) + return s } + +func convertImages(content string, absolute string) string { + + todoRegEx := regexp.MustCompile(`(?P<match>\!\[(?P<label>[^]]*)\]\((?P<path>[^)]*)\))`) + + matches := todoRegEx.FindAllStringSubmatch(content, -1) + if matches == nil { + return content + } + + for _, match := range matches { + result := make(map[string]string) + for i, name := range todoRegEx.SubexpNames() { + if i != 0 && name != "" { + result[name] = match[i] + } + } + + if filepath.IsAbs(result["path"]) { + continue + } + + path := path.Clean(absolute + "/" + result["path"]) + content = strings.Replace(content, result["match"], "!["+result["label"]+"]("+path+")", -1) + + } + + return content +} diff --git a/application/source/pagedata.go b/application/source/pagedata.go deleted file mode 100644 index 10b6248a43c70f041006eb9736a14ffc79d1584b..0000000000000000000000000000000000000000 --- a/application/source/pagedata.go +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import "time" - -type pageData struct { - ToDos []toDo - Absolute string - File string - - ID string `yaml:"ID"` - Type string `yaml:"Type"` // Display, Functional, Performance, Printing, Report, Testing and Validate - Title string `yaml:"Title"` - Alias []string `yaml:"Alias"` - Keywords []string `yaml:"Keywords"` - Author string `yaml:"Author"` - Status string `yaml:"Status"` - Complexity string `yaml:"Complexity"` - Difficulty string `yaml:"Difficulty"` // Low, Medium, High - Priority string `yaml:"Priority"` // Low, Medium, High - Version string `yaml:"Version"` - Milestone string `yaml:"Milestone"` - Created time.Time `yaml:"Created"` - LastUpdate time.Time `yaml:"Last Update"` - Items []Item `yaml:"items"` -} diff --git a/application/source/pandoc.go b/application/source/pandoc.go index ed7fcdc3958c2032bb3ea1864f63e920a6ba2f68..192f6e43a995fc06b61c8d71e8946325d40fa5fb 100644 --- a/application/source/pandoc.go +++ b/application/source/pandoc.go @@ -18,6 +18,7 @@ func convertToPDF(source string, output string) string { arguments += "--listings " arguments += "--template /home/volker.schukai/Downloads/eisvogel/eisvogel.latex " arguments += "--columns=5 " + arguments += "--highlight-style espresso " arguments += "--toc " arguments += "--output=" + output diff --git a/application/source/requirements.go b/application/source/requirements.go new file mode 100644 index 0000000000000000000000000000000000000000..2667ffd89005bd9fed585c25094447ae12c4e798 --- /dev/null +++ b/application/source/requirements.go @@ -0,0 +1,178 @@ +package main + +import ( + "bytes" + "fmt" + "html/template" + "os" + "path" + "reflect" + "time" + + "github.com/olekukonko/tablewriter" +) + +type requirement struct { + ToDos []task + Absolute string + File string + Items []Item `yaml:"items"` + + ID string `yaml:"ID"` + References []string `yaml:"References"` + Type string `yaml:"Type"` // Display, Functional, Performance, Printing, Report, Testing and Validate + Title string `yaml:"Title"` + Alias []string `yaml:"Alias"` + Keywords []string `yaml:"Keywords"` + Author string `yaml:"Author"` + Status string `yaml:"Status"` + Complexity string `yaml:"Complexity"` + Difficulty string `yaml:"Difficulty"` // Low, Medium, High + Priority string `yaml:"Priority"` // Low, Medium, High + Version string `yaml:"Version"` + Milestone string `yaml:"Milestone"` + Estimation int `yaml:"Estimation"` // 0, 1, 2, 3, 5, 8, 13, 20, 40, 100 + Source string `yaml:"Source"` + Created time.Time `yaml:"Created"` + LastUpdate time.Time `yaml:"Last Update"` +} + +type addRequirementDataset struct { + ID string +} + +func addRequirement(config *Configuration, arguments *commandLineOptions) error { + + if arguments.Requirements.Add.ID == "" { + printErrorAndExit(2, "the id must not be empty") + } + + p := path.Join(arguments.Path, arguments.Requirements.Add.ID+".md") + if fileExists(p) { + printErrorAndExit(2, "the request with id already exists", arguments.Requirements.Add.ID, p) + } + + t, err := template.New("requirement").Parse(config.Requirement.Template) + if err != nil { + return err + } + + d := new(addRequirementDataset) + d.ID = arguments.Requirements.Add.ID + + f, err := os.Create(p) + if err != nil { + return err + } + + defer f.Close() + + err = t.Execute(f, d) + if err != nil { + return err + } + + return nil +} + +func translateRequirementHeaders(columns []string) []string { + + result := []string{} + + for _, column := range columns { + result = append(result, printer.Sprintf(column)) + } + + return result + +} + +func buildRequirements(config *Configuration, pageMap map[string]requirement) (error, string) { + + buf := new(bytes.Buffer) + + table := tablewriter.NewWriter(buf) + + translateMetaColumns := translateRequirementHeaders(config.Table.Columns) + + table.SetHeader(translateMetaColumns) + table.SetBorders(tablewriter.Border{Left: true, Top: false, Right: true, Bottom: false}) + table.SetCenterSeparator("|") + + var tableData [][]string + + for _, pd := range pageMap { + + r := reflect.ValueOf(pd) + + var row []string + found := false + for _, name := range config.Table.Columns { + + field := reflect.Indirect(r).FieldByName(name) + if field == (reflect.Value{}) { + row = append(row, "") + continue + } + + t := field.Type() + + switch t.Name() { + case "string": + found = true + row = append(row, field.String()) + case "Time": + found = true + t := field.Interface().(time.Time) + if t.IsZero() { + row = append(row, "—") + } else { + row = append(row, field.Interface().(time.Time).Format(config.Locale.DateFormat)) + } + case "int": + found = true + row = append(row, field.String()) + case "float64": + found = true + row = append(row, field.String()) + case "nil": + row = append(row, field.String()) + case "bool": + found = true + expr := field.Bool() + if expr { + row = append(row, "true") + } else { + row = append(row, "false") + } + + default: + row = append(row, "") + } + + } + + if found { + tableData = append(tableData, row) + } + + } + + table.AppendBulk(tableData) // Add Bulk Data + table.SetHeaderAlignment(tablewriter.ALIGN_LEFT) + table.Render() + + return nil, buf.String() + +} + +func printRequirements(config *Configuration) error { + err, pageData := GetPageData(config.Path) + if err != nil { + return err + } + + err, table := buildRequirements(config, pageData) + fmt.Println(table) + return err +} diff --git a/application/source/todo.go b/application/source/tasks.go similarity index 54% rename from application/source/todo.go rename to application/source/tasks.go index 70e220a7c818b4353da15f86f8d5368a9be7fd98..09e662eb1537525550cd4707884a97c24893bfcb 100644 --- a/application/source/todo.go +++ b/application/source/tasks.go @@ -9,14 +9,15 @@ import ( "github.com/olekukonko/tablewriter" ) -type toDo struct { - due time.Time - text string +type task struct { + due time.Time + text string + checked bool } const dateLayout = "2006-01-02 15:04:05 GMT" -func newToDo(date string, text string) toDo { +func newTask(date string, text string, checked bool) task { var d time.Time var err error @@ -28,24 +29,25 @@ func newToDo(date string, text string) toDo { } } - t := toDo{ - due: d, - text: text, + t := task{ + due: d, + text: text, + checked: checked, } return t } -func findToDos(content []byte) []toDo { +func findTask(content []byte) []task { - toDos := []toDo{} + toDos := []task{} - todoRegEx := regexp.MustCompile(`@todo\s*(?P<due>[2][0-9]{3}-[0-9]{2}-[0-9]{2}\s*){0,1}(?P<text>[^\n]*)`) + todoRegEx := regexp.MustCompile(`(?m)^\- \[(?P<checked>(x|\s?))\]\s*(?P<due>[2][0-9]{3}-[0-9]{2}-[0-9]{2}){0,1}\s*(?P<text>[^\n]*)`) s := string(content) matches := todoRegEx.FindAllStringSubmatch(s, -1) if matches == nil { - return []toDo{} + return []task{} } for _, match := range matches { @@ -56,7 +58,13 @@ func findToDos(content []byte) []toDo { } } - t := newToDo(result["due"], result["text"]) + checked := true + + if result["checked"] != "x" { + checked = false + } + + t := newTask(result["due"], result["text"], checked) toDos = append(toDos, t) } @@ -64,22 +72,28 @@ func findToDos(content []byte) []toDo { return toDos } -func buildToDosTable(config *Configuration, pageDataList []pageData) (error, string) { +func buildTasksTable(config *Configuration, pageMap map[string]requirement, extended bool) (error, string) { buf := new(bytes.Buffer) table := tablewriter.NewWriter(buf) - table.SetHeader([]string{ + header := []string{ printer.Sprintf("ToDo"), printer.Sprintf("Due"), - printer.Sprintf("File")}) + printer.Sprintf("Checked")} + + if extended == true { + header = append(header, printer.Sprintf("File")) + } + + table.SetHeader(header) table.SetBorders(tablewriter.Border{Left: true, Top: false, Right: true, Bottom: false}) table.SetCenterSeparator("|") var tableData [][]string - for _, pageData := range pageDataList { + for _, pageData := range pageMap { for _, info := range pageData.ToDos { var d string @@ -90,7 +104,18 @@ func buildToDosTable(config *Configuration, pageDataList []pageData) (error, str d = info.due.Format(config.Locale.DateFormat) } - tableData = append(tableData, []string{info.text, d, pageData.File}) + checked := "—" + if info.checked == true { + checked = "✓" + } + + cols := []string{info.text, d, checked} + + if extended == true { + cols = append(cols, pageData.File) + } + + tableData = append(tableData, cols) } } @@ -102,13 +127,13 @@ func buildToDosTable(config *Configuration, pageDataList []pageData) (error, str return nil, buf.String() } -func printToDoTable(config *Configuration) error { +func printTaskTable(config *Configuration) error { err, pageData := GetPageData(config.Path) if err != nil { return err } - err, table := buildToDosTable(config, pageData) + err, table := buildTasksTable(config, pageData, true) fmt.Println(table) return nil diff --git a/development/examples/assets/schukai-weiss-1000-210.png b/development/examples/assets/schukai-weiss-1000-210.png new file mode 100644 index 0000000000000000000000000000000000000000..c6a76eaf936e00d416808e9318c2dec3a6bb8735 Binary files /dev/null and b/development/examples/assets/schukai-weiss-1000-210.png differ diff --git a/development/examples/example1/144444.md b/development/examples/example1/144444.md new file mode 100644 index 0000000000000000000000000000000000000000..82e9da34f420fa385c8ffc6f27f4afba5eafa84e --- /dev/null +++ b/development/examples/example1/144444.md @@ -0,0 +1,28 @@ + +--- +ID: 144444 +title: +subtitle: +tags: [] +percent: +Estimation: +items: + - + Group: + ID: + Name: + Description: + Delivery until: + Provided by: + Provided on: + Type: +... + +## + +### + + +- [ ] task 1 +- [ ] task 2 + diff --git a/development/examples/example1/assets/demo.png b/development/examples/example1/assets/demo.png new file mode 100644 index 0000000000000000000000000000000000000000..f3688147978fe724ca884efbfa263840f41b6f4f Binary files /dev/null and b/development/examples/example1/assets/demo.png differ diff --git a/development/examples/example1/overview.template b/development/examples/example1/overview.template deleted file mode 100644 index 74cc47694585773565dae453d15d91a5e5507580..0000000000000000000000000000000000000000 --- a/development/examples/example1/overview.template +++ /dev/null @@ -1,49 +0,0 @@ - ---- -Author: "Me" -title: "The Document Title" -author: [Example Author, Another Author] -date: "2017-02-20" -keywords: [Markdown, Example] -lang: de -titlepage: true -titlepage-color: "CE0000" -titlepage-text-color: "FFFFFF" -titlepage-rule-color: "FFFFFF" -titlepage-rule-height: 2 -logo: "/home/volker.schukai/projekte/local/marketing/logos/varianten/schukai-weiss-1000-210.png" -logo-width: "6cm" -toc-own-page: true -table-use-row-colors: true - -subtitle: document subtitle, included in HTML, EPUB, LaTeX, ConTeXt, and docx documents -abstract: document summary, included in LaTeX, ConTeXt, AsciiDoc, and docx documents -subject: document subject, included in ODT, PDF, docx, EPUB, and pptx metadata - -... - -## Overview - -Created: {{ .Created.Format "02.Jan.2006" }} - -{{.Meta}} - -## Tasks - -{{.Tasks}} - -## Items - -{{.Items}} - -## Requirements - -*** - -BBBBBB - -{{.Requirements}} - -AAAAAA -*** - diff --git a/development/examples/example1/req1/001-1425.md b/development/examples/example1/req1/001-1425.md new file mode 100644 index 0000000000000000000000000000000000000000..6d2e15ecc75778bb3aeb7a6be87f1f4970008c62 --- /dev/null +++ b/development/examples/example1/req1/001-1425.md @@ -0,0 +1,44 @@ + + + + +--- +Title: Value1 +Created: 2022-02-21 +Version: 1.0 +ID: 9999 +... + +## Anforderung 1425 + +das ist ein test + + + +Here is a footnote reference,[^1] and another.[^longnote] + +[^1]: Here is the footnote. + +[^longnote]: Here's one with multiple blocks. + + +This paragraph won't be part of the note, because it +isn't indented. + +- [ ] das ist das erste todo 1 +- [x] 2020-12-02 das ist das erste todo 2 + - [ ] 2020-12-03 das ist das erste todo 3 + - [x ] 2020-12-03 das ist das erste todo 3 + + +### Headline 1 + +HIER IST EIN BILD + + + +Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. + +### Headline 2 + +Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. diff --git a/development/examples/example1/req1/1425.md b/development/examples/example1/req1/002.md similarity index 78% rename from development/examples/example1/req1/1425.md rename to development/examples/example1/req1/002.md index 9293c45ce404198b16b2d0359f50c22a9cf5f55b..cc782b759dc5c9769b515803fd5d6c22266cafbb 100644 --- a/development/examples/example1/req1/1425.md +++ b/development/examples/example1/req1/002.md @@ -3,28 +3,28 @@ --- -Title: Value1 +Key1: Value122 +Title: My Name22 Created: 2022-02-21 -Version: Value1 -ID: 9999 -... - -## Anforderung 1425 +Version: 2.2.2 +ID: a1 +--- -das ist ein test +## Anforderung 1426-A1 -@todo das ist das erste todo 1 +Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. -@todo 2020-12-02 das ist das erste todo 2 -@todo 2020-12-03 das ist das erste todo 3 +- [ ] 2020-12-01 das ist das erste todo 1 +- [ ] 2020-12-02 das ist das erste todo 2 +- [ ] 2020-12-03 das ist das erste todo 3 sdfkjasdfk jasdkfjasd löfjasdklöfj asdkjfasdf jasdklf jasdfklöjasdfklöjasdklö -### Headline 1 +### Headline 1111 -Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. +lorem in hendrerit in vulputate velit esse moles -### Headline 2 +### Headline 2222 Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. diff --git a/development/examples/example1/req1/1426.md b/development/examples/example1/req1/002/002-01.md similarity index 91% rename from development/examples/example1/req1/1426.md rename to development/examples/example1/req1/002/002-01.md index a444c634b808d904ad9d541d39ff2b0c27fd7190..fc8957c8268068965b1f30b5b30d0fe516c4c261 100644 --- a/development/examples/example1/req1/1426.md +++ b/development/examples/example1/req1/002/002-01.md @@ -16,9 +16,9 @@ ID: 23423 Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. -@todo 2020-12-01 das ist das erste todo 1 -@todo 2020-12-02 das ist das erste todo 2 -@todo 2020-12-03 das ist das erste todo 3 sdfkjasdfk jasdkfjasd löfjasdklöfj asdkjfasdf jasdklf jasdfklöjasdfklöjasdklö +- [ ] 2020-12-01 das ist das erste todo 1 +- [ ] 2020-12-02 das ist das erste todo 2 +- [ ] 2020-12-03 das ist das erste todo 3 sdfkjasdfk jasdkfjasd löfjasdklöfj asdkjfasdf jasdklf jasdfklöjasdfklöjasdklö ### Headline 1111 diff --git a/development/examples/example1/req2/test1.md b/development/examples/example1/req999/999.md similarity index 94% rename from development/examples/example1/req2/test1.md rename to development/examples/example1/req999/999.md index c2c5a4de8f561dcdb87f2a6fb864d907c14b4bbd..49abd91b9cbca57df6594a16c3b4803c66efd2ab 100644 --- a/development/examples/example1/req2/test1.md +++ b/development/examples/example1/req999/999.md @@ -7,6 +7,7 @@ title: Test 1 subtitle: this is test 1 tags: [fruit, sweet, tasty] percent: 100 % +Estimation: 20 list: - entry 1 - entry 2 @@ -14,10 +15,14 @@ list: items: - Group: A1 + ID: Beistellung1 + Name: Beistellung eines Bildes Description: Großes Logo Delivery until: 2022-12-12 Provided by: Me Provided on: 2022-12-01 + Type: Bild + - Group: Logo (klein) diff --git a/development/examples/example2/overview.template b/development/examples/example2/overview.template deleted file mode 100644 index 13e081eeac7e0485f5e8beb67c6dfee3638850b6..0000000000000000000000000000000000000000 --- a/development/examples/example2/overview.template +++ /dev/null @@ -1,19 +0,0 @@ - - -Das ist mein TEMPLATE - -## Übersicht - -{{.Meta}} - -## Aufgaben - -{{.Tasks}} - -## Beistellungen - -{{.Items}} - -## Anforderungen - -{{.Requirements}} \ No newline at end of file diff --git a/development/examples/overview.template b/development/examples/overview.template new file mode 100644 index 0000000000000000000000000000000000000000..651360fcaa50410dd2db7b3bc09ea70549e21149 --- /dev/null +++ b/development/examples/overview.template @@ -0,0 +1,105 @@ + +--- +Author: "schukai GmbH" +title: "The Document Title" +author: [Example Author, Another Author] +date: {{ .CreatedFormat }} +keywords: [Markdown, Example] +lang: de + +titlepage: true +titlepage-color: "C10000" +titlepage-text-color: "FFFFFF" +titlepage-rule-color: "FFFFFF" +titlepage-rule-height: 2 + +footer-text: Vertraulich2 + +logo: "./assets/schukai-weiss-1000-210.png" +logo-width: "6cm" +toc-own-page: true +table-use-row-colors: true + +subtitle: document subtitle, included in HTML, EPUB, LaTeX, ConTeXt, and docx documents +abstract: document summary, included in LaTeX, ConTeXt, AsciiDoc, and docx documents +subject: document subject, included in ODT, PDF, docx, EPUB, and pptx metadata + +... + +## Preamble + +Mitwirkungsleistungen + +Der Kunde wird bei Auftragserteilung alle zur Durchführung der Beratungsleistungen erforderlichen Informationen an +schukai übermitteln. Auf Anforderung von schukai wird er unverzüglich schukai noch fehlende Informationen nachreichen. +Der Kunde wird, sofern die Leistungen nur mit Unterstützung Dritter erbracht werden können, die erforderliche Unterstützung veranlassen + +## Management Summary + + +## Overview + +{{.Meta}} + +## Tasks + +{{.Tasks}} + +## Items + +{{.Items}} + +## Requirements + +{{.Requirements}} + + +\newpage + +## + +Die Vervielfältigung dieses Dokuments oder Teilen davon, insbesondere die Verwendung von Texten, Grafiken +Logos oder Teilen bedarf der ausdrücklichen vorherigen Zustimmung der schukai GmbH. Eine unerlaubte +Vervielfältigung sowie die Weitergabe an Dritte ist nicht gestattet. + +Die alleinigen Rechte an diesem Dokument liegen ausschließlich bei der schukai GmbH. +Die in diesem Dokument enthaltenen Informationen und Rahmenbedingungen wurden nach aktuellem Stand +verfasst und entsprechen dem Standpunkt der schukai GmbH in Bezug auf die behandelten Themen zum +Zeitpunkt der Erstellung. + +Da die schukai GmbH auf sich ändernde Bedingungen reagieren muss, darf nur die letzte mit allen +Vertragsparteien abgestimmte Version als verbindlich angesehen werden. Sollten Sie Fragen zu diesem Dokument, +zu unseren Dienstleistungen oder Produkten haben, so wenden Sie sich bitte an Ihren Ansprechpartner. + + +\newpage + + +\definecolor{red}{HTML}{C10000} + +\thispagestyle{empty} +\pagecolor{red} + +\begin{textblock*}{17cm}(2cm,21cm) +\includegraphics[width=3cm]{./assets/schukai-weiss-1000-210.png} +\end{textblock*} + +\begin{textblock*}{17cm}(2cm,22cm) +\color{white} +schukai GmbH\newline +Eichenstraße 26\newline +82290 Landsberied\newline +Deutschland\newline +\newline ++49-8141-5098888\newline +www.schukai.de\newline +info@schukai.com +\end{textblock*} + +\begin{textblock*}{17cm}(2cm,28cm) +\color{white} +\begin{small} +© schukai GmbH.\newline +Alle Rechte vorbehalten. Alle genannten Warenzeichen sind Eigentum der jeweiligen Hersteller. +\end{small} +\end{textblock*}