diff --git a/Makefile b/Makefile index e7f99b6843048ff097c6dfd0670ac23e9dae1e1d..563b687468900f68f71b7aeae5c37d6aa48286f8 100644 --- a/Makefile +++ b/Makefile @@ -62,21 +62,17 @@ include $(MAKEFILE_IMPORT_PATH)terminal-check.mk ############################################################################################# ############################################################################################# -%.md5: % - @md5sum $< | cmp -s $@ -; if test $$? -ne 0; then md5sum $< > $@; fi - +GOFILES := $(shell find $(SOURCE_PATH) -name '*.go' ! -name 'catalog.go') LOCALEFILES := $(shell find $(SOURCE_PATH)translations/locales/ -name '*.json') CATALOGFILES := $(SOURCE_PATH)translations/locales/catalog.go -$(CATALOGFILES): $(LOCALEFILES) - echo $(LOCALEFILES) - $(QUITE) $(ECHO) "Generating catalog files..." - $(QUITE) $(GO) generate $(SOURCE_PATH)translations/translations.go +$(CATALOGFILES): $(LOCALEFILES) $(GOFILES) + $(QUIET) $(GO) generate $(SOURCE_PATH)translations/translations.go + $(QUIET) touch $(CATALOGFILES) $(LOCALEFILES) .PHONY: build-locales # Generate the catalog files build-locales: $(CATALOGFILES) - $(QUITE) $(ECHO) "Building locales..." diff --git a/application/source/commands/01_config.go b/application/source/commands/01_config.go new file mode 100644 index 0000000000000000000000000000000000000000..15a3f89ae0c0540cdfd9e6b7a005c0dc7a4f8437 --- /dev/null +++ b/application/source/commands/01_config.go @@ -0,0 +1,70 @@ +package commands + +import ( + "github.com/kelseyhightower/envconfig" + "gopkg.in/yaml.v3" + "os" + "os/user" + "strings" +) + +const configName = "config.yaml" + +type Configuration struct { + Document struct { + Path string `yaml:"Path" envconfig:"PATH"` + Template string `yaml:"Template" envconfig:"TEMPLATE"` + } `yaml:"Document"` +} + +func checkAndInitConfiguration(name string) bool { + + if name == "" { + return false + } + + ptr, err := os.Open(name) + if err != nil { + return false + } + defer ptr.Close() + + decoder := yaml.NewDecoder(ptr) + err = decoder.Decode(state.configuration) + + if err != nil { + return false + } + + return true +} + +func initConfiguration() { + + userConfig := "" + + usr, err := user.Current() + if err == nil { + userConfig = usr.HomeDir + "/.config/" + state.info.Mnemonic + "/" + configName + } + + current, err := os.Getwd() + if err == nil { + current = current + "/" + configName + } + + state.configuration = &Configuration{} + err = envconfig.Process(strings.ToUpper(state.info.Mnemonic), state.configuration) + CheckError(err) + + for _, path := range []string{ + state.definition.ConfigurationPath, + current, + userConfig, + "/etc/" + state.info.Mnemonic + "/" + configName} { + if checkAndInitConfiguration(path) { + return + } + } + +} diff --git a/application/source/commands/01_state.go b/application/source/commands/01_state.go index a6a78dffcfd7bf644b7d8116e2c72e08c79b3b26..ae411f8b7316a94369778244531a5662ff6703b1 100644 --- a/application/source/commands/01_state.go +++ b/application/source/commands/01_state.go @@ -1,21 +1,27 @@ package commands import ( + "errors" + "github.com/jessevdk/go-flags" "gitlab.schukai.com/oss/utilities/documentation-manager/translations" "os" ) type stateStruct struct { - info Info - exitCode int - warnings []string - errors []string - messages []string + info InfoStruct + exitCode int + warnings []string + errors []string + messages []string + parser *flags.Parser + definition *Definition + configuration *Configuration } -type Info struct { - Version string - Build string +type InfoStruct struct { + Version string + Build string + Mnemonic string } var state *stateStruct @@ -24,30 +30,80 @@ func init() { state = &stateStruct{} } -func ExitWithError(code int, message string, a ...interface{}) { - state.SetCode(code).AddError(translations.T.Sprintf(message, a)).Exit() +func exitWithError(code int, message string, a ...interface{}) { + state.setCode(code).addError(translations.T.Sprintf(message, a)).Exit() } -func (e *stateStruct) AddWarning(warning string) *stateStruct { +func (e *stateStruct) addWarning(warning string) *stateStruct { e.warnings = append(e.warnings, warning) return e } -func (e *stateStruct) AddError(error string) *stateStruct { +func (e *stateStruct) addError(error string) *stateStruct { e.errors = append(e.errors, error) return e } -func (e *stateStruct) AddMessage(message string) *stateStruct { +func (e *stateStruct) addMessage(message string) *stateStruct { e.messages = append(e.messages, message) return e } -func (e *stateStruct) SetCode(code int) *stateStruct { +func (e *stateStruct) setCode(code int) *stateStruct { e.exitCode = code return e } +func (e *stateStruct) getDocumentPath() string { + if e.definition.Document.Path != "" { + return e.definition.Document.Path + } + + if e.configuration.Document.Path != "" { + return e.configuration.Document.Path + } + + path, err := os.Getwd() + CheckError(err) + + return path + +} + +func evaluateTemplate(data string) string { + if data == "" { + return "" + } + + // check if the template is a file + template, err := os.ReadFile(data) + if err == nil { + return string(template) + } + + // weather the template is a string + if errors.Is(err, os.ErrNotExist) { + return data + } + + CheckError(err) + return "" +} + +func (e *stateStruct) getDocumentTemplate() string { + + if t := evaluateTemplate(e.definition.Document.Add.Template); t != "" { + return t + } + + if t := evaluateTemplate(e.configuration.Document.Template); t != "" { + return t + } + + return newDocumentTemplate + +} + const ExitWithCodeSymbol = "exit with code" func (e *stateStruct) Exit() { diff --git a/application/source/commands/02_command.go b/application/source/commands/02_command.go index 2378b929f87bffbb054b20f865d12aa0d6d2e2dd..b65ea84e0c71c2bd8c36b93facfe5f6e37c2d010 100644 --- a/application/source/commands/02_command.go +++ b/application/source/commands/02_command.go @@ -15,7 +15,7 @@ func initCommands() { for i, y := range x { if i == 0 { - c = terminalState.parser.Find(y) + c = state.parser.Find(y) } else { c = c.Find(y) } diff --git a/application/source/commands/03_errors.go b/application/source/commands/03_errors.go index e4110027d65285091d11b0a55ffe38035dead54d..e93e9b86ad679dbe04e774c74058fd825df869aa 100644 --- a/application/source/commands/03_errors.go +++ b/application/source/commands/03_errors.go @@ -39,37 +39,37 @@ func checkFlagsError(err error) { e := err.(*flags.Error) switch e.Type { case flags.ErrUnknown: - state.AddError(translations.T.Sprintf("flag error unknown")).Exit() + state.addError(translations.T.Sprintf("flag error unknown")).Exit() case flags.ErrExpectedArgument: - state.AddError(translations.T.Sprintf("expected argument")).Exit() + state.addError(translations.T.Sprintf("expected argument")).Exit() case flags.ErrUnknownFlag: - state.AddError(translations.T.Sprintf("unknown flag")).Exit() + state.addError(translations.T.Sprintf("unknown flag")).Exit() case flags.ErrUnknownGroup: - state.AddError(translations.T.Sprintf("unknown group")).Exit() + state.addError(translations.T.Sprintf("unknown group")).Exit() case flags.ErrMarshal: - state.AddError(translations.T.Sprintf("marshal")).Exit() + state.addError(translations.T.Sprintf("marshal")).Exit() case flags.ErrHelp: state.Exit() case flags.ErrNoArgumentForBool: - state.AddError(translations.T.Sprintf("no argument for bool")).Exit() + state.addError(translations.T.Sprintf("no argument for bool")).Exit() case flags.ErrRequired: state.Exit() case flags.ErrShortNameTooLong: - state.AddError(translations.T.Sprintf("short name too long")).Exit() + state.addError(translations.T.Sprintf("short name too long")).Exit() case flags.ErrDuplicatedFlag: - state.AddError(translations.T.Sprintf("duplicated flag")).Exit() + state.addError(translations.T.Sprintf("duplicated flag")).Exit() case flags.ErrTag: - state.AddError(translations.T.Sprintf("tag %s", err.Error())).Exit() + state.addError(translations.T.Sprintf("tag %s", err.Error())).Exit() case flags.ErrCommandRequired: state.Exit() case flags.ErrUnknownCommand: - state.AddError(translations.T.Sprintf("unknown command")).Exit() + state.addError(translations.T.Sprintf("unknown command")).Exit() case flags.ErrInvalidChoice: - state.AddError(translations.T.Sprintf("invalid choice")).Exit() + state.addError(translations.T.Sprintf("invalid choice")).Exit() case flags.ErrInvalidTag: - state.AddError(translations.T.Sprintf("invalid tag")).Exit() + state.addError(translations.T.Sprintf("invalid tag")).Exit() default: - state.AddError(translations.T.Sprintf("unrecognized error type")).Exit() + state.addError(translations.T.Sprintf("unrecognized error type")).Exit() } } @@ -84,5 +84,5 @@ func CheckError(err error) { checkFlagsError(err) } - ExitWithError(1, "Unknown Error: %s", err.Error()) + exitWithError(1, "Unknown Error: %s", err.Error()) } diff --git a/application/source/commands/03_terminal.go b/application/source/commands/03_terminal.go deleted file mode 100644 index 948d119053738d7b39d35b70b72cac0bbf3396b7..0000000000000000000000000000000000000000 --- a/application/source/commands/03_terminal.go +++ /dev/null @@ -1,10 +0,0 @@ -package commands - -import "github.com/jessevdk/go-flags" - -type TerminalStateStruct struct { - parser *flags.Parser - definition *Definition -} - -var terminalState TerminalStateStruct diff --git a/application/source/commands/06_definitions.go b/application/source/commands/06_definitions.go index a25596c8d07f3c1e975a2256869e75b19ce6b831..f1adaa04aa264ff52101c224922156dd408d7379 100644 --- a/application/source/commands/06_definitions.go +++ b/application/source/commands/06_definitions.go @@ -1,6 +1,7 @@ package commands type Definition struct { - Version VersionDefinition `command:"version" alias:"v"` - Document DocumentDefinition `command:"document" alias:"d"` + ConfigurationPath string `long:"config" short:"c"` + Version VersionDefinition `command:"version" alias:"v"` + Document DocumentDefinition `command:"document" alias:"d"` } diff --git a/application/source/commands/07_execute.go b/application/source/commands/07_execute.go index 5168d7bdc47a211c7f0886dbd098fbefaf8eebd8..b69ed43fda01a7ae632c2da22323243c7249bf59 100644 --- a/application/source/commands/07_execute.go +++ b/application/source/commands/07_execute.go @@ -6,23 +6,25 @@ import ( "strings" ) -func Execute(Info Info) { +func Execute(Info InfoStruct) { state.info = Info initTerminalState() initCommands() - _, err := terminalState.parser.Parse() + _, err := state.parser.Parse() CheckError(err) - a := terminalState.parser.Command.Active + initConfiguration() + + a := state.parser.Command.Active if a == nil { - ExitWithError(1, "No active command found") + exitWithError(1, "No active command found") } queue := []string{} - runCommand(queue, terminalState.parser.Command.Active) + runCommand(queue, state.parser.Command.Active) } @@ -34,10 +36,8 @@ func initTerminalState() { parser.ShortDescription = translations.T.Sprintf("This program can be used to create documentation for your project.") parser.LongDescription = translations.T.Sprintf("This program can be used to create documentation for your project.\nIt can be used to create a new documentation project,\nadd new documentation to an existing project, or to generate\ndocumentation from a source code project.") - terminalState = TerminalStateStruct{ - parser: parser, - definition: definition, - } + state.parser = parser + state.definition = definition } @@ -56,6 +56,6 @@ func runCommand(queue []string, activeCommand *flags.Command) { execute := handler.execute execute(activeCommand) } else { - ExitWithError(1, "handler %s not found", k) + exitWithError(1, "handler %s not found", k) } } diff --git a/application/source/commands/08_document.go b/application/source/commands/08_document.go index 1aa4920552f2415da023e9b166ceff837ec80981..3aae1769ebdefa22679a1f0c55b0d084f43ac8b4 100644 --- a/application/source/commands/08_document.go +++ b/application/source/commands/08_document.go @@ -16,7 +16,7 @@ func init() { } type DocumentDefinition struct { - Path string `long:"path" short:"p" default:"."` + Path string `long:"path" short:"p"` Add DocumentAddDefinition `command:"add" alias:"a"` } diff --git a/application/source/commands/08_document_add.go b/application/source/commands/08_document_add.go index 4eacd9dd4763a52828fbd760024a1461e8137d28..11229c3cb5dfeb435f2cddd31eb44abb898895bf 100644 --- a/application/source/commands/08_document_add.go +++ b/application/source/commands/08_document_add.go @@ -1,9 +1,11 @@ package commands import ( - "fmt" "github.com/jessevdk/go-flags" "gitlab.schukai.com/oss/utilities/documentation-manager/translations" + "os" + "path" + "path/filepath" ) const documentAddSymbol = "document-add" @@ -44,6 +46,7 @@ func init() { } type DocumentAddDefinition struct { + Template string `long:"template" short:"t"` Positional struct { Name []string `positional-arg-name:"name" required:"yes" positional:"yes"` } `positional-args:"yes" required:"yes"` @@ -54,6 +57,13 @@ func initDocumentAdd(command *flags.Command) { command.ShortDescription = translations.T.Sprintf(text) command.LongDescription = translations.T.Sprintf(text) + for _, opt := range command.Options() { + switch opt.LongName { + case "template": + opt.Description = translations.T.Sprintf("template for the new document") + } + } + for _, arg := range command.Args() { switch arg.Name { case "name": @@ -64,42 +74,33 @@ func initDocumentAdd(command *flags.Command) { } -func createNewDocument(name string) error { - - //p := path.Join(arguments.Path, arguments.Add.Name+".md") - //if fileExists(p) { - // printErrorAndExit(2, "the document with name already exists", arguments.Add.Name, p) - //} - // - //t := config.Document.Template.Add - //t = strings.Replace(t, "%%ID%%", arguments.Add.Name, -1) - //t = strings.Replace(t, "%%CREATED%%", time.Now().Format("2006-01-02"), -1) - // - //d1 := []byte(t) - //err := os.WriteFile(p, d1, 0644) - //if err != nil { - // return err - //} - // - //return nil - - return nil +func createNewDocument(name string) { + + root := state.getDocumentPath() + path := path.Join(root, name) + + fileExtension := filepath.Ext(path) + if fileExtension == "" { + path += ".md" + } else if fileExtension != ".md" { + exitWithError(1, "file extension %s is not supported", fileExtension) + } + + template := state.getDocumentTemplate() + err := os.WriteFile(path, []byte(template), 0644) + CheckError(err) + } func runDocumentAdd(command *flags.Command) { - t := terminalState - p := t.definition.Document.Path - fmt.Println(p) - - names := terminalState.definition.Document.Add.Positional.Name + names := state.definition.Document.Add.Positional.Name if len(names) == 0 { - ExitWithError(1, "no document name given") + exitWithError(1, "no document name given") } for _, name := range names { - fmt.Printf("Adding document %s\n", name) createNewDocument(name) } diff --git a/application/source/go.mod b/application/source/go.mod index 2cce3dbbdb39c5fe00b40f463ae88374f27fa6de..37d64ed0292c3bd5123bd1b0545527d2fbb72150 100644 --- a/application/source/go.mod +++ b/application/source/go.mod @@ -2,11 +2,15 @@ module gitlab.schukai.com/oss/utilities/documentation-manager go 1.18 -require golang.org/x/text v0.3.7 +require ( + github.com/gookit/color v1.5.1 + github.com/jessevdk/go-flags v1.5.0 + golang.org/x/text v0.3.7 + gopkg.in/yaml.v3 v3.0.1 +) require ( - github.com/gookit/color v1.5.1 // indirect - github.com/jessevdk/go-flags v1.5.0 // indirect + github.com/kelseyhightower/envconfig v1.4.0 // indirect github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect - golang.org/x/sys v0.0.0-20220702020025-31831981b65f // indirect + golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e // indirect ) diff --git a/application/source/go.sum b/application/source/go.sum index 952c2d7f22c12eab698bf17c07caefd639311ab3..d84b1063253f0b0586af6570f2c77926e3fccde3 100644 --- a/application/source/go.sum +++ b/application/source/go.sum @@ -3,6 +3,8 @@ github.com/gookit/color v1.5.1 h1:Vjg2VEcdHpwq+oY63s/ksHrgJYCTo0bwWvmmYWdE9fQ= github.com/gookit/color v1.5.1/go.mod h1:wZFzea4X8qN6vHOSP2apMb4/+w/orMznEzYsIHPaqKM= github.com/jessevdk/go-flags v1.5.0 h1:1jKYvbxEjfUl0fmqTCOfonvskHHXMjBySTLW4y9LFvc= github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= +github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= +github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= @@ -13,7 +15,10 @@ golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44 h1:Bli41pIlzTzf3KEY06n+xnzK/ golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220702020025-31831981b65f h1:xdsejrW/0Wf2diT5CPp3XmKUNbr7Xvw8kYilQ+6qjRY= golang.org/x/sys v0.0.0-20220702020025-31831981b65f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e h1:CsOuNlbOuf0mzxJIefr6Q4uAUetRUwZE4qt7VfzP+xo= +golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/application/source/main.go b/application/source/main.go index 8c8e6065e34e35eabc0cc3d68456bb7741486cf5..729e4a37b3814f7ce68fdc7e69e1317af0e13e12 100644 --- a/application/source/main.go +++ b/application/source/main.go @@ -7,8 +7,9 @@ import ( // Used when building per // -ldflags "-X main.version=$app_version -X main.build=$(due --iso-8601 | tr -d "-" )" var ( - version string = "dev" - build string = "dev" + version string = "dev" + build string = "dev" + mnemonic string = "docman" ) /** @@ -23,9 +24,10 @@ func main() { commands.Exit() }() - commands.Execute(commands.Info{ - Version: version, - Build: build, + commands.Execute(commands.InfoStruct{ + Version: version, + Build: build, + Mnemonic: mnemonic, }) } diff --git a/application/source/translations/catalog.go b/application/source/translations/catalog.go index bae05d4a26ccc97165e1894ce8c038fc4630bad0..466ed33552173f1dd08b6dfa35cdd8a4fdd657ad 100644 --- a/application/source/translations/catalog.go +++ b/application/source/translations/catalog.go @@ -45,15 +45,16 @@ var messageKeyToIndex = map[string]int{ "Info": 2, "No active command found": 18, "Not permitted": 3, - "Prints the version and build information": 27, + "Prints the version and build information": 28, "This program can be used to create documentation for your project.": 19, "This program can be used to create documentation for your project.\nIt can be used to create a new documentation project,\nadd new documentation to an existing project, or to generate\ndocumentation from a source code project.": 20, "Unknown Error: %s": 17, "Warn": 1, "base directory in which the documents are saved": 23, - "build: %s\n": 29, - "duplicated flag": 11, - "expected argument": 5, + "build: %s\n": 30, + "duplicated flag": 11, + "expected argument": 5, + "file extension %s is not supported": 26, "file names of the new documents, separated by spaces": 25, "flag error unknown": 4, "handler %s not found": 21, @@ -61,17 +62,17 @@ var messageKeyToIndex = map[string]int{ "invalid tag": 15, "marshal": 8, "no argument for bool": 9, - "no document name given": 26, + "no document name given": 27, "short name too long": 10, "tag %s": 12, "unknown command": 13, "unknown flag": 6, "unknown group": 7, "unrecognized error type": 16, - "version: %s\n": 28, + "version: %s\n": 29, } -var deIndex = []uint32{ // 31 elements +var deIndex = []uint32{ // 32 elements 0x00000000, 0x00000007, 0x0000000f, 0x00000014, 0x00000014, 0x00000014, 0x00000014, 0x00000014, 0x00000014, 0x00000014, 0x00000014, 0x00000014, @@ -79,23 +80,23 @@ var deIndex = []uint32{ // 31 elements 0x00000014, 0x00000014, 0x00000014, 0x00000014, 0x00000014, 0x00000014, 0x00000014, 0x00000014, 0x00000014, 0x00000014, 0x00000014, 0x00000014, - 0x00000014, 0x00000014, 0x00000014, -} // Size: 148 bytes + 0x00000014, 0x00000014, 0x00000014, 0x00000014, +} // Size: 152 bytes const deData string = "\x02Fehler\x02Warnung\x02Info" -var enIndex = []uint32{ // 31 elements +var enIndex = []uint32{ // 32 elements 0x00000000, 0x00000006, 0x0000000b, 0x00000010, 0x0000001e, 0x00000031, 0x00000043, 0x00000050, 0x0000005e, 0x00000066, 0x0000007b, 0x0000008f, 0x0000009f, 0x000000a9, 0x000000b9, 0x000000c8, 0x000000d4, 0x000000ec, 0x00000101, 0x00000119, 0x0000015c, 0x0000023c, 0x00000254, 0x00000281, - 0x000002b1, 0x000002de, 0x00000313, 0x0000032a, - 0x00000357, 0x0000036b, 0x0000037d, -} // Size: 148 bytes + 0x000002b1, 0x000002de, 0x00000313, 0x00000339, + 0x00000350, 0x0000037d, 0x00000391, 0x000003a3, +} // Size: 152 bytes -const enData string = "" + // Size: 893 bytes +const enData string = "" + // Size: 931 bytes "\x02Error\x02Warn\x02Info\x02Not permitted\x02flag error unknown\x02expe" + "cted argument\x02unknown flag\x02unknown group\x02marshal\x02no argument" + " for bool\x02short name too long\x02duplicated flag\x02tag %[1]s\x02unkn" + @@ -108,8 +109,8 @@ const enData string = "" + // Size: 893 bytes "\x02handler %[1]s not found\x02Functions for creating and editing docume" + "nts\x02base directory in which the documents are saved\x02Functions for " + "creating and editing documents\x02file names of the new documents, separ" + - "ated by spaces\x02no document name given\x02Functions for creating and e" + - "diting documents\x04\x00\x01\x0a\x0f\x02version: %[1]s\x04\x00\x01\x0a" + - "\x0d\x02build: %[1]s" + "ated by spaces\x02file extension %[1]s is not supported\x02no document n" + + "ame given\x02Functions for creating and editing documents\x04\x00\x01" + + "\x0a\x0f\x02version: %[1]s\x04\x00\x01\x0a\x0d\x02build: %[1]s" - // Total table size 1209 bytes (1KiB); checksum: DC32E83D + // Total table size 1255 bytes (1KiB); checksum: 9B4E79C0 diff --git a/application/source/translations/locales/catalog.go b/application/source/translations/locales/catalog.go new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/application/source/translations/locales/de/messages.gotext.json b/application/source/translations/locales/de/messages.gotext.json index 8b66a4d2b2a0b0d61357fd9624231e03467d58b6..834fdaece9f9f0acdc53bfab06cb6fec1aa8f90a 100644 --- a/application/source/translations/locales/de/messages.gotext.json +++ b/application/source/translations/locales/de/messages.gotext.json @@ -19,9 +19,9 @@ "id": "Error", "message": "Error", "translation": "Fehler" - }, + }, { - "id": "Warn", + "id": "Warn", "message": "Warn", "translation": "Warnung" }, diff --git a/application/source/translations/locales/de/out.gotext.json b/application/source/translations/locales/de/out.gotext.json index 4f7ca9edcda20d28db3aca0353efec3e1f40f836..863850b2bcdf5803985c2f0d2f0750d05676069b 100644 --- a/application/source/translations/locales/de/out.gotext.json +++ b/application/source/translations/locales/de/out.gotext.json @@ -157,6 +157,20 @@ "message": "file names of the new documents, separated by spaces", "translation": "" }, + { + "id": "file extension {Arg_1} is not supported", + "message": "file extension {Arg_1} is not supported", + "translation": "", + "placeholders": [ + { + "id": "Arg_1", + "string": "%[1]s", + "type": "", + "underlyingType": "string", + "argNum": 1 + } + ] + }, { "id": "no document name given", "message": "no document name given", diff --git a/application/source/translations/locales/en/out.gotext.json b/application/source/translations/locales/en/out.gotext.json index 233f178c0fdfee41aeeb902fa3a6f2079df9a4da..58f01296c683ee33e64356fcccb1b052abe37cfb 100644 --- a/application/source/translations/locales/en/out.gotext.json +++ b/application/source/translations/locales/en/out.gotext.json @@ -207,6 +207,22 @@ "translatorComment": "Copied from source.", "fuzzy": true }, + { + "id": "file extension {Arg_1} is not supported", + "message": "file extension {Arg_1} is not supported", + "translation": "file extension {Arg_1} is not supported", + "translatorComment": "Copied from source.", + "placeholders": [ + { + "id": "Arg_1", + "string": "%[1]s", + "type": "", + "underlyingType": "string", + "argNum": 1 + } + ], + "fuzzy": true + }, { "id": "no document name given", "message": "no document name given", diff --git a/development/examples/example1/config.yaml b/development/examples/example1/config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ac3a40b1911268369c9a2504cd396da349e49bee --- /dev/null +++ b/development/examples/example1/config.yaml @@ -0,0 +1,2 @@ +Document: + Path: /home/volker.schukai/projekte/gitlab/oss/utilities/documentation-manager/development/examples/example2