Skip to content

Commit

Permalink
✅ docs markdown for gitbook
Browse files Browse the repository at this point in the history
  • Loading branch information
SrGobi committed Feb 23, 2024
1 parent e9db472 commit f3fb0fe
Show file tree
Hide file tree
Showing 19 changed files with 183 additions and 2,424 deletions.
Empty file removed docs/class/Assets.md
Empty file.
Empty file removed docs/class/FortniteShop.js.md
Empty file.
9 changes: 0 additions & 9 deletions docs/index.md

This file was deleted.

Empty file removed docs/libs.md
Empty file.
2,396 changes: 0 additions & 2,396 deletions docs/src.md

This file was deleted.

Empty file removed docs/typings.md
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Canvacard Generador De Memes

**Example**
```js
const Canvacard = require("canvacard");Canvacard.Canvas.trigger("./image.png") .then(triggered => { Canvacard.write(triggered, "triggered.gif"); })
const Canvacard = require("canvacard");Canvacard.Canvas.trigger("./image.png") .then(triggered => { Canvacard.write(triggered, "triggered.gif"); })
```
<a name="Canvacard.CONVOLUTION_MATRIX"></a>

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
167 changes: 167 additions & 0 deletions docs/🥳 Welcome.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
# [![Typing SVG](https://readme-typing-svg.herokuapp.com?font=Fira+Code&weight=500&size=40&pause=1000&color=5865F2&multiline=true&random=false&width=435&lines=Canvacard)](#)

Potente herramienta de manipulación de imágenes para manipular imágenes fácilmente.

<p align="center"><a href="https://nodei.co/npm/canvacard/"><img src="https://nodei.co/npm/canvacard.png"></a></p>
<p align="center"><img src="https://img.shields.io/npm/v/canvacard?style=for-the-badge"> <img src="https://img.shields.io/npm/l/hercai?style=for-the-badge"> <img src="https://img.shields.io/npm/dt/canvacard?style=for-the-badge"> <a href="https://discord.gg/cqrN3Eg" target="_blank"> <img alt="Discord" src="https://img.shields.io/badge/Support-Click%20here-7289d9?style=for-the-badge&logo=discord"> </a> </p>


## [![Typing SVG](https://readme-typing-svg.herokuapp.com?font=Fira+Code&weight=500&pause=1000&color=F20000&random=false&width=435&lines=%E2%9D%94How+To+Install%3F)](#)

```console
npm i canvacard
```

# [![Typing SVG](https://readme-typing-svg.herokuapp.com?font=Fira+Code&weight=500&pause=1000&&color=00EDFF&random=false&width=435&lines=%F0%9F%8E%AF+Describing)](#)

For **CommonJS**
```javascript
const canvacard = require("canvacard");
```

For **EsModule** And **TypeScript**
```javascript
import canvacard from "canvacard";
```

# Features

- Súper simple y fácil de usar 😎
- Más rápido que canvacard v4 🚀
- ¿Más de **50 métodos** ...? ¡Hurra! 🎉
- Construido sobre un lienzo de nodos y sin tonterías involucradas 🔥
- Orientado a objetos 💻
- Apto para principiantes 🤓
- Soporta emojis 😀

# Ejemplos

## Rank Card

```js
const canvacard = require("canvacard");
const img = "https://cdn.discordapp.com/embed/avatars/0.png";
const background = "https://i.imgur.com/5O7xmVe.png";

const userData = getDataSomehow();

const rank = new canvacard.Rank()
.setAvatar(img)
.setBackground('IMAGE', background)
.setCurrentXP(userData.xp)
.setRequiredXP(userData.requiredXP)
.setRank(userData.rank)
.setRankColor("#FFFFFF")
.setLevel(userData.level)
.setLevelColor("#FFFFFF")
.setStatus("online", true)
.setCustomStatusColor("#23272A")
.setOverlay("#23272A", 1 || 0, true)
.setProgressBar(["#FF0000", "#0000FF"], "GRADIENT")
.setProgressBarTrack("#000000")
.setUsername("SrGobi")
.renderEmojis(true)

rank.build()
.then(data => {
const attachment = new Discord.MessageAttachment(data, "RankCard.png");
message.channel.send(attachment);
});
```

