Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 07-28-2018, 06:05 AM   #1
Doitsu
Wizard
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 4,795
Karma: 16157045
Join Date: Dec 2010
Device: Kindle PW2
[Plugin] Proselint - English style checker

Released: October 5, 2019
Current Version: "0.1.1"

This plugin is a simple proselint-based style checker.

System requirements:

This plugin requires Sigil 0.9.5 or higher.

Installation:

1. Select Manage Plugins from the Plugins menu and select Use Bundled Python, if it isn't already selected.

2. Click Add Plugin and select Proselint_v0.1.1.zip. This will install the Proselint plugin, which you can select via Plugins > Valdidation > Proselint.

Settings:

You can disable Proselint checks by editing .proselintrc, which is located in the proselint subfolder.

If you have a Windows machine, you can use the following commands to display the proselint plugin subfolder:
  1. Press Windows+R (Run).
  2. Copy and paste %USERPROFILE%\AppData\Local\sigil-ebook\sigil\plugins\Proselint\proselint and press Enter.

For example, if you don't want Proselint to complain about 'very,' change the following entry from:

Code:
        "weasel_words.very"             : true
to

Code:
        "weasel_words.very"             : false
License: GNU General Public License v3 (GPL-3)
Attached Files
File Type: zip Proselint_v0.1.1.zip (110.8 KB, 43 views)

Last edited by Doitsu; 10-05-2019 at 01:23 PM. Reason: Attached new version with minor updates
Doitsu is offline   Reply With Quote
Old 09-19-2019, 10:02 PM   #2
BetterRed
null operator
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 15,464
Karma: 16370000
Join Date: Mar 2012
Location: Sydney Australia
Device: none
How can I add or remove an individual item - I tried editing a misc.py file by commenting out an entry and adding an additional one, they didn't seem to have any effect. The first continued to be reported, the second one wasn't reported.

BR
BetterRed is offline   Reply With Quote
Advert
Old 09-20-2019, 02:09 AM   #3
Doitsu
Wizard
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 4,795
Karma: 16157045
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by BetterRed View Post
How can I add or remove an individual item - I tried editing a misc.py file by commenting out an entry and adding an additional one, they didn't seem to have any effect.
Please be more specific. Which of the python files in the misc folder did you edit and what did you change?
Doitsu is offline   Reply With Quote
Old 09-20-2019, 03:09 AM   #4
BetterRed
null operator
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 15,464
Karma: 16370000
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by Doitsu View Post
Please be more specific. Which of the python files in the misc folder did you edit and what did you change?
I have SIGIL_PREFS_DIR=C:\_AppData\Sigil\Prefs

So this one C:\_AppData\Sigil\Prefs\plugins\Proselint\proselin t\checks\archaism\misc.py as a simple test - begat was reported, woke wasn't.

Spoiler:
# -*- coding: utf-8 -*-
"""Archaism.

---
layout: post
source: Garner's Modern American Usage
source_url: http://bit.ly/1T4alrY
title: archaism
date: 2014-06-10 12:31:19
categories: writing
---

Archaism.

"""
from proselint.tools import existence_check, memoize


@memoize
def check(text):
"""Check the text."""
err = "archaism.misc"
msg = u"'{}' is archaic."

archaisms = [
"alack",
"anent",
# "anon",
#"begat",
"belike",
"betimes",
"boughten",
"brocage",
"brokage",
"camarade",
"chiefer",
"chiefest",
"Christiana",
"completely obsolescent",
"cozen",
"divers",
"deflexion",
"durst",
"fain",
"forsooth",
"foreclose from",
"haply",
"howbeit",
"illumine",
"in sooth",
"maugre",
"meseems",
"methinks",
"nigh",
"peradventure",
"perchance",
"saith",
"shew",
"sistren",
"spake",
"to wit",
"verily",
"whilom",
"withal",
"woke",
"wot",
"enclosed please find",
"please find enclosed",
"enclosed herewith",
"enclosed herein",
"inforce",
"ex postfacto",
"foreclose from",
"forewent",
"for ever",
# "designer", when used to mean a plotter against Christ
# "demean", when used to mean "to behave" in legal contexts
# "by the bye", # variant, modern is "by the by"
# "comptroller" # in British English
# "abortive" Abortive is archaic in reference to abortions of fetuses,
# except in the sense “causing an abortion.”
]

return existence_check(text, archaisms, err, msg, join=True)

Last edited by BetterRed; 09-20-2019 at 03:12 AM.
BetterRed is offline   Reply With Quote
Old 09-20-2019, 04:03 AM   #5
Doitsu
Wizard
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 4,795
Karma: 16157045
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by BetterRed View Post
How can I add or remove an individual item[...]
Since Proselint apparently caches rule files in:

C:\Users\<your user name>\.cache\proselint


