Skip to content

Hashtag Index: /tags and /tag <name>#20

Closed
cristoforows wants to merge 1 commit into
mainfrom
wesley/hashtag-index
Closed

Hashtag Index: /tags and /tag <name>#20
cristoforows wants to merge 1 commit into
mainfrom
wesley/hashtag-index

Conversation

@cristoforows

Copy link
Copy Markdown
Owner

Closes #15.

What

Surfaces the #hashtags already present in captured notes — zero extra capture effort.

  • /tags — list every hashtag with how many notes use it (most-used first).
  • /tag <name> — list the dated notes carrying #<name>.

How

  • tags.py (new): pure extract_tags (distinct, lowercased, must contain a letter so #123 is ignored; # mid-word ignored), count_tags (per-note), parse_blocks. Both commands scan the most recent _MAX_FILES (90) daily files via a shared _scan generator and a shared _prepare auth/folder gate.
  • drive_handler.py: adds list_markdown_files and read_file (read-only).
  • bot.py: registers /tags + /tag, adds to help/start text.

Test

  • tests/test_tags.py: extraction (case/distinct/mid-word/numbers-only), per-note counting, block parsing. Full suite green (18 passed).

New tags.py (auth-gated). /tags lists every hashtag found in captured
notes with a per-note count; /tag <name> lists the dated notes carrying
that tag. Reuses drive_handler.list_markdown_files/read_file. Tag
extraction/counting are pure functions. Closes #15.
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.

Hashtag Index: /tags and /tag <name>

1 participant