Apply sentence case while typing in markdown files
-
I recently have been using Notepad++ for writing markdown (.md) files. I was wondering if there are plugins/workarounds that can automatically apply sentence case while typing? For example, automatically change the first letter right after a period/question mark/exclamation mark, etc to upper case, also capitalize the single letter “i” automatically?
-
Sorry, I don’t know of any sentence-casing plugins.
-
you maybe want to run a mistake correction after finishing writing . there lately was this thread https://community.notepad-plus-plus.org/topic/20502/help-coding-text-errors where someone wanted some regex-searches/replaces for his needs .
-
Just so you know, you were right to assume it would require a plugin to be able to do it. As was explained in the thread that @carypt linked, to do full grammar checking – whether live while writing, as you requested, or after-the-fact as was requested in the other conversation – requires a huge amount of programming. @carypt seems to believe that a series of search-and-replace can sufficiently replicate the power of true grammar-checking software, as evidenced by his regex solution there and suggestion that you try something similar here. I strongly but respectfully disagree. I am reasonably certain that members in this forum could come up with an exception for a grammatically correct construct which would break any regular-expression “solution” to the problem.
Unless you have very simple sentence structure, I do not recommend trying to solve this problem with after-the-fact regex solutions.
–
Peter (who wishes he knew of an open-source grammar-checking library, and had the time and skills to write the plugin to interface with it; unfortunately, none of those conditions is true) -
@PeterJones said in Apply sentence case while typing in markdown files:
Peter (who wishes he knew of an open-source grammar-checking library, and had the time and skills to write the plugin to interface with it; unfortunately, none of those conditions is true)
Eko, who wished that this could be easily negated!!! :-D
-
@Ekopalypse said in Apply sentence case while typing in markdown files:
wished that this could be easily negated
:-)
I did a quick search for open source grammar checkers. This site has an API, so that’s promising.
https://languagetool.org/proofreading-apiedit: oh, the API costs money. Another article I found said that they have open-source Java software that you can download, so I thought the API was referring to that. I was wrong /edit
I still haven’t solved the other fundamental problems. ;-)
-
@carypt my try for case correction searches for the string .(dot)_(space)1word-character -> search :
(\.)(\s)(\w)
and replace with :$1$2\U$3
. this does not consider a new line - new sentence scenario . what it does : the arguments in brackets are replaced by backreferences $ . https://www.regular-expressions.info/refreplacecase.html . maybe try the mark-function in search first .
maybe not correct , use with care -
@carypt some characters have to be “escaped” by
\
because of restrictions/construction of regex-engine -
@PeterJones said in Apply sentence case while typing in markdown files:
Still very interesting, I didn’t know that even existed.
Arouses my curiosity.
Thx for sharing. -
There also seems to be free stuff here.
https://languagetoolplus.com/http-api/#/default