diff --git a/.prettierrc.yml b/.prettierrc.yml index 9c369bc8..5a8b2351 100644 --- a/.prettierrc.yml +++ b/.prettierrc.yml @@ -9,3 +9,6 @@ overrides: - files: '*.astro' options: parser: 'astro' + - files: '*.{md,mdx}' + options: + printWidth: 80 diff --git a/docs/src/assets/landing.css b/docs/src/assets/landing.css index 1c143aaf..c7b9cc6f 100644 --- a/docs/src/assets/landing.css +++ b/docs/src/assets/landing.css @@ -9,7 +9,8 @@ } [data-has-hero] .page { - background: linear-gradient(215deg, var(--overlay-blurple), transparent 40%), + background: + linear-gradient(215deg, var(--overlay-blurple), transparent 40%), radial-gradient(var(--overlay-blurple), transparent 40%) no-repeat -60vw -40vh / 105vw 200vh, radial-gradient(var(--overlay-blurple), transparent 65%) no-repeat 50% calc(100% + 20rem) / 60rem 30rem; } diff --git a/docs/src/content/docs/commands.md b/docs/src/content/docs/commands.md index 6b1bf7ec..699218e7 100644 --- a/docs/src/content/docs/commands.md +++ b/docs/src/content/docs/commands.md @@ -5,7 +5,12 @@ title: Commands Commands is a getter function, creates new transaciton whenever called. ```ts -this.editor.commands.textColor('red').insertText('Hello world!').focus().scrollIntoView().exec(); +this.editor.commands + .textColor('red') + .insertText('Hello world!') + .focus() + .scrollIntoView() + .exec(); ``` You must invoke `exec` method at the end to apply the changes to the editor. diff --git a/docs/src/content/docs/examples/collab.md b/docs/src/content/docs/examples/collab.md index bbe82a67..9eb2dbc3 100644 --- a/docs/src/content/docs/examples/collab.md +++ b/docs/src/content/docs/examples/collab.md @@ -11,13 +11,23 @@ See https://github.com/yjs for more details ```ts import * as Y from 'yjs'; import { WebsocketProvider } from 'y-websocket'; -import { ySyncPlugin, yCursorPlugin, yUndoPlugin, undo, redo } from 'y-prosemirror'; +import { + ySyncPlugin, + yCursorPlugin, + yUndoPlugin, + undo, + redo, +} from 'y-prosemirror'; import { Editor } from 'ngx-editor'; import { keymap } from 'prosemirror-keymap'; import { history } from 'prosemirror-history'; const ydoc = new Y.Doc(); -const provider = new WebsocketProvider('wss://prosemirror-collab.glitch.me/', 'prosemirror-demo', ydoc); +const provider = new WebsocketProvider( + 'wss://prosemirror-collab.glitch.me/', + 'prosemirror-demo', + ydoc, +); const type = ydoc.getXmlFragment('prosemirror'); new Editor({ @@ -71,5 +81,7 @@ wss.on('connection', (conn, req) => server.listen(port); -console.log(`Listening to http://localhost:${port} ${production ? '(production)' : ''}`); +console.log( + `Listening to http://localhost:${port} ${production ? '(production)' : ''}`, +); ``` diff --git a/docs/src/content/docs/examples/full-featured-editor.mdx b/docs/src/content/docs/examples/full-featured-editor.mdx index cf3d6d95..e89ae3a3 100644 --- a/docs/src/content/docs/examples/full-featured-editor.mdx +++ b/docs/src/content/docs/examples/full-featured-editor.mdx @@ -8,9 +8,7 @@ import Stackblitz from '@Components/Stackblitz.astro'; Use the following config to created a full featured editor -### app.module.ts - -```ts +```ts title="app.module.ts" import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; @@ -60,9 +58,7 @@ import { schema } from 'ngx-editor/schema'; export class AppModule {} ``` -### app.component.ts - -```ts +```ts title="app.component.ts" import { Component, OnInit, OnDestroy, ViewEncapsulation } from '@angular/core'; import { AbstractControl, FormControl, FormGroup } from '@angular/forms'; import { Validators, Editor, Toolbar } from 'ngx-editor'; @@ -100,9 +96,7 @@ export class AppComponent implements OnInit, OnDestroy { } ``` -### app.component.html - -```html +```html title="app.component.html"