Skip to content

Latest commit

 

History

History
73 lines (51 loc) · 2.56 KB

File metadata and controls

73 lines (51 loc) · 2.56 KB

markfluence read

Get a Confluence page and print its body

Synopsis

Get a Confluence page and print its body to stdout. You can redirect the output to a file.

PAGE is a page id, a Confluence page URL, or a Markdown file that names a page_id in its frontmatter or in its pages: entry. A URL can have the usual /wiki/.../pages//... form, or the older ?pageId= form.

--format markdown is the default. The output has title, space, parent, page_id, labels, page_status, and page_width in the frontmatter. It is the inverse of what create and update publish, as far as that is possible.

The Confluence API has no Markdown form, so markfluence converts the storage format itself. The constructs that markfluence writes come back correctly. For content from the Confluence editor, some details change:

  • A macro that markfluence does not map, and a column layout, come back as raw storage tags. Their bodies stay as Markdown that you can read, and they publish back with no change.
  • Some conversions lose detail. For example, a cell color that is not one of the named swatches comes back as a literal hex value.

Thus the output helps you read a page, but it is not a guaranteed round trip.

--format storage prints the raw storage format XHTML exactly as Confluence stores it.

markfluence read PAGE [flags]

Examples

  # Print Markdown, with frontmatter, to stdout
  markfluence read 1234567890

  # Save it as a file that you can edit and publish back
  markfluence read 1234567890 > page.md

  # Print the raw storage format that Confluence holds
  markfluence read 1234567890 --format storage > page.storage.xml

  # Give a URL
  markfluence read "https://org.atlassian.net/wiki/spaces/ENG/pages/1234567890/Title"

Options

      --format string   Output format: markdown (the default) or storage (default "markdown")
  -h, --help            help for read

Options inherited from parent commands

  -d, --debug             Print debug details, such as each retry decision
      --env-file string   File to read credentials from, before the environment and your credentials file
      --json              Write JSON, and no human output. A result goes to stdout. A fatal error goes to stderr as a JSON error object
      --no-color          Print output with no color
      --root string       Documentation root for every file. The default is the nearest directory above each file that has a markfluence.yaml, or the directory of the file if there is none

SEE ALSO