<details open>
<summary>PREVIEW</summary>
<br>
<a>
<img src="https://i.imgur.com/fgqOnhH.png">
</a>
<a>
<img src="https://i.imgur.com/QBP7kO6.png">
</a>
<a>
<img src="https://i.imgur.com/V8vpyKL.png">
</a>
</details>

## Welcomer Card

```js
const canvacard = require("canvacard");
const img = "https://cdn.discordapp.com/embed/avatars/0.png";
const background = "https://i.imgur.com/5O7xmVe.png";

const welcomer = new canvacard.Welcomer()
.setAvatar(img)
.setBackground('IMAGE', background)
.setTitulo("WELCOME")
.setSubtitulo("Subtitulo personalizable!")
.setTitulo("Titulo personalizable!")
.setSubtitulo("Subtitulo personalizable!")
.setColorTitulo("#FFFFFF");
.setColorSubtitulo("#5865f2");
.setColorCircle("#FFFFFF");
.setColorOverlay("#000000");
.setOpacityOverlay("0.4");

welcomer.build()
.then(data => {
const attachment = new Discord.MessageAttachment(data, "WelcomerCard.png");
message.channel.send(attachment);
});
```

<details open>
<summary>PREVIEW</summary>
<br>
<a>
<img src="https://i.imgur.com/EWGFp1C.png">
</a>
<a>
<img src="https://i.imgur.com/5O7xmVe.png">
</a>
<a>
<img src="https://i.imgur.com/S9AkanK.png">
</a>
<a>
<img src="https://i.imgur.com/AqJcx6K.png">
</a>
</details>

## Otros ejemplos

```js
const Discord = require('discord.js');
const client = new Discord.Client();
const canvacard = require('canvacard');

client.on('ready', () => {
console.log('¡Estoy en línea!');
});

client.on('messageCreate', async (message) => {
if (message.author.bot) return;
if (message.content === '!triggered') {
let avatar = message.author.displayAvatarURL({ dynamic: false, format: 'png' });
let image = await canvacard.Canvas.trigger(avatar);
let attachment = new Discord.MessageAttachment(image, 'triggered.gif');
return message.channel.send(attachment);
}
});

client.login('Tu_Bot_Token_aqui');
```

<details open>
<summary>PREVIEW</summary>
<br>
<a>
<img src="https://i.imgur.com/tOGNj5d.png">
</a>
<a>
<img src="https://i.imgur.com/tNbpx68.jpg">
</a>
</details>

# Nota

> ⚠ | Para usar `Canvacard#CaptchaGen`, es posible que deba instalar paquetes como **[captcha-canvas](https://npmjs.com/package/captcha-canvas)**.
26 changes: 11 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,17 @@
"typings"
],
"scripts": {
"jsdoc2md:libs": "jsdoc2md ./libs/**/* > docs/libs.md",
"jsdoc2md:plugins": "jsdoc2md ./plugins/**/* > docs/plugins.md",
"jsdoc2md:src": "jsdoc2md ./src/**/* > docs/src.md",
"jsdoc2md:welcomer": "jsdoc2md ./src/Welcomer.js > docs/class/Welcomer.md",
"jsdoc2md:leaver": "jsdoc2md ./src/Leaver.js > docs/class/Leaver.md",
"jsdoc2md:rank": "jsdoc2md ./src/Rank.js > docs/class/Rank.md",
"jsdoc2md:spotify": "jsdoc2md ./src/Spotify.js > docs/class/Spotify.md",
"jsdoc2md:fortniteShop": "jsdoc2md ./src/FortniteShop.js > docs/class/FortniteShop.md",
"jsdoc2md:fortniteStats": "jsdoc2md ./src/FortniteStats.js > docs/class/FortniteStats.md",
"jsdoc2md:canvacard": "jsdoc2md ./src/Canvacard.js > docs/class/Canvacard.md",
"jsdoc2md:pluginsSrc": "jsdoc2md ./src/Plugins.js > docs/class/Plugins.md",
"jsdoc2md:Assets": "jsdoc2md ./src/Assets.js > docs/class/Assets.md",
"jsdoc2md:Util": "jsdoc2md ./src/Util.js > docs/class/Util.md",
"jsdoc2md:index": "jsdoc2md index.js > docs/index.md",
"jsdoc2md": "npm run jsdoc2md:libs && npm run jsdoc2md:plugins && npm run jsdoc2md:src && npm run jsdoc2md:welcomer && npm run jsdoc2md:leaver && npm run jsdoc2md:rank && npm run jsdoc2md:spotify && npm run jsdoc2md:fortniteShop && npm run jsdoc2md:fortniteStats && npm run jsdoc2md:canvacard && npm run jsdoc2md:pluginsSrc && npm run jsdoc2md:Assets && npm run jsdoc2md:Util && npm run jsdoc2md:index",
"jsdoc2md:plugins": "jsdoc2md ./plugins/* > docs/Plugins.md",
"jsdoc2md:welcomer": "jsdoc2md ./src/Welcomer.js > docs/Classes/Welcomer.md",
"jsdoc2md:leaver": "jsdoc2md ./src/Leaver.js > docs/Classes/Leaver.md",
"jsdoc2md:rank": "jsdoc2md ./src/Rank.js > docs/Classes/Rank.md",
"jsdoc2md:spotify": "jsdoc2md ./src/Spotify.js > docs/Classes/Spotify.md",
"jsdoc2md:fortniteShop": "jsdoc2md ./src/FortniteShop.js > docs/Classes/FortniteShop.md",
"jsdoc2md:fortniteStats": "jsdoc2md ./src/FortniteStats.js > docs/Classes/FortniteStats.md",
"jsdoc2md:canvacard": "jsdoc2md ./src/Canvacard.js > docs/Classes/Canvacard.md",
"jsdoc2md:pluginsSrc": "jsdoc2md ./src/Plugins.js > docs/Classes/Plugins.md",
"jsdoc2md:Util": "jsdoc2md ./src/Util.js > docs/Classes/Util.md",
"jsdoc2md": "npm run jsdoc2md:plugins && npm run jsdoc2md:welcomer && npm run jsdoc2md:leaver && npm run jsdoc2md:rank && npm run jsdoc2md:spotify && npm run jsdoc2md:fortniteShop && npm run jsdoc2md:fortniteStats && npm run jsdoc2md:canvacard && npm run jsdoc2md:pluginsSrc && npm run jsdoc2md:Util",
"docs": "jsdoc -c ./jsdoc.json",
"test": "cd test && node .",
"types": "tsc",
Expand Down
7 changes: 4 additions & 3 deletions src/Canvacard.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ const Util = require("./Util");

/**
* Canvacard Generador De Memes
* @example const Canvacard = require("canvacard");
*
* @example
* const Canvacard = require("canvacard");
* Canvacard.Canvas.trigger("./image.png")
* .then(triggered => {
* Canvacard.write(triggered, "triggered.gif");
Expand Down Expand Up @@ -1210,7 +1210,8 @@ class Canvacard {
* @param {string} [options.mainText] El mensaje
* @param {string} [options.replyText] El mensaje de respuesta
* @returns {Promise<Buffer>}
* @example const img = "https://cdn.discordapp.com/embed/avatars/0.png";
* @example
* const img = "https://cdn.discordapp.com/embed/avatars/0.png";
* const img2 = "https://cdn.discordapp.com/embed/avatars/4.png";
* canvacard.Canvas.reply({
* avatar1: img,
Expand Down

0 comments on commit f3fb0fe

Please sign in to comment.