you'll have to delete the cache folder after rule file updates.
Doitsu is offline   Reply With Quote
Advert
Old 09-20-2019, 04:41 AM   #6
BetterRed
null operator
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 15,464
Karma: 16370000
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by Doitsu View Post
Since Proselint apparently caches rule files in:

C:\Users\<your user name>\.cache\proselint


you'll have to delete the cache folder after rule file updates.
Thanks - I'll give it a whirl tomorrow.

BR
BetterRed is offline   Reply With Quote
Old 09-20-2019, 10:19 PM   #7
BetterRed
null operator
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 15,464
Karma: 16370000
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Deleting the cache did the trick.

Is there a syntax spec for the rules in the misc.py files. Nothing leapt out at me at GitHub. I know it's python but... the rules themselves are collections of data.

BR
BetterRed is offline   Reply With Quote
Old 09-21-2019, 05:08 AM   #8
Doitsu
Wizard
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 4,795
Karma: 16157045
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by BetterRed View Post
Is there a syntax spec for the rules in the misc.py files. Nothing leapt out at me at GitHub. I know it's python but... the rules themselves are collections of data.
I haven't found rule specs either. You might want to ask the author about it.
Doitsu is offline   Reply With Quote
Old 09-21-2019, 07:22 AM   #9
BetterRed
null operator
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 15,464
Karma: 16370000
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by Doitsu View Post
I haven't found rule specs either. You might want to ask the author about it.
I'll keep that until I really need it,

Couple of suggestions/requests

would an option to check multiple/all files be possible, checking file by file doesn't make much sense to me.

when an error flags a specific word or or phrase, would it be possible to select/highlight the word/phrase in the code - like the spell checker does, currently the insertion point is positioned to the beginning of the error, which is hard to see, I have to use ctrl+shift+→ to highlight what follows.

BR

Last edited by BetterRed; 09-21-2019 at 07:30 AM.
BetterRed is offline   Reply With Quote
Old 09-21-2019, 07:37 AM   #10
Doitsu
Wizard
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 4,795
Karma: 16157045
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by BetterRed View Post
would an option to check multiple/all files be possible, checking file by file doesn't make much sense to me.
If you want the plugin to check all files, simply click the Text folder before running the plugin.

Quote:
Originally Posted by BetterRed View Post
when an error flags a specific word or or phrase, would it be possible to select/highlight the word/phrase in the code - like the spell checker does, currently the insertion point is positioned to the beginning of the error, which is hard to see, I have to use ctrl+shift+→ to highlight what follows.
Unfortunately, the Sigil API doesn't have any functions for text highlighting.
Doitsu is offline   Reply With Quote
Old 09-21-2019, 09:29 AM   #11
KevinH
Wizard
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 4,160
Karma: 2620702
Join Date: Nov 2009
Device: many
That is correct. Sigil plugin is a file level api. A validation plugin should be able to move you to the exact file offset start of the error.

If this is done via a edit plugin, you can of course add a highlight css class and wrap a span around anything to highlight its contents to the user.

Kevin
KevinH is offline   Reply With Quote
Old 09-21-2019, 09:49 AM   #12
Doitsu
Wizard
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 4,795
Karma: 16157045
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by KevinH View Post
That is correct. Sigil plugin is a file level api. A validation plugin should be able to move you to the exact file offset start of the error.
FYI: the Proselint plugin is a validation plugin, and clicking a message will move the cursor to the beginning of the word or phrase that was flagged.
Doitsu is offline   Reply With Quote
Old 09-21-2019, 06:03 PM   #13
BetterRed
null operator
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 15,464
Karma: 16370000
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by Doitsu View Post
If you want the plugin to check all files, simply click the Text folder before running the plugin.
doh

Quote:
Originally Posted by Doitsu View Post
Unfortunately, the Sigil API doesn't have any functions for text highlighting.
Quote:
Originally Posted by KevinH View Post
That is correct. Sigil plugin is a file level api. A validation plugin should be able to move you to the exact file offset start of the error.
Quote:
Originally Posted by Doitsu View Post
FYI: the Proselint plugin is a validation plugin, and clicking a message will move the cursor to the beginning of the word or phrase that was flagged.
My difficulty is finding the insertion cursor. No worries, tapping ctrl+shift+→ to highlight the errant text is second nature to me. Or I could get a thicker caret

BR
BetterRed is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] English Noun Frequency DaltonST Plugins 25 12-28-2019 02:22 PM
[Plugin] ACE - DAISY EPUB Accessibility Checker wrapper Doitsu Plugins 19 09-12-2019 03:59 PM
Dictionary plugin in Sigil? For example Oxford-English Dictionary. Rindr Plugins 2 03-04-2018 12:11 PM
URL Checker plugin Doitsu Plugins 17 11-19-2017 10:39 AM


All times are GMT -4. The time now is 07:33 AM.


MobileRead.com is a privately owned, operated and funded community.