Skip to content

Commit

Permalink
docs(copy): link to docs site
Browse files Browse the repository at this point in the history
  • Loading branch information
vnphanquang committed Nov 12, 2022
1 parent bebc542 commit 91dbee1
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 88 deletions.
5 changes: 5 additions & 0 deletions .changeset/quiet-snails-stare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@svelte-put/copy': patch
---

link to dedicated docs site at https://svelte-put.vnphanquang.com/docs/copy
7 changes: 0 additions & 7 deletions packages/actions/clickoutside/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ This package is part of the [@svelte-put][github.monorepo] family. For contribut

## [Changelog][github.changelog]

## Documentation

For detailed documentation, see the [extracted API][github.api].

<p align="center">
<a href="https://www.buymeacoffee.com/vnphanquang" target="_blank">
<img
Expand All @@ -40,9 +36,6 @@ For detailed documentation, see the [extracted API][github.api].
[github.monorepo]: https://github.com/vnphanquang/svelte-put
[github.changelog]: https://github.com/vnphanquang/svelte-put/blob/main/packages/actions/clickoutside/CHANGELOG.md
[github.issues]: https://github.com/vnphanquang/svelte-put/issues?q=
[github.api]: https://github.com/vnphanquang/svelte-put/blob/main/packages/actions/clickoutside/api/docs/index.md
[github.api.clickoutsideparameters]: https://github.com/vnphanquang/svelte-put/blob/main/packages/actions/clickoutside/api/docs/clickoutside.clickoutsideparameters.md
[github.api.clickoutside]: https://github.com/vnphanquang/svelte-put/blob/main/packages/actions/clickoutside/api/docs/clickoutside.clickoutside.md

<!-- heading badge -->

Expand Down
84 changes: 6 additions & 78 deletions packages/actions/copy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,94 +2,22 @@

# `@svelte-put/copy`

[![npm.badge]][npm] [![bundlephobia.badge]][bundlephobia] [![repl.badge]][repl]
[![npm.badge]][npm] [![bundlephobia.badge]][bundlephobia] [![docs.badge]][docs]

Svelte action `use:copy` and utility for copying text inside nodes
Svelte action `use:copy` and utility for copying text to clipboard

</div>

## Table of Contents
## Usage & Documentation

<details open>
<summary>Show / hide</summary>

- [`@svelte-put/copy`](#svelte-putcopy)
- [Table of Contents](#table-of-contents)
- [`svelte-put`](#svelte-put)
- [Changelog](#changelog)
- [Installation](#installation)
- [Documentation](#documentation)
- [Typescript support](#typescript-support)

</details>
[See the dedicated documentation page here][docs].

## `svelte-put`

This package is part of the [@svelte-put][github.monorepo] family. For contributing guideline and more, refer to its [readme][github.monorepo].

## [Changelog][github.changelog]

## Installation

```bash
npm install -D @svelte-put/copy
```

```bash
yarn add -D @svelte-put/copy
```

```bash
pnpm add -D @svelte-put/copy
```

</details>

## Documentation

### Typescript support

Ambient types for custom events should be available automatically where `copy` is imported.

<details open>
<summary> show / hide </summary>

```html
<script lang="ts">
import { copy } from '@svelte-put/copy';
let trigger: HTMLElement;
</script>

<!-- on:copy, on:copyonce should be typed -->
<div use:copy="{{" trigger }} on:copy />
```

</details>

If the above is not working, fall back to this:

<details open>
<summary> app.d.ts: show / hide </summary>

```typescript
/// <reference types="@sveltejs/kit" />
/// <reference types="svelte" />

// Typescript support in svelte-kit, see
// https://github.com/sveltejs/language-tools/blob/master/docs/preprocessors/typescript.md#im-using-an-attributeevent-on-a-dom-element-and-it-throws-a-type-error

declare namespace svelte.JSX {
interface HTMLAttributes<T> {
// on:copy
oncopy?: (event: CustomEvent<import('@svelte-put/copy').CopyDetail>) => void;
}
}
```

</details>

For detailed documentation, see the [extracted API][github.api].

<p align="center">
<a href="https://www.buymeacoffee.com/vnphanquang" target="_blank">
<img
Expand All @@ -114,5 +42,5 @@ For detailed documentation, see the [extracted API][github.api].
[npm]: https://www.npmjs.com/package/@svelte-put/copy
[bundlephobia.badge]: https://img.shields.io/bundlephobia/minzip/@svelte-put/copy?label=minzipped
[bundlephobia]: https://bundlephobia.com/package/@svelte-put/copy
[repl]: https://svelte.dev/repl/835eacce6ac44aff95a7cb0bb5ca200d
[repl.badge]: https://img.shields.io/static/v1?label=&message=Svelte+REPL&logo=svelte&logoColor=fff&color=ff3e00
[docs]: https://svelte-put.vnphanquang.com/docs/copy
[docs.badge]: https://img.shields.io/badge/-Docs%20Site-blue
7 changes: 4 additions & 3 deletions packages/actions/copy/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@svelte-put/copy",
"version": "0.1.0",
"description": "Svelte action & utilities for copying text inside nodes",
"description": "Svelte action & utilities for copying text to clipboard",
"main": "lib/index.js",
"module": "lib/index.js",
"types": "lib/src/index.d.ts",
Expand Down Expand Up @@ -43,14 +43,15 @@
"svelte",
"action",
"copy",
"clipboard"
"clipboard",
"text"
],
"author": "Quang Phan",
"license": "MIT",
"bugs": {
"url": "https://github.com/vnphanquang/svelte-put/issues"
},
"homepage": "https://github.com/vnphanquang/svelte-put/tree/main/packages/actions/copy",
"homepage": "https://svelte-put.vnphanquang.com/docs/copy",
"devDependencies": {
"@microsoft/api-documenter": "^7.19.24",
"@microsoft/api-extractor": "^7.33.6",
Expand Down

0 comments on commit 91dbee1

Please sign in to comment.