Giter Club home page Giter Club logo

Comments (6)

chrisgrieser avatar chrisgrieser commented on May 23, 2024

I agree. Trying to come up with a more generalized solution would also be more language-independent. The short words to ignore, for example, are all in English right now. However, I would define the "exception rules" a bit differently.

I imagine for some users, the rule titlecase rule also has the side benefit of automatically fixing typos like # FOobar as well. Stipulating that the titlecase rule should only apply to lowercase words would remove with this welcome side effect.

Here is what I would suggest as sensitive title-case-exception-rules

  1. all words with 3 or less characters are lowercased (except when at the beginning)
  2. all words with 4 or more characters that are combinations of two words from 1) are also lowercased (except when at the beginning). This ensures words like "into" stay lowercase for consistency.
  3. all words that are completely uppercased will stay so to ensure, as it is assumed that they are acronyms.

This leaves some edge cases (e.g. "with") and words with special casing (e.g. "iPhone"). The number of those cases should however be quite small, so it could make sense to keep a list of such words, like the titlecase rule does right now.

from obsidian-linter.

platers avatar platers commented on May 23, 2024

I think English is too complicated to handle all the edge cases. Your logic would skip words like cat, and there are countless other cases.

I found this popular implementation which looks good to me.

Running Linter should never make your document worse, since its run so often.

from obsidian-linter.

chrisgrieser avatar chrisgrieser commented on May 23, 2024

You are right, I always forget how many short words English has. However, this leaves the problem how to titlecase correctly in languages other than English. Is there maybe some solution like "change-case" available that also works on most common languages?

from obsidian-linter.

platers avatar platers commented on May 23, 2024

Not afaik. Maybe implementing a way to turn off rules in a file would alleviate this issue. #46

from obsidian-linter.

trungng2006 avatar trungng2006 commented on May 23, 2024

I also ran into this problem.
I think there are 2 ways to resolve this, the plugin can let the user create a list of word that:

  1. ignore the heading titleCase
    OR
  2. Alway use AllCaps (I would prefer this option, since the plugin can also apply linting while saving)

Cause the people who wrote their note know the acronym they want to use. I think letting the user define their own list can resolve most of the edge case.

from obsidian-linter.

platers avatar platers commented on May 23, 2024

closing because the new option to ignore already cased words should give enough flexibility to users

from obsidian-linter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.