Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Convert to Reference Link #2

Merged
merged 2 commits into from
Jan 8, 2025
Merged

Conversation

eli64s
Copy link
Owner

@eli64s eli64s commented Jan 8, 2025

Add Markdown Reference Link Converter

Overview

Add feature to convert all inline Markdown links in a given file to reference-style links, making Markdown files more maintainable and readable. This adds a new reflinks command to the CLI that can process single files or entire directories.

Key Changes

  • Add new ReflinkConverter class in utils/reference_links.py
  • Add new CLI command reflinks for converting markdown links

New Features

  • Convert inline Markdown links to reference-style links
  • Handle both regular links and image links
  • Generate unique reference IDs automatically
  • Preserve original content structure
  • Option to modify files in place or save to new location

Usage Examples

# Convert links in a file (modifies in place)
splitme-ai --reflinks.input README.md

# Convert links and save to a new file
splitme-ai --reflinks.i README.md --reflinks.o README-with-refs.md

@eli64s eli64s added the enhancement New feature or request label Jan 8, 2025
@codecov-commenter
Copy link

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@eli64s eli64s merged commit 6221bfa into main Jan 8, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants