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

Added TAG_SEPARATOR_PATTERN option for splitting tags #911

Merged
merged 3 commits into from
Jan 11, 2022
Merged

Added TAG_SEPARATOR_PATTERN option for splitting tags #911

merged 3 commits into from
Jan 11, 2022

Conversation

hannah98
Copy link
Contributor

@hannah98 hannah98 commented Dec 30, 2021

Summary

This PR adds the TAG_SEPARATOR_PATTERN option. This option is a regex character class that will be used when splitting the tag string.
It defaults to [,] which will split tags on commas. Splitting tags is currently done on commas so this will be backwards compatible and should not introduce breaking changes.

Some Examples:

  • Splitting on spaces: TAG_SEPARATOR_PATTERN="[ ]"
  • Splitting on spaces and commas: TAG_SEPARATOR_PATTERN="[ ,]"
  • Splitting on spaces, commas, and semicolons: TAG_SEPARATOR_PATTERN="[ ,;]"

  • All previously passing tests still pass.
  • I can give the Wiki text so that the Wiki page for the configuration can be updated with this new option.

Related issues

#725

Changes these areas

  • Bugfixes
  • Feature behavior
  • Command line interface
  • Configuration options
  • Internal architecture
  • Snapshot data layout on disk

@pirate
Copy link
Member

pirate commented Jan 6, 2022

This looks awesome, thanks for working on it!

One small note: If it's a REGEX we should probably change the name from TAG_SEPARATORS which implies list (usually a CSV/JSON string in configs), to something like TAG_SEPARATOR_PATTERN which implies a REGEX.

@hannah98 hannah98 changed the title Added TAG_SEPARATORS option for splitting tags Added TAG_SEPARATOR_PATTERN option for splitting tags Jan 6, 2022
@hannah98
Copy link
Contributor Author

hannah98 commented Jan 6, 2022

Understood. I have updated the code to rename TAG_SEPARATORS to TAG_SEPARATOR_PATTERN.

@pirate pirate merged commit 663918a into ArchiveBox:dev Jan 11, 2022
@rmohns
Copy link

rmohns commented Jul 15, 2023

Wiki does not appear to have been updated with instructions on how to use this. @hannah98 or @pirate ?

@pirate
Copy link
Member

pirate commented Aug 4, 2023

Oops You're right I haven't updated it yet, the configuration page is a bit behind. It used to be publicly editable but some people abused it by adding virus links all over, so I had to lock it down. Unfortunately I don't know if there's a way to accept PRs for the wiki?

If anyone wants to contribute to wiki, I can just copy paste suggestions in from comments here and commit them myself.

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.

3 participants