-
Notifications
You must be signed in to change notification settings - Fork 393
draft create
detects Ruby on Rails repo as being Markdown
#591
Comments
draft create
detects Ruby on Rails repo as being Markdown
While you can't share the source, you can inspect how
linguist (a Go port of github/linguist, the system internal to Draft for language detection) works by using a Naive Bayesian Classifier that is trained using "lazy consensus" based on the bytes of code in each programming language, and it doesn't consider the file extension for weighing. I know there was a proposal out there to perform weighted searches based on the file type in github-linguist/linguist#2195, but it was closed due to inactivity. That being said, that doesn't mean we can't train our own Naive Bayesian Classifier to do weighted searches! In the meantime, certain directories are ignored by default as "documentation". For example: Once you identify which directory (or files) are being detected as Markdown (likely a subdirectory containing documentation), you can add them to the ignore list as the troubleshooting docs recommends. After that, your app will be properly detected as Ruby. Let me know if that helps! |
It would be helpful to know what the name of the directories containing markdown are called! That way perhaps we can submit a PR to github/linguist to add those to the default ignore list. |
Ah, this is the problem then:
Turns out that I had an strace log file in the directory. It got read as Markdown, and because it's so large (60 megabytes), it dominated the results. So perhaps one of these:
|
sounds good! once we implement #593 this should be a relatively simple fix. |
I can't share the repo, but it is a totally standard repo - Gemfile, Rakefile, lots of .rb, etc. Most of the individual files were reported as being SCSS, Haml, or Ruby - but the primary detection ended up as Markdown, somehow? It still worked, but it's not a great first time experience IMO
The text was updated successfully, but these errors were encountered: