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

Idea: Add a popular or likely config option to tune auto-detect #2194

Closed
joshgoebel opened this issue Oct 13, 2019 · 2 comments
Closed

Idea: Add a popular or likely config option to tune auto-detect #2194

joshgoebel opened this issue Oct 13, 2019 · 2 comments
Labels
enhancement An enhancement or new feature plugin Specific plugin or plugin discussion

Comments

@joshgoebel
Copy link
Member

joshgoebel commented Oct 13, 2019

What if someone could configure their Highlight.js as to which languages were "more likely"... so you could tell it that 10-20 languages (or even 1-2) were likely or popular while you supported highlighting for additional ones.

Languages that were likely would get say a auto-detect boost over "non-likely" languages... so if you mostly blog about Ruby but you're always getting flagged as Elixir you could just say that Ruby was likely and boom, problem solved.

This is kind of an extension of "ignore for autodetect' which I think we already have?

@joshgoebel joshgoebel added the enhancement An enhancement or new feature label Oct 13, 2019
@joshgoebel
Copy link
Member Author

My other thought was a callback to allow users to build this type of thing themselves... so you could specify a callback and when auto-identifying if a match was "close enough" it would call your custom function with the raw data and let it decide which was which.

@joshgoebel joshgoebel changed the title Thoughts: Add a popular or likely config option to tune auto-detect Idea: Add a popular or likely config option to tune auto-detect Oct 25, 2019
@joshgoebel joshgoebel added the plugin Specific plugin or plugin discussion label Oct 26, 2019
@joshgoebel
Copy link
Member Author

Closing this as it got no discussion and it would be hard to decide this globally in any case. Still a reasonable plug-in perhaps.

Also, if a given language was truly obscure I think we should just consider turning off auto-detect for it entirely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature plugin Specific plugin or plugin discussion
Projects
None yet
Development

No branches or pull requests

1 participant