Offline, privacy-first grammar checker. Fast, open-source, Rust-powered
Revert "feat: attempt doing things manually"
Elijah Potter402294858333
diff --git a/packages/web/package.json b/packages/web/package.jsonindex adcc581dc..e390e915f 100644--- a/packages/web/package.json+++ b/packages/web/package.json@@ -20,7 +20,6 @@"autoprefixer": "^10.4.16","flowbite": "^1.8.1","flowbite-svelte": "^0.44.18",- "mdsvex": "^0.12.3","postcss": "^8.4.31","svelte": "^4.2.19","svelte-check": "^3.4.3",@@ -33,10 +32,9 @@},"type": "module","dependencies": {- "harper.js": "link:../harper.js",- "highlight.js": "^11.11.0","lodash-es": "^4.17.21","reveal.js": "^5.1.0",- "svelte-intersection-observer": "^1.0.0"+ "svelte-intersection-observer": "^1.0.0",+ "harper.js": "link:../harper.js"}}diff --git a/packages/web/src/app.css b/packages/web/src/app.cssindex ff06cfce2..dd22ccb17 100644--- a/packages/web/src/app.css+++ b/packages/web/src/app.css@@ -4,24 +4,20 @@@layer base {h1 {- @apply text-5xl pt-4;+ @apply text-5xl;}h2 {- @apply text-3xl sm:text-3xl lg:text-4xl pt-4;+ @apply text-3xl sm:text-3xl lg:text-4xl;}p {- @apply lg:text-base md:text-xl xl:text-xl pt-4;+ @apply lg:text-base md:text-xl xl:text-xl;}* {@apply dark:text-white;}-- a {- @apply underline;- }}* {@@ -72,7 +68,3 @@ textarea {animation-timing-function: cubic-bezier(0, 0, 0.2, 1);}}--html {- height: 100%;-}diff --git a/packages/web/src/app.html b/packages/web/src/app.htmlindex dcfc3bd58..29a96bd1c 100644--- a/packages/web/src/app.html+++ b/packages/web/src/app.html@@ -1,23 +1,25 @@<!doctype html><html lang="en">+ <head>+ <meta charset="utf-8" />+ <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />+ <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />+ <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />+ <link rel="manifest" href="/site.webmanifest" />+ <link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5" />+ <meta name="msapplication-TileColor" content="#da532c" />+ <meta name="theme-color" content="#ffffff" />+ <meta name="viewport" content="width=device-width, initial-scale=1" />+ <title>Write With Harper</title>+ %sveltekit.head%+ <script+ data-goatcounter="https://harper.goatcounter.com/count"+ async+ src="//gc.zgo.at/count.js"+ ></script>+ </head>-<head>- <meta charset="utf-8" />- <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />- <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />- <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />- <link rel="manifest" href="/site.webmanifest" />- <link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5" />- <meta name="msapplication-TileColor" content="#da532c" />- <meta name="theme-color" content="#ffffff" />- <meta name="viewport" content="width=device-width, initial-scale=1" />- <title>Write With Harper</title>- %sveltekit.head%- <script data-goatcounter="https://harper.goatcounter.com/count" async src="//gc.zgo.at/count.js"></script>-</head>--<body data-sveltekit-preload-data="hover" class="m-0 p-0 w-full h-full dark:bg-gray-800">- <div style="display: contents" class="m-0 p-0 h-full">%sveltekit.body%</div>-</body>-+ <body data-sveltekit-preload-data="hover" class="m-0 p-0 w-full h-full dark:bg-gray-800">+ <div style="display: contents" class="m-0 p-0">%sveltekit.body%</div>+ </body></html>diff --git a/packages/web/src/lib/GutterCenter.svelte b/packages/web/src/lib/GutterCenter.svelteindex eb3eb7ea5..30c786a4e 100644--- a/packages/web/src/lib/GutterCenter.svelte+++ b/packages/web/src/lib/GutterCenter.svelte@@ -1,5 +1,5 @@-<div class="flex flex-row justify-center h-full">- <div class="lg:w-[1024px] w-full h-full">+<div class="flex flex-row justify-center">+ <div class="lg:w-[1024px] w-full"><slot /></div></div>diff --git a/packages/web/src/lib/NavCol.svelte b/packages/web/src/lib/NavCol.sveltedeleted file mode 100644index 1a67a481a..000000000--- a/packages/web/src/lib/NavCol.svelte+++ /dev/null@@ -1,23 +0,0 @@-<script lang="ts">- import { page } from '$app/stores';-- export let pages: Record<string, string> = {};-- function leaf(url: string): string {- return url.split('/').pop() || '/';- }-- $: currentPage = leaf($page.url.pathname);-</script>--<div class="w-48 m-2 p-2 border-black dark:border-white border-t-2 border-l-2 h-full">- {#each Object.entries(pages) as [href, title]}- <a {href}>- <div- class={`transition-all hover:translate-x-2 ${currentPage == leaf(href) ? 'translate-x-1 font-bold' : ''}`}- >- {title}- </div></a- >- {/each}-</div>diff --git a/packages/web/src/routes/+layout.svelte b/packages/web/src/routes/+layout.svelteindex c0d7af565..784bf1955 100644--- a/packages/web/src/routes/+layout.svelte+++ b/packages/web/src/routes/+layout.svelte@@ -12,29 +12,19 @@href="https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:ital,wght@0,400;0,700;1,400;1,700&display=swap"rel="stylesheet"/>+<div class="h-16" />+<div class="absolute top-8 right-8"><DarkMode /></div>-<link- href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap"- rel="stylesheet"-/>--<div class="flex flex-col h-full">- <div class="basis-16 flex-none" />- <div class="absolute top-8 right-8"><DarkMode /></div>-- <div class="flex-1">- <GutterCenter>- <slot />- </GutterCenter>- </div>+<GutterCenter>+ <slot />+</GutterCenter>- <div class="w-full flex flex-row justify-center">- <a href="https://automattic.com/">- <div class="flex items-center">- An- <div class="inline-block"><AutomatticLogo height="32px" width="140px" /></div>- {displayName}- </div>- </a>- </div>+<div class="w-full flex flex-row justify-center">+ <a href="https://automattic.com/">+ <div class="flex items-center">+ An+ <div class="inline-block"><AutomatticLogo height="32px" width="140px" /></div>+ {displayName}+ </div>+ </a></div>diff --git a/packages/web/src/routes/+page.svelte b/packages/web/src/routes/+page.svelteindex ab70984e7..bd01a4c75 100644--- a/packages/web/src/routes/+page.svelte+++ b/packages/web/src/routes/+page.svelte@@ -5,6 +5,7 @@import Section from '$lib/Section.svelte';import Logo from '$lib/Logo.svelte';import GitHubLogo from '$lib/GitHubLogo.svelte';+ import { DarkMode } from 'flowbite-svelte';import ObsidianLogo from '$lib/ObsidianLogo.svelte';let width = window.innerWidth;@@ -16,6 +17,9 @@$: mobile = width < 640;</script>+<div class="h-16" />+<div class="absolute top-8 right-8"><DarkMode /></div>+<div class="w-full flex flex-col items-center"><Logo width="200px" /></div>@@ -78,15 +82,18 @@<span slot="title">Native Everywhere</span><span slot="subtitle">Harper is both available as a <a+ class="underline"href="https://github.com/automattic/harper/tree/master/harper-ls">language server</a>, and through WebAssembly, so you can get fantastic grammar checking anywhere you work.<br /><br /> That said, we take extra care to make sure the- <a href="https://marketplace.visualstudio.com/items?itemName=elijah-potter.harper"+ <a+ class="underline"+ href="https://marketplace.visualstudio.com/items?itemName=elijah-potter.harper">Visual Studio Code</a>, Neovim,- <a href="https://github.com/Stef16Robbe/harper_zed">Zed</a>+ <a class="underline" href="https://github.com/Stef16Robbe/harper_zed">Zed</a>and- <a href="/obsidian">Obsidian</a> integration is amazing.+ <a class="underline" href="/obsidian">Obsidian</a> integration is amazing.</span><img@@ -112,6 +119,6 @@<span slot="title">Open Source</span><span slot="subtitle">Harper is completely open source under the Apache-2.0 license. <br /><br /> Come pay us a visit- on <a href="https://github.com/automattic/harper">GitHub.</a>+ on <a class="underline" href="https://github.com/automattic/harper">GitHub.</a></span></Section>diff --git a/packages/web/src/routes/docs/+layout.svelte b/packages/web/src/routes/docs/+layout.sveltedeleted file mode 100644index 104638f00..000000000--- a/packages/web/src/routes/docs/+layout.svelte+++ /dev/null@@ -1,18 +0,0 @@-<script lang="ts">- import NavCol from '$lib/NavCol.svelte';- import 'highlight.js/styles/github.min.css';-- let pages = {- './about': 'What Is Harper?',- './test2': 'Test2',- './integrations': 'Integrations'- };-</script>--<div class="flex flex-row h-full">- <NavCol {pages} />-- <div class="p-4">- <slot />- </div>-</div>diff --git a/packages/web/src/routes/docs/about/+page.md b/packages/web/src/routes/docs/about/+page.mddeleted file mode 100644index 8b4562c5e..000000000--- a/packages/web/src/routes/docs/about/+page.md+++ /dev/null@@ -1,29 +0,0 @@-----title: What Is Harper?------# {title}--Harper is a grammar checker designed to run anywhere there's text (so really, anywhere).-Most Harper users are catching their mistakes in Neovim, [Obsidian](/obsidian), or Visual Studio Code.--<script>- import Editor from "$lib/Editor.svelte"-</script>---<div class="h-96 w-96">- <Editor content={`You can try out a editor that uses\nHarper under-the-hood here.\n\nIt is rnning in your browser right now. \n\nNo server required!`}/>-</div>---## How Does It Work?--Harper takes advantage of decades of natural language research analyze how exactly how your words come together.-If something is off, Harper lets you know.--In a way, Harper is an error-tolerant parser for English.--## How Can I Start Using Harper?--That depends. If you want to use it to check your work,diff --git a/packages/web/src/routes/docs/integrations/+page.md b/packages/web/src/routes/docs/integrations/+page.mddeleted file mode 100644index 966e8e56e..000000000--- a/packages/web/src/routes/docs/integrations/+page.md+++ /dev/null@@ -1,37 +0,0 @@-----title: Integrations------# {title}--## Obsidian----To add Harper to [Obsidian](/obsidian), just install the community plugin.--More specifically, go to Obsidian's settings and click "Community Plugins."-You may be asked to enable them.--Next, click "Browse" and search for "Harper".-Finally, go back to the Community Plugins page and enable the plugin.-----## Emacs--Our Emacs support is limited and primarily provided by the community.-You can see the longer discussion [here](https://github.com/Automattic/harper/discussions/150).--## Helix--To use Harper in [Helix](https://helix-editor.com/), you'll need to have `harper-ls` installed.--Once you do, add this to you configuration:--```toml-[language-server.harper-ls]-command = "harper-ls"-args = ["--stdio"]-```diff --git a/packages/web/src/routes/docs/test2/+page.md b/packages/web/src/routes/docs/test2/+page.mddeleted file mode 100644index 610cd99bd..000000000--- a/packages/web/src/routes/docs/test2/+page.md+++ /dev/null@@ -1,8 +0,0 @@-----title: This is a second test-description: Just a test------# {title}--diff --git a/packages/web/svelte.config.js b/packages/web/svelte.config.jsindex 572483ace..fd9caae53 100644--- a/packages/web/svelte.config.js+++ b/packages/web/svelte.config.js@@ -1,24 +1,9 @@import adapter from '@sveltejs/adapter-node';import { vitePreprocess } from '@sveltejs/kit/vite';-import { mdsvex, escapeSvelte } from 'mdsvex';-import hljs from 'highlight.js/lib/common';/** @type {import('@sveltejs/kit').Config} */const config = {- extensions: ['.svelte', '.md'],- preprocess: [- vitePreprocess(),- mdsvex({- extensions: ['.md'],- smartypants: true,- highlight: {- highlighter: async (code, language = 'text') => {- const html = escapeSvelte(hljs.highlight(code, { language }).value);- return `{@html \` <code class="p-4 rounded w-full block">${html}</code>\` }`;- }- }- })- ],+ preprocess: vitePreprocess(),kit: {adapter: adapter({diff --git a/packages/yarn.lock b/packages/yarn.lockindex e250cf694..f45da8679 100644--- a/packages/yarn.lock+++ b/packages/yarn.lock@@ -1327,11 +1327,6 @@resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-4.0.5.tgz#cb6e2a691b70cb177c6e3ae9c1d2e8b2ea8cd304"integrity sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==-"@types/unist@^2.0.0", "@types/unist@^2.0.2", "@types/unist@^2.0.3":- version "2.0.11"- resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.11.tgz#11af57b127e32487774841f7a4e54eab166d03c4"- integrity sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==-"@types/vscode@^1.89.0":version "1.91.0"resolved "https://registry.yarnpkg.com/@types/vscode/-/vscode-1.91.0.tgz#badaf9dfca14b08f1ad32fe197558d8d1702c3c9"@@ -3226,11 +3221,6 @@ headers-polyfill@^4.0.2:resolved "https://registry.yarnpkg.com/headers-polyfill/-/headers-polyfill-4.0.3.tgz#922a0155de30ecc1f785bcf04be77844ca95ad07"integrity sha512-IScLbePpkvO846sIwOtOTDjutRMWdXdJmXdMvk6gCBHxFO8d+QKOQedyZSxFTTFYRSmlgSTDtXqqq4pcenBXLQ==-highlight.js@^11.11.0:- version "11.11.0"- resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-11.11.0.tgz#91b15082ca8cdbe22424e0a000449d7d8a5c74c6"- integrity sha512-6ErL7JlGu2CNFHyRQEuDogOyGPNiqcuWdt4iSSFUPyferNTGlNTPFqeV36Y/XwA4V/TJ8l0sxp6FTnxud/mf8g==-hosted-git-info@^4.0.2:version "4.1.0"resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-4.1.0.tgz#827b82867e9ff1c8d0c4d9d53880397d2c86d224"@@ -3795,16 +3785,6 @@ [email protected]:resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.30.tgz#ce4df6f80af6cfbe218ecd5c552ba13c4dfa08cc"integrity sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==-mdsvex@^0.12.3:- version "0.12.3"- resolved "https://registry.yarnpkg.com/mdsvex/-/mdsvex-0.12.3.tgz#859d9a4985659fb4258e9343a859cabdc16ae911"- integrity sha512-C/uIJamjNo5PHHnR3JHqsBPoLcfUBpzRmAEB6FLMXI/s7XHOceswjDMKqSPEW2WHmYpKm0taZ3U20GSyhMridA==- dependencies:- "@types/unist" "^2.0.3"- prism-svelte "^0.4.7"- prismjs "^1.17.1"- vfile-message "^2.0.4"-mdurl@^1.0.1:version "1.0.1"resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e"@@ -4445,16 +4425,6 @@ pretty-format@^27.0.2:ansi-styles "^5.0.0"react-is "^17.0.1"-prism-svelte@^0.4.7:- version "0.4.7"- resolved "https://registry.yarnpkg.com/prism-svelte/-/prism-svelte-0.4.7.tgz#fbc6709450b4e2ed660ddb82c3718817fc584cbe"- integrity sha512-yABh19CYbM24V7aS7TuPYRNMqthxwbvx6FF/Rw920YbyBWO3tnyPIqRMgHuSVsLmuHkkBS1Akyof463FVdkeDQ==--prismjs@^1.17.1:- version "1.29.0"- resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.29.0.tgz#f113555a8fa9b57c35e637bba27509dcf802dd12"- integrity sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==-process-nextick-args@~2.0.0:version "2.0.1"resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2"@@ -5442,13 +5412,6 @@ undici@^6.19.5:resolved "https://registry.yarnpkg.com/undici/-/undici-6.19.8.tgz#002d7c8a28f8cc3a44ff33c3d4be4d85e15d40e1"integrity sha512-U8uCCl2x9TK3WANvmBavymRzxbfFYG+tAu+fgx3zxQy3qdagQqBLwJVrdyO1TBfUXvfKveMKJZhpvUYoOjM+4g==-unist-util-stringify-position@^2.0.0:- version "2.0.3"- resolved "https://registry.yarnpkg.com/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz#cce3bfa1cdf85ba7375d1d5b17bdc4cada9bd9da"- integrity sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==- dependencies:- "@types/unist" "^2.0.2"-universalify@^0.1.0:version "0.1.2"resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66"@@ -5502,14 +5465,6 @@ uuid@^9.0.1:resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.1.tgz#e188d4c8853cc722220392c424cd637f32293f30"integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==-vfile-message@^2.0.4:- version "2.0.4"- resolved "https://registry.yarnpkg.com/vfile-message/-/vfile-message-2.0.4.tgz#5b43b88171d409eae58477d13f23dd41d52c371a"- integrity sha512-DjssxRGkMvifUOJre00juHoP9DPWuzjxKuMDrhNbk2TdaYYBNMStsNhEOt3idrtI12VQYM/1+iM0KOzXi4pxwQ==- dependencies:- "@types/unist" "^2.0.0"- unist-util-stringify-position "^2.0.0"-version "2.1.8"resolved "https://registry.yarnpkg.com/vite-node/-/vite-node-2.1.8.tgz#9495ca17652f6f7f95ca7c4b568a235e0c8dbac5"