mirror of
https://github.com/kovetskiy/mark.git
synced 2026-05-03 22:12:35 +00:00
Allow Title via h1 without any other metadata (#229)
This commit is contained in:
21
main.go
21
main.go
@@ -66,11 +66,11 @@ Options:
|
||||
Supports file globbing patterns (needs to be quoted).
|
||||
-k Lock page editing to current user only to prevent accidental
|
||||
manual edits over Confluence Web UI.
|
||||
--space <space> Use specified space key. If not specified space ley must
|
||||
be set in a page metadata.
|
||||
--space <space> Use specified space key. If the space key is not specified, it must
|
||||
be set in the page metadata.
|
||||
--drop-h1 Don't include H1 headings in Confluence output.
|
||||
--title-from-h1 Extract page title from a leading H1 heading. If no H1 heading
|
||||
on a page then title must be set in a page metadata.
|
||||
on a page exists, then title must be set in the page metadata.
|
||||
--dry-run Resolve page and ancestry, show resulting HTML and exit.
|
||||
--compile-only Show resulting HTML and don't update Confluence page content.
|
||||
--minor-edit Don't send notifications while updating Confluence page.
|
||||
@@ -197,11 +197,16 @@ func processFile(
|
||||
}
|
||||
|
||||
if pageID == "" && meta == nil {
|
||||
log.Fatal(
|
||||
`specified file doesn't contain metadata ` +
|
||||
`and URL is not specified via command line ` +
|
||||
`or doesn't contain pageId GET-parameter`,
|
||||
)
|
||||
if flags.TitleFromH1 && flags.Space != "" {
|
||||
meta = &mark.Meta{}
|
||||
meta.Type = "page"
|
||||
} else {
|
||||
log.Fatal(
|
||||
`specified file doesn't contain metadata ` +
|
||||
`and URL is not specified via command line ` +
|
||||
`or doesn't contain pageId GET-parameter`,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
switch {
|
||||
|
||||
Reference in New Issue
Block a user