![]() My first solution was very primitive but it worked. The numbers of letters in the sentence included the commas, dashes, colons and semi-colons.When I split the paragraphs into sentences, I had removed all of the full stops. Once the sentences have been returned, I join them all together to make each of the paragraphs.Īt this point, I realised that there were a few problems in my code. I took the exact colours from the Hemingway app. The CSS file is really simple it just has each of the classes (adverb, passive, hardSentence) and sets their background colour. This is how I’m going to define the highlighting. I used template strings again but include a class in the span tags. This code says that if a sentence is longer than 14 words and has a level of 10 to 14 then its hard, if its longer than 14 words and has a level of 14 or up then its very hard. The start of the file contained immediately invoked function expressions. I started to look through the file for anything that I could make sense of. This changes a 3-line file into a 4859-line file with everything formatted nicely. To solve this, I copied the file into VS Code and formatted the document ( Control+ Shift + I for VS Code). This code is in a minified form, which is a pain to read and understand. Minified file on the top, Formatted file on the bottom. There, I found the file I was looking for: hemingwa圓-web.js. Opening developer tools in Chrome ( Control + Shift + I or F12 on Windows/Linux, Command + Option + I on Mac) and navigating to Sources provided the answers. ![]() It could have sent the text to a server to calculate the complexity of the writing, but I expected it to be calculated client side. I had no idea how the app worked when I first started. So I needed to find out how Hemingway worked! A screenshot of the Hemingway Editor Getting the Logic I came up with the idea of integrating a Hemingway style editor into a markdown editor. At the same time I’ve been trying to find ideas for small projects. I’ve been using the Hemingway App to try to improve my posts.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |