Skip to Content
Atlassian Confluenceacp2mdv1.0.0Count & Analyze

Count & Analyze

The page count commands analyze the structure of a Confluence page by counting the ADF node types (structural elements like paragraphs, tables, headings) and mark types (inline formatting like bold, italic, text color) present in the document.

This is useful for:

  • Understanding page complexity before conversion
  • Identifying pages with unsupported or heavy formatting
  • Auditing content for migration planning

Count node types

acp2md page count nodes by-id PAGE_ID [flags]

Returns how many times each ADF node type appears in the page.

Examples

# Table output (default) acp2md page count nodes by-id 123456 # JSON output — pipe to jq for filtering acp2md page count nodes by-id 123456 --format json # YAML output acp2md page count nodes by-id 123456 --format yaml # Save to file acp2md page count nodes by-id 123456 --format json --output nodes.json # Analyze a specific version acp2md page count nodes by-id 123456 --version 5 # Analyze a draft acp2md page count nodes by-id 123456 --get-draft # Pipe page ID from stdin echo "123456" | acp2md page count nodes by-id

Sample output (table)

NODE TYPE COUNT ────────────────────────────── paragraph 42 text 198 heading 12 bulletList 8 listItem 31 table 5 tableRow 24 tableCell 96 codeBlock 3 inlineCard 7

Count node types by title

acp2md page count nodes by-title "PAGE TITLE" [flags]

Use this when the page title is the identifier people know, but the page ID is not immediately available.

Additional flag

FlagShortDefaultDescription
--sort-S(none)Sort matches: id, -id, created-date, -created-date, modified-date, -modified-date, title, -title

Count node types by URL

acp2md page count nodes by-url URL [flags]

Aliases: url, u

Extracts the page ID from a Confluence URL and counts node types. Supported URL formats:

  • https://domain.atlassian.net/wiki/spaces/KEY/pages/123456/Page+Title
  • https://domain.atlassian.net/wiki/spaces/KEY/pages/123456
  • https://domain.atlassian.net/wiki/pages/viewpage.action?pageId=123456

Examples

# Count nodes from a Confluence URL acp2md page count nodes by-url "https://mycompany.atlassian.net/wiki/spaces/ENG/pages/123456" # JSON output acp2md page count nodes by-url "https://mycompany.atlassian.net/wiki/spaces/ENG/pages/123456" --format json # Save to file acp2md page count nodes by-url "https://mycompany.atlassian.net/wiki/spaces/ENG/pages/123456" --output nodes.json # Pipe URL from stdin echo "https://mycompany.atlassian.net/wiki/spaces/ENG/pages/123456" | acp2md page count nodes by-url

Count mark types

acp2md page count marks by-id PAGE_ID [flags]

Returns how many times each ADF mark type (inline formatting) appears in the page.

Examples

# Table output (default) acp2md page count marks by-id 123456 # JSON output acp2md page count marks by-id 123456 --format json # YAML output acp2md page count marks by-id 123456 --format yaml # Save to file acp2md page count marks by-id 123456 --output marks-report.txt # Analyze a specific version acp2md page count marks by-id 123456 --version 5 # Pipe page ID from stdin echo "123456" | acp2md page count marks by-id

Sample output (table)

MARK TYPE COUNT ────────────────────────────── strong 34 em 12 code 18 textColor 47 link 23 underline 5

A high textColor count means the page will produce many <span style="color: ..."> elements in Markdown unless --exclude-marks is used during conversion.


Count mark types by title

acp2md page count marks by-title "PAGE TITLE" [flags]

Use this when you need mark analysis for a page selected by exact title instead of ID or URL.


Count mark types by URL

acp2md page count marks by-url URL [flags]

Aliases: url, u

Extracts the page ID from a Confluence URL and counts mark types. Supported URL formats:

  • https://domain.atlassian.net/wiki/spaces/KEY/pages/123456/Page+Title
  • https://domain.atlassian.net/wiki/spaces/KEY/pages/123456
  • https://domain.atlassian.net/wiki/pages/viewpage.action?pageId=123456

Examples

# Count marks from a Confluence URL acp2md page count marks by-url "https://mycompany.atlassian.net/wiki/spaces/ENG/pages/123456" # JSON output acp2md page count marks by-url "https://mycompany.atlassian.net/wiki/spaces/ENG/pages/123456" --format json # Save to file acp2md page count marks by-url "https://mycompany.atlassian.net/wiki/spaces/ENG/pages/123456" --output marks.json # Pipe URL from stdin echo "https://mycompany.atlassian.net/wiki/spaces/ENG/pages/123456" | acp2md page count marks by-url

Flags (both commands)

FlagShortDefaultDescription
--output-o(stdout)Output file path
--format-ftableOutput format: table, json, yaml
--get-draft-dfalseAnalyze the draft version
--status-scurrentPage status: current, archived, trashed, deleted, draft
--version-v-1 (latest)Analyze a specific version number
--include-labels-lfalseInclude page labels
--include-version-VfalseInclude version info
--include-versions-LfalseInclude full version history

For the by-title variants, --sort is also available with the same values used by page get by-title and page convert by-title.


Advanced: filter JSON output with jq

# Show only node types with more than 10 occurrences acp2md page count nodes by-id 123456 --format json \ | jq '[.[] | select(.count > 10)] | sort_by(-.count)' # Show only mark types present (count > 0) acp2md page count marks by-id 123456 --format json \ | jq '[.[] | select(.count > 0)]'
Last updated on