mirror of
https://github.com/kovetskiy/mark.git
synced 2025-06-07 23:12:42 +08:00
fix: Config loading from file
This commit is contained in:
parent
58cdd5608f
commit
bf542ab684
@ -804,9 +804,9 @@ GLOBAL OPTIONS:
|
|||||||
--compile-only show resulting HTML and don't update Confluence page content. (default: false) [$MARK_COMPILE_ONLY]
|
--compile-only show resulting HTML and don't update Confluence page content. (default: false) [$MARK_COMPILE_ONLY]
|
||||||
--dry-run resolve page and ancestry, show resulting HTML and exit. (default: false) [$MARK_DRY_RUN]
|
--dry-run resolve page and ancestry, show resulting HTML and exit. (default: false) [$MARK_DRY_RUN]
|
||||||
--edit-lock, -k lock page editing to current user only to prevent accidental manual edits over Confluence Web UI. (default: false) [$MARK_EDIT_LOCK]
|
--edit-lock, -k lock page editing to current user only to prevent accidental manual edits over Confluence Web UI. (default: false) [$MARK_EDIT_LOCK]
|
||||||
--drop-h1, --h1_drop don't include the first H1 heading in Confluence output. (default: false) [$MARK_H1_DROP]
|
--drop-h1 don't include the first H1 heading in Confluence output. (default: false) [$MARK_DROP_H1]
|
||||||
--strip-linebreaks, -L remove linebreaks inside of tags, to accommodate non-standard Confluence behavior (default: false) [$MARK_STRIP_LINEBREAKS]
|
--strip-linebreaks, -L remove linebreaks inside of tags, to accommodate non-standard Confluence behavior (default: false) [$MARK_STRIP_LINEBREAKS]
|
||||||
--title-from-h1, --h1_title extract page title from a leading H1 heading. If no H1 heading on a page exists, then title must be set in the page metadata. (default: false) [$MARK_H1_TITLE]
|
--title-from-h1 extract page title from a leading H1 heading. If no H1 heading on a page exists, then title must be set in the page metadata. (default: false) [$MARK_TITLE_FROM_H1]
|
||||||
--title-append-generated-hash appends a short hash generated from the path of the page (space, parents, and title) to the title (default: false) [$MARK_TITLE_APPEND_GENERATED_HASH]
|
--title-append-generated-hash appends a short hash generated from the path of the page (space, parents, and title) to the title (default: false) [$MARK_TITLE_APPEND_GENERATED_HASH]
|
||||||
--minor-edit don't send notifications while updating Confluence page. (default: false) [$MARK_MINOR_EDIT]
|
--minor-edit don't send notifications while updating Confluence page. (default: false) [$MARK_MINOR_EDIT]
|
||||||
--version-message string add a message to the page version, to explain the edit (default: "") [$MARK_VERSION_MESSAGE]
|
--version-message string add a message to the page version, to explain the edit (default: "") [$MARK_VERSION_MESSAGE]
|
||||||
@ -815,8 +815,8 @@ GLOBAL OPTIONS:
|
|||||||
--username string, -u string use specified username for updating Confluence page. [$MARK_USERNAME]
|
--username string, -u string use specified username for updating Confluence page. [$MARK_USERNAME]
|
||||||
--password string, -p string use specified token for updating Confluence page. Specify - as password to read password from stdin, or your Personal access token. Username is not mandatory if personal access token is provided. For more info please see: https://developer.atlassian.com/server/confluence/confluence-server-rest-api/#authentication. [$MARK_PASSWORD]
|
--password string, -p string use specified token for updating Confluence page. Specify - as password to read password from stdin, or your Personal access token. Username is not mandatory if personal access token is provided. For more info please see: https://developer.atlassian.com/server/confluence/confluence-server-rest-api/#authentication. [$MARK_PASSWORD]
|
||||||
--target-url string, -l string edit specified Confluence page. If -l is not specified, file should contain metadata (see above). [$MARK_TARGET_URL]
|
--target-url string, -l string edit specified Confluence page. If -l is not specified, file should contain metadata (see above). [$MARK_TARGET_URL]
|
||||||
--base-url string, -b string, --base_url string base URL for Confluence. Alternative option for base_url config field. [$MARK_BASE_URL]
|
--base-url string, -b string base URL for Confluence. Alternative option for base_url config field. [$MARK_BASE_URL]
|
||||||
--config string, -c string use the specified configuration file. (default: "/home/mrueg/.config/mark") [$MARK_CONFIG]
|
--config string, -c string use the specified configuration file. (default: $HOME/.config/mark.toml") [$MARK_CONFIG]
|
||||||
--ci run on CI mode. It won't fail if files are not found. (default: false) [$MARK_CI]
|
--ci run on CI mode. It won't fail if files are not found. (default: false) [$MARK_CI]
|
||||||
--space string use specified space key. If the space key is not specified, it must be set in the page metadata. [$MARK_SPACE]
|
--space string use specified space key. If the space key is not specified, it must be set in the page metadata. [$MARK_SPACE]
|
||||||
--parents string A list containing the parents of the document separated by parents-delimiter (default: '/'). These will be prepended to the ones defined in the document itself. [$MARK_PARENTS]
|
--parents string A list containing the parents of the document separated by parents-delimiter (default: '/'). These will be prepended to the ones defined in the document itself. [$MARK_PARENTS]
|
||||||
|
@ -143,7 +143,7 @@ func processFile(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if meta.Title == "" {
|
if meta.Title == "" {
|
||||||
fatalErrorHandler.Handle(nil, "page title is not set ('Title' header is not set and '--title-from-h1' option and 'h1_title' config is not set or there is no H1 in the file)")
|
fatalErrorHandler.Handle(nil, "page title is not set ('Title' header is not set and '--title-from-h1' option and 'h1-title' config is not set or there is no H1 in the file)")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -481,7 +481,7 @@ func ConfigFilePath() string {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
return filepath.Join(fp, "mark")
|
return filepath.Join(fp, "mark.toml")
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetLogLevel(cmd *cli.Command) error {
|
func SetLogLevel(cmd *cli.Command) error {
|
||||||
|
@ -6,9 +6,7 @@ import (
|
|||||||
"github.com/urfave/cli/v3"
|
"github.com/urfave/cli/v3"
|
||||||
)
|
)
|
||||||
|
|
||||||
var filename = ConfigFilePath()
|
var filename string
|
||||||
|
|
||||||
var configFile = altsrc.NewStringPtrSourcer(&filename)
|
|
||||||
|
|
||||||
var Flags = []cli.Flag{
|
var Flags = []cli.Flag{
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
@ -17,82 +15,82 @@ var Flags = []cli.Flag{
|
|||||||
Value: "",
|
Value: "",
|
||||||
Usage: "use specified markdown file(s) for converting to html. Supports file globbing patterns (needs to be quoted).",
|
Usage: "use specified markdown file(s) for converting to html. Supports file globbing patterns (needs to be quoted).",
|
||||||
TakesFile: true,
|
TakesFile: true,
|
||||||
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_FILES"), altsrctoml.TOML("files", configFile)),
|
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_FILES"), altsrctoml.TOML("files", altsrc.NewStringPtrSourcer(&filename))),
|
||||||
},
|
},
|
||||||
&cli.BoolFlag{
|
&cli.BoolFlag{
|
||||||
Name: "continue-on-error",
|
Name: "continue-on-error",
|
||||||
Value: false,
|
Value: false,
|
||||||
Usage: "don't exit if an error occurs while processing a file, continue processing remaining files.",
|
Usage: "don't exit if an error occurs while processing a file, continue processing remaining files.",
|
||||||
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_CONTINUE_ON_ERROR"), altsrctoml.TOML("continue-on-error", configFile)),
|
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_CONTINUE_ON_ERROR"), altsrctoml.TOML("continue-on-error", altsrc.NewStringPtrSourcer(&filename))),
|
||||||
},
|
},
|
||||||
&cli.BoolFlag{
|
&cli.BoolFlag{
|
||||||
Name: "compile-only",
|
Name: "compile-only",
|
||||||
Value: false,
|
Value: false,
|
||||||
Usage: "show resulting HTML and don't update Confluence page content.",
|
Usage: "show resulting HTML and don't update Confluence page content.",
|
||||||
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_COMPILE_ONLY"), altsrctoml.TOML("compile-only", configFile)),
|
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_COMPILE_ONLY"), altsrctoml.TOML("compile-only", altsrc.NewStringPtrSourcer(&filename))),
|
||||||
},
|
},
|
||||||
&cli.BoolFlag{
|
&cli.BoolFlag{
|
||||||
Name: "dry-run",
|
Name: "dry-run",
|
||||||
Value: false,
|
Value: false,
|
||||||
Usage: "resolve page and ancestry, show resulting HTML and exit.",
|
Usage: "resolve page and ancestry, show resulting HTML and exit.",
|
||||||
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_DRY_RUN"), altsrctoml.TOML("dry-run", configFile)),
|
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_DRY_RUN"), altsrctoml.TOML("dry-run", altsrc.NewStringPtrSourcer(&filename))),
|
||||||
},
|
},
|
||||||
&cli.BoolFlag{
|
&cli.BoolFlag{
|
||||||
Name: "edit-lock",
|
Name: "edit-lock",
|
||||||
Value: false,
|
Value: false,
|
||||||
Aliases: []string{"k"},
|
Aliases: []string{"k"},
|
||||||
Usage: "lock page editing to current user only to prevent accidental manual edits over Confluence Web UI.",
|
Usage: "lock page editing to current user only to prevent accidental manual edits over Confluence Web UI.",
|
||||||
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_EDIT_LOCK"), altsrctoml.TOML("edit-lock", configFile)),
|
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_EDIT_LOCK"), altsrctoml.TOML("edit-lock", altsrc.NewStringPtrSourcer(&filename))),
|
||||||
},
|
},
|
||||||
&cli.BoolFlag{
|
&cli.BoolFlag{
|
||||||
Name: "drop-h1",
|
Name: "drop-h1",
|
||||||
Value: false,
|
Value: false,
|
||||||
Usage: "don't include the first H1 heading in Confluence output.",
|
Usage: "don't include the first H1 heading in Confluence output.",
|
||||||
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_DROP_H1"), altsrctoml.TOML("drop-h1", configFile)),
|
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_DROP_H1"), altsrctoml.TOML("drop-h1", altsrc.NewStringPtrSourcer(&filename))),
|
||||||
},
|
},
|
||||||
&cli.BoolFlag{
|
&cli.BoolFlag{
|
||||||
Name: "strip-linebreaks",
|
Name: "strip-linebreaks",
|
||||||
Value: false,
|
Value: false,
|
||||||
Aliases: []string{"L"},
|
Aliases: []string{"L"},
|
||||||
Usage: "remove linebreaks inside of tags, to accommodate non-standard Confluence behavior",
|
Usage: "remove linebreaks inside of tags, to accommodate non-standard Confluence behavior",
|
||||||
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_STRIP_LINEBREAKS"), altsrctoml.TOML("strip-linebreaks", configFile)),
|
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_STRIP_LINEBREAKS"), altsrctoml.TOML("strip-linebreaks", altsrc.NewStringPtrSourcer(&filename))),
|
||||||
},
|
},
|
||||||
&cli.BoolFlag{
|
&cli.BoolFlag{
|
||||||
Name: "title-from-h1",
|
Name: "title-from-h1",
|
||||||
Value: false,
|
Value: false,
|
||||||
Usage: "extract page title from a leading H1 heading. If no H1 heading on a page exists, then title must be set in the page metadata.",
|
Usage: "extract page title from a leading H1 heading. If no H1 heading on a page exists, then title must be set in the page metadata.",
|
||||||
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_TITLE_FROM_H1"), altsrctoml.TOML("title-from-h1", configFile)),
|
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_TITLE_FROM_H1"), altsrctoml.TOML("title-from-h1", altsrc.NewStringPtrSourcer(&filename))),
|
||||||
},
|
},
|
||||||
&cli.BoolFlag{
|
&cli.BoolFlag{
|
||||||
Name: "title-append-generated-hash",
|
Name: "title-append-generated-hash",
|
||||||
Value: false,
|
Value: false,
|
||||||
Usage: "appends a short hash generated from the path of the page (space, parents, and title) to the title",
|
Usage: "appends a short hash generated from the path of the page (space, parents, and title) to the title",
|
||||||
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_TITLE_APPEND_GENERATED_HASH"), altsrctoml.TOML("title-append-generated-hash", configFile)),
|
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_TITLE_APPEND_GENERATED_HASH"), altsrctoml.TOML("title-append-generated-hash", altsrc.NewStringPtrSourcer(&filename))),
|
||||||
},
|
},
|
||||||
&cli.BoolFlag{
|
&cli.BoolFlag{
|
||||||
Name: "minor-edit",
|
Name: "minor-edit",
|
||||||
Value: false,
|
Value: false,
|
||||||
Usage: "don't send notifications while updating Confluence page.",
|
Usage: "don't send notifications while updating Confluence page.",
|
||||||
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_MINOR_EDIT"), altsrctoml.TOML("minor-edit", configFile)),
|
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_MINOR_EDIT"), altsrctoml.TOML("minor-edit", altsrc.NewStringPtrSourcer(&filename))),
|
||||||
},
|
},
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: "version-message",
|
Name: "version-message",
|
||||||
Value: "",
|
Value: "",
|
||||||
Usage: "add a message to the page version, to explain the edit (default: \"\")",
|
Usage: "add a message to the page version, to explain the edit (default: \"\")",
|
||||||
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_VERSION_MESSAGE"), altsrctoml.TOML("version-message", configFile)),
|
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_VERSION_MESSAGE"), altsrctoml.TOML("version-message", altsrc.NewStringPtrSourcer(&filename))),
|
||||||
},
|
},
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: "color",
|
Name: "color",
|
||||||
Value: "auto",
|
Value: "auto",
|
||||||
Usage: "display logs in color. Possible values: auto, never.",
|
Usage: "display logs in color. Possible values: auto, never.",
|
||||||
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_COLOR"),
|
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_COLOR"),
|
||||||
altsrctoml.TOML("color", configFile)),
|
altsrctoml.TOML("color", altsrc.NewStringPtrSourcer(&filename))),
|
||||||
},
|
},
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: "log-level",
|
Name: "log-level",
|
||||||
Value: "info",
|
Value: "info",
|
||||||
Usage: "set the log level. Possible values: TRACE, DEBUG, INFO, WARNING, ERROR, FATAL.",
|
Usage: "set the log level. Possible values: TRACE, DEBUG, INFO, WARNING, ERROR, FATAL.",
|
||||||
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_LOG_LEVEL"), altsrctoml.TOML("log-level", configFile)),
|
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_LOG_LEVEL"), altsrctoml.TOML("log-level", altsrc.NewStringPtrSourcer(&filename))),
|
||||||
},
|
},
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: "username",
|
Name: "username",
|
||||||
@ -100,21 +98,21 @@ var Flags = []cli.Flag{
|
|||||||
Value: "",
|
Value: "",
|
||||||
Usage: "use specified username for updating Confluence page.",
|
Usage: "use specified username for updating Confluence page.",
|
||||||
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_USERNAME"),
|
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_USERNAME"),
|
||||||
altsrctoml.TOML("username", configFile)),
|
altsrctoml.TOML("username", altsrc.NewStringPtrSourcer(&filename))),
|
||||||
},
|
},
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: "password",
|
Name: "password",
|
||||||
Aliases: []string{"p"},
|
Aliases: []string{"p"},
|
||||||
Value: "",
|
Value: "",
|
||||||
Usage: "use specified token for updating Confluence page. Specify - as password to read password from stdin, or your Personal access token. Username is not mandatory if personal access token is provided. For more info please see: https://developer.atlassian.com/server/confluence/confluence-server-rest-api/#authentication.",
|
Usage: "use specified token for updating Confluence page. Specify - as password to read password from stdin, or your Personal access token. Username is not mandatory if personal access token is provided. For more info please see: https://developer.atlassian.com/server/confluence/confluence-server-rest-api/#authentication.",
|
||||||
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_PASSWORD"), altsrctoml.TOML("password", configFile)),
|
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_PASSWORD"), altsrctoml.TOML("password", altsrc.NewStringPtrSourcer(&filename))),
|
||||||
},
|
},
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: "target-url",
|
Name: "target-url",
|
||||||
Aliases: []string{"l"},
|
Aliases: []string{"l"},
|
||||||
Value: "",
|
Value: "",
|
||||||
Usage: "edit specified Confluence page. If -l is not specified, file should contain metadata (see above).",
|
Usage: "edit specified Confluence page. If -l is not specified, file should contain metadata (see above).",
|
||||||
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_TARGET_URL"), altsrctoml.TOML("target-url", configFile)),
|
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_TARGET_URL"), altsrctoml.TOML("target-url", altsrc.NewStringPtrSourcer(&filename))),
|
||||||
},
|
},
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: "base-url",
|
Name: "base-url",
|
||||||
@ -122,7 +120,7 @@ var Flags = []cli.Flag{
|
|||||||
Value: "",
|
Value: "",
|
||||||
Usage: "base URL for Confluence. Alternative option for base_url config field.",
|
Usage: "base URL for Confluence. Alternative option for base_url config field.",
|
||||||
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_BASE_URL"),
|
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_BASE_URL"),
|
||||||
altsrctoml.TOML("base-url", configFile)),
|
altsrctoml.TOML("base-url", altsrc.NewStringPtrSourcer(&filename))),
|
||||||
},
|
},
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: "config",
|
Name: "config",
|
||||||
@ -137,62 +135,62 @@ var Flags = []cli.Flag{
|
|||||||
Name: "ci",
|
Name: "ci",
|
||||||
Value: false,
|
Value: false,
|
||||||
Usage: "run on CI mode. It won't fail if files are not found.",
|
Usage: "run on CI mode. It won't fail if files are not found.",
|
||||||
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_CI"), altsrctoml.TOML("ci", configFile)),
|
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_CI"), altsrctoml.TOML("ci", altsrc.NewStringPtrSourcer(&filename))),
|
||||||
},
|
},
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: "space",
|
Name: "space",
|
||||||
Value: "",
|
Value: "",
|
||||||
Usage: "use specified space key. If the space key is not specified, it must be set in the page metadata.",
|
Usage: "use specified space key. If the space key is not specified, it must be set in the page metadata.",
|
||||||
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_SPACE"), altsrctoml.TOML("space", configFile)),
|
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_SPACE"), altsrctoml.TOML("space", altsrc.NewStringPtrSourcer(&filename))),
|
||||||
},
|
},
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: "parents",
|
Name: "parents",
|
||||||
Value: "",
|
Value: "",
|
||||||
Usage: "A list containing the parents of the document separated by parents-delimiter (default: '/'). These will be prepended to the ones defined in the document itself.",
|
Usage: "A list containing the parents of the document separated by parents-delimiter (default: '/'). These will be prepended to the ones defined in the document itself.",
|
||||||
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_PARENTS"), altsrctoml.TOML("parents", configFile)),
|
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_PARENTS"), altsrctoml.TOML("parents", altsrc.NewStringPtrSourcer(&filename))),
|
||||||
},
|
},
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: "parents-delimiter",
|
Name: "parents-delimiter",
|
||||||
Value: "/",
|
Value: "/",
|
||||||
Usage: "The delimiter used for the parents list",
|
Usage: "The delimiter used for the parents list",
|
||||||
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_PARENTS_DELIMITER"), altsrctoml.TOML("parents-delimiter", configFile)),
|
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_PARENTS_DELIMITER"), altsrctoml.TOML("parents-delimiter", altsrc.NewStringPtrSourcer(&filename))),
|
||||||
},
|
},
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: "mermaid-provider",
|
Name: "mermaid-provider",
|
||||||
Value: "cloudscript",
|
Value: "cloudscript",
|
||||||
Usage: "defines the mermaid provider to use. Supported options are: cloudscript, mermaid-go.",
|
Usage: "defines the mermaid provider to use. Supported options are: cloudscript, mermaid-go.",
|
||||||
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_MERMAID_PROVIDER"), altsrctoml.TOML("mermaid-provider", configFile)),
|
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_MERMAID_PROVIDER"), altsrctoml.TOML("mermaid-provider", altsrc.NewStringPtrSourcer(&filename))),
|
||||||
},
|
},
|
||||||
&cli.FloatFlag{
|
&cli.FloatFlag{
|
||||||
Name: "mermaid-scale",
|
Name: "mermaid-scale",
|
||||||
Value: 1.0,
|
Value: 1.0,
|
||||||
Usage: "defines the scaling factor for mermaid renderings.",
|
Usage: "defines the scaling factor for mermaid renderings.",
|
||||||
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_MERMAID_SCALE"), altsrctoml.TOML("mermaid-scale", configFile)),
|
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_MERMAID_SCALE"), altsrctoml.TOML("mermaid-scale", altsrc.NewStringPtrSourcer(&filename))),
|
||||||
},
|
},
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: "include-path",
|
Name: "include-path",
|
||||||
Value: "",
|
Value: "",
|
||||||
Usage: "Path for shared includes, used as a fallback if the include doesn't exist in the current directory.",
|
Usage: "Path for shared includes, used as a fallback if the include doesn't exist in the current directory.",
|
||||||
TakesFile: true,
|
TakesFile: true,
|
||||||
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_INCLUDE_PATH"), altsrctoml.TOML("include-path", configFile)),
|
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_INCLUDE_PATH"), altsrctoml.TOML("include-path", altsrc.NewStringPtrSourcer(&filename))),
|
||||||
},
|
},
|
||||||
&cli.BoolFlag{
|
&cli.BoolFlag{
|
||||||
Name: "changes-only",
|
Name: "changes-only",
|
||||||
Value: false,
|
Value: false,
|
||||||
Usage: "Avoids re-uploading pages that haven't changed since the last run.",
|
Usage: "Avoids re-uploading pages that haven't changed since the last run.",
|
||||||
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_CHANGES_ONLY"), altsrctoml.TOML("changes-only", configFile)),
|
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_CHANGES_ONLY"), altsrctoml.TOML("changes-only", altsrc.NewStringPtrSourcer(&filename))),
|
||||||
},
|
},
|
||||||
&cli.FloatFlag{
|
&cli.FloatFlag{
|
||||||
Name: "d2-scale",
|
Name: "d2-scale",
|
||||||
Value: 1.0,
|
Value: 1.0,
|
||||||
Usage: "defines the scaling factor for d2 renderings.",
|
Usage: "defines the scaling factor for d2 renderings.",
|
||||||
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_D2_SCALE"), altsrctoml.TOML("d2-scale", configFile)),
|
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_D2_SCALE"), altsrctoml.TOML("d2-scale", altsrc.NewStringPtrSourcer(&filename))),
|
||||||
},
|
},
|
||||||
|
|
||||||
&cli.StringSliceFlag{
|
&cli.StringSliceFlag{
|
||||||
Name: "features",
|
Name: "features",
|
||||||
Value: []string{"mermaid"},
|
Value: []string{"mermaid"},
|
||||||
Usage: "Enables optional features. Current features: d2, mermaid",
|
Usage: "Enables optional features. Current features: d2, mermaid",
|
||||||
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_FEATURES"), altsrctoml.TOML("features", configFile)),
|
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_FEATURES"), altsrctoml.TOML("features", altsrc.NewStringPtrSourcer(&filename))),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user