Skip to content

feat: Add auto-detection of ArticleID in yt articles fetch (#641)#642

Merged
ryancheley merged 1 commit intomainfrom
641-auto-detect-articleid-from-markdown-file-in-yt-articles-fetch
Mar 21, 2026
Merged

feat: Add auto-detection of ArticleID in yt articles fetch (#641)#642
ryancheley merged 1 commit intomainfrom
641-auto-detect-articleid-from-markdown-file-in-yt-articles-fetch

Conversation

@ryancheley
Copy link
Copy Markdown
Owner

Summary

Make the article_id argument optional in the yt articles fetch command and enable auto-detection from markdown files containing an <!-- ArticleID: XXX --> comment.

This improves UX by allowing users to fetch articles by simply specifying the local markdown file, without needing to remember or provide the article ID.

Changes Made

  • Make article_id argument optional in fetch command
  • Auto-detect article ID from markdown file's ArticleID comment
  • Add proper error handling for missing article ID
  • Add 3 comprehensive tests for auto-detection feature
  • Update documentation with new behavior and examples
  • Update CHANGELOG with feature description

Examples

# Auto-detect article ID from file
yt articles fetch --file my-article.md

# Still works with explicit ID
yt articles fetch DOCS-A-1 --file my-article.md

# Search current directory for file with ArticleID
yt articles fetch

Test Plan

  • ✅ Unit tests added and passing (3 new tests)
  • ✅ All existing tests still pass (1362 tests)
  • ✅ Pre-commit hooks pass
  • ✅ Type checking passes
  • ✅ Documentation build succeeds

Documentation

  • Updated docs/commands/articles.rst with fetch command documentation
  • Updated CHANGELOG.md with feature description

Fixes #641

Make the article_id argument optional in the fetch command and enable
auto-detection from markdown file's ArticleID comment. This improves UX
by allowing users to fetch articles by simply specifying the local file,
without needing to remember the article ID.

Changes:
- Make article_id argument optional in fetch command
- Auto-detect article ID from markdown file's ArticleID comment
- Add error handling for missing article ID
- Add 3 comprehensive tests for auto-detection feature
- Update documentation with new behavior and examples
- Update CHANGELOG with feature description

Fixes #641
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@ryancheley ryancheley linked an issue Mar 21, 2026 that may be closed by this pull request
@ryancheley ryancheley merged commit 7525f0c into main Mar 21, 2026
10 checks passed
@ryancheley ryancheley deleted the 641-auto-detect-articleid-from-markdown-file-in-yt-articles-fetch branch March 21, 2026 02:24
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.

Auto-detect ArticleID from markdown file in yt articles fetch

1 participant