zpaper-draft

Type to search...

to open search from anywhere

l-linkify

Find linkable keywords in an article and attach external links. Use when: (1) User wants to add links to an article, (2) User says 'linkify', 'find links', 'add links to article', (3) After writing or...

Linkify Workflow

Find linkable keywords in the latest article, search for their URLs, and apply the links.

Arguments

  • --auto: Skip user confirmation and automatically apply all 1st candidates. 2nd candidates are skipped entirely.

Steps

1. Identify the target article

Determine which article to process:

  • Check git diff --name-only for uncommitted changes in blog/src/articles/ or doc/docs/articles/
  • Check git log --oneline -10 --diff-filter=AM -- blog/src/articles/ doc/docs/articles/ for recently added or modified articles
  • If the user specified an article, use that
  • If multiple candidates exist or the target is unclear, ask the user

Read the full content of the target article.

Analyze the article content and identify keywords/terms that would benefit from external links. Skip terms that are already linked in the article.

Present candidates in two groups:

1st candidates (natural to link - well-known tools, libraries, frameworks, APIs, services directly discussed in the article):

  • e.g., framework names, library names, specific API references, tools mentioned by name

2nd candidates (optional - general concepts, companies, standards that readers likely already know):

  • e.g., well-known companies, common programming concepts, broadly known services

For each candidate, briefly note what it is (e.g., “official site”, “GitHub repo”, “API docs”).

3. Ask the user (or auto-apply)

If --auto was passed: Skip this step. Proceed directly to step 4 with all 1st candidates approved. Do not present 2nd candidates at all.

Otherwise: Present both groups and ask the user which keywords to link. Wait for the user’s reply before proceeding.

Use WebSearch to find the official/canonical URL for each approved keyword. Prefer:

  • Official project websites over Wikipedia
  • GitHub repos for libraries/packages
  • Official API documentation pages for API references
  • npm/PyPI pages only if no official site exists

After finding all URLs, immediately apply markdown links to the first occurrence of each keyword in the article without asking for confirmation. Use standard markdown link syntax: [keyword](url).

  • Only link the first occurrence of each keyword
  • For inline code keywords like `globalShortcut`, use [`globalShortcut`](url)
  • Do not modify code blocks or frontmatter

After applying, briefly report which links were added (keyword → URL).