Skip to content

transform links in your markdown in to [title](link)

Notifications You must be signed in to change notification settings

thinkwee/link2title

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Link2Title

This project is a Python script that processes Markdown files, automatically replacing plain URLs with titled links. It fetches the content of each URL, generates a descriptive title using a Language Model (LLM), and updates the Markdown file with the new, more informative links.

Features

  • Asynchronous processing of URLs for improved performance
  • Supports multiple backend LLM providers
  • Uses Jina AI's content extraction service for reliable web scraping
  • Implements retry logic and rate limiting to handle network issues

Requirements

  • Python 3.7+
  • Required Python packages (see requirements.txt)

Configuration

Edit the config.yaml file to set your preferred LLM backend provider and any necessary API keys.

Usage

  1. Configure your preferred LLM backend and API key in the config.yaml file.

  2. Run the script with the input Markdown file as an argument:

python3 run.py input_file.md

The processed file will be saved as output.md in the same directory.

Example

Just try it on this README.md, say running

python3 run.py README.md

See what happens.to following links

After running run.py on this README, these links would be transformed into more informative, titled links. The output might look like this:

Supported LLM Backends

  • OpenAI (GPT3/4)
  • Ollama
  • DeepSeek
  • Qwen
  • ERNIE
  • GLM
  • Spark
  • HunYuan

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

About

transform links in your markdown in to [title](link)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages