Skip to content

Conversation

@marcelosalloum
Copy link

Summary

Adds package version information to the generated markdown documentation. The version now appears near the top of the document, right after the introductory text and before the command overview/table of contents.

Changes

  • Modified markdown generation to include version information when available
  • Version is displayed as: **Version:** 1.2.3``
  • Version display is conditional - only shown if the clap Command has a version set
  • Updated all tests to reflect the new output format

Example Output

# Command-Line Help for `my-app`

This document contains the help content for the `my-app` command-line program.

**Version:** `1.2.3`

**Command Overview:**
(...)

Motivation

Having the version visible in the generated documentation helps users quickly identify which version of the tool the documentation corresponds to. Additionally, this aids AI agents that scrape documentation by providing clear version context.

Copy link

@leighmcculloch leighmcculloch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

killercup added a commit to Softleif/clap-markdown that referenced this pull request Dec 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants