errata-ai / vale

:pencil: A markup-aware linter for prose built with speed and extensibility in mind.
https://vale.sh
MIT License
4.3k stars 144 forks source link

Help test Vale's new Chrome extension! #778

Open jdkato opened 4 months ago

jdkato commented 4 months ago

The first release of Vale's new Chrome extension has been published to the Chrome Web Store (it will also soon be available for Firefox, Opera, and Edge).

The extension is currently unlisted and I'm looking for help testing it before going completely public.

Installation

  1. Install the latest version of Vale (v3.1.0).
  2. Run vale host-install chrome from the command-line.
  3. Install the extension from the Chrome Web Store.

Configuration

The extension uses your default .vale.ini file for its configuration. Run vale ls-dirs to see its exact location on your system.

The contents of the active textarea or [contenteditable] are passed as paths taking the form of <domain>.<format> -- for example, github.com.md.

You can set the format for a particular website in the extension's settings (see Usage below).

This allows you to both write configuration targeting specific websites or use the typical [*.ext] sections:

StylesPath = styles
MinAlertLevel = suggestion

[*.md]
# All Markdown files
BasedOnStyles = Vale

[*{github,gitlab}.com.md]
# `github.com` and `gitlab.com`
BasedOnStyles = AnotherStyle

Usage

Screenshot 2024-02-18 at 4 08 04 PM

After editing text in either a textarea or [contenteditable] element, click the extension's icon.

NOTE: The extension requires manual activation (clicking its icon) for two reasons: (1) it only requires the lowest level of permissions (activeTab) and (2) it doesn't compete for UI space with other extensions or built-in website functionality.

Uninstallation

  1. Remove the extension from Chrome.
  2. Run vale host-uninstall chrome from the command line.
theletterf commented 4 months ago

Working beautifully here. Tested on a MediaWiki setup using the latest macos x64 build of Chrome and the latest version of Vale CLI. It'd be great to somehow set the location of the style using a UI in the extension's settings, overriding the default paths—right now that's the biggest hurdle for non-technical users.

aireilly commented 4 months ago

On Fedora, I see this error:

$ vale host-install chrome
 SUCCESS  writing config                                                                            
 SUCCESS  fetching binary                                                                           
installing host [2/3] ████████████████████████████████████████████████  67% | 1sE100 [host-install] Runtime error

E100 [host-install] Runtime error

open /home/aireilly/home/aireilly/.config/google-chrome/NativeMessagingHosts/sh.vale.native.json: no such file or directory

Execution stopped with code 1.

Execution stopped with code 1.
jdkato commented 4 months ago

@aireilly, this should be fixed now. If you're so inclined, you can try building from the v3 branch to confirm.

aireilly commented 4 months ago

vale host-install chrome

Yup worked a treat thanks.

aireilly commented 4 months ago

I'm now here: image

┌───── ~ 
$ vale ls-dirs
Asset       | Default Location                               | Found
StylesPath  | /home/aireilly/.local/share/vale/styles        | ✓
.vale.ini   | /home/aireilly/.config/vale/.vale.ini          | ✓
vale-native | /home/aireilly/.config/vale/native/vale-native | ✓
jdkato commented 4 months ago

Did you set that StylesPath in the .vale.ini?

If you don't set one, it will use the default. Otherwise, you'll need to create it as usual.

aireilly commented 4 months ago

Ah Ok. I didn't have StylesPath = .vale/styles set. I created the folder manually and it works now

aireilly commented 4 months ago

Slightly confused about the global .vale.ini. Should I run vale sync in this folder?

┌───── ~/.config/vale 
$ vale ls-dirs
Asset       | Default Location                               | Found
StylesPath  | /home/aireilly/.local/share/vale/styles        | ✓
.vale.ini   | /home/aireilly/.config/vale/.vale.ini          | ✓
vale-native | /home/aireilly/.config/vale/native/vale-native | ✓

$ cat /home/aireilly/.config/vale/.vale.ini
StylesPath = .vale/styles
MinAlertLevel = suggestion

[*.md]
# All Markdown files
BasedOnStyles = Vale

[*{github,gitlab}.com.md]
# `github.com` and `gitlab.com`
BasedOnStyles = Vale
jdkato commented 4 months ago

It's just a config file that is either used in place of, or in addition to, project-specific ones:

  1. In cases where there's no project-specific configuration, such as the browser, this is the only configuration used.
  2. In cases where there is a project-specific configuration, you can use it to make local overrides. See https://github.com/errata-ai/vale/issues/737 for a description of the idea.

So, you can treat it as you would any other .vale.ini file.

dustinloflandsmith commented 4 months ago

Just gave it a try (latest macos arm64 build) and everything works great 👍

jdkato commented 3 months ago

Working beautifully here. Tested on a MediaWiki setup using the latest macos x64 build of Chrome and the latest version of Vale CLI. It'd be great to somehow set the location of the style using a UI in the extension's settings, overriding the default paths—right now that's the biggest hurdle for non-technical users.

@theletterf, not sure I understand this. Do you mean the location of a .vale.ini file? Or specifically the StylesPath value?

theletterf commented 3 months ago

@jdkato It'd be great if the Vale ini was somehow stored in the extension itself, or could be selected using the system UI. That would spare users from creating the file in the default path.

theletterf commented 2 months ago

Hi there! What's the current status? Can we help with something?

jansol commented 2 months ago

Are the extension sources planned to be on github too?

Looking forward too try this out once Firefox support lands.

jdkato commented 2 months ago

The status hasn't changed much lately. I'll probably work on getting the extension out as-is and then work on adding/improving features in later releases.

theletterf commented 2 months ago

Love the idea. That way, I can get the team at Splunk to test it out.

ChrisChinchilla commented 2 weeks ago

I also took a quick test today, couple of thoughts / questions:

  1. I assume it doesn't work if I use symlinks in the extension's application support folder? Because of all the testing I do, I have quite an esoteric setup for Vale.
  2. To be more useful, it would be good to figure out how to do line decorations inline. I am investigating how to do this via attempting to update the Vale Obsidian extension and some other projects so I may find out how to do this. Other extensions do, so it's possible…
  3. I'd also like to try and make a version for other browsers.
jdkato commented 1 week ago

To be more useful, it would be good to figure out how to do line decorations inline. I am investigating how to do this via attempting to update the Vale Obsidian extension and some other projects so I may find out how to do this. Other extensions do, so it's possible…

This is obviously a matter of taste, but I dislike this functionality. When every writing extension feels the need to inject styling into the page it often means that (1) you can't use them together and (2) it interferes will built-in corrections (such as are present in Gmail, for example). The solution here isn't clear to me, short of making this opt-in.

I'd also like to try and make a version for other browsers.

I have it working in Firefox and Arc locally. I just need to publish to the stores.