Skip to content

Commit

Permalink
docs(readme): update readme and pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
weirui88888 committed Dec 5, 2023
1 parent 432116d commit fc27b93
Show file tree
Hide file tree
Showing 11 changed files with 566 additions and 401 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Andrew Rothbart

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
58 changes: 57 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,59 @@
# AnyPhoto

Photo by any inspiration
anyphoto is a drawing tool that allows you to generate beautiful pictures anywhere,based on [node-canvas](https://github.com/Automattic/node-canvas).

## Playground

You can quickly experience it in [playground](https://www.anyphoto.space/playground). (This visual playground is constantly being improved, and it is more recommended to install it locally to experience it)

## Examples

<img src="./examples/demo1.png"/>

More cases can be viewed in [examples](https://github.com/weirui88888/anyphoto/tree/main/examples).

## Install

```shell
npm install anyphoto -g
```

You can also use it by use `npx`

## Usage

It is expected to support 4 commands, currently 2 of the core are supported.

### Init

Generate a configuration file, and then you can make modifications in the configuration file. This command supports creating configuration files in any directory.

```shell
anyphoto init
```

### Generate

After executing this command, a picture will be generated based on the configuration file generated and modified in the previous step.

```shell
anyphoto generate
```

**This command supports passing parameters and several core options. You can pass them in when executing this command. The parameters and options passed in the command line will overwrite the corresponding configuration items in the configuration file.**

You can execute `anyphoto generate --help` to view them

### Github(planning)

After generating the image, you can execute this command to upload the image to github

### Show(planning)

Preset templates will be supported in the future. After executing this command, you can check which templates are currently available, and you can also view sample images of the specified template.

## TODO

- [ ] Support more preset templates
- [ ] Try to better implement the content wrapping layout part
- [ ] Improve documentation
3 changes: 1 addition & 2 deletions bin/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#! /usr/bin/env node
/* eslint-disable no-unused-vars */
const { Command } = require('commander')
const open = require('open')
const path = require('path')
const pkg = require('../package.json')
const { init, generate, github } = require('../src/cmd')
const { init, generate } = require('../src/cmd')
const { showAnyPhotoFiglet, colorTip, color } = require('../src/util')
const { defaultTheme } = require('../src/config')

Expand Down
Binary file added examples/demo1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/demo2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/demo3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/demo4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/demo5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 16 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "anyphoto",
"version": "1.0.11",
"version": "1.0.0",
"description": "Photo by any inspiration",
"main": "index.js",
"main": "src/cmd/generate.js",
"files": [
"bin",
"src",
Expand All @@ -13,15 +13,25 @@
"email": "[email protected]",
"url": "https://github.com/weirui88888/"
},
"repository": {
"type": "git",
"url": "git+ssh://[email protected]/weirui88888/anyphoto.git"
},
"homepage": "https://www.anyphoto.space",
"scripts": {
"prepare": "husky install",
"lint": "eslint . --fix",
"commit": "cz",
"int": "node ./bin/index.js init",
"gen": "node ./bin/index.js generate"
},
"keywords": [],
"license": "ISC",
"keywords": [
"image",
"canvas",
"executable",
"node"
],
"license": "MIT",
"volta": {
"node": "18.0.0"
},
Expand All @@ -48,8 +58,8 @@
"commander": "^11.0.0",
"figlet": "^1.6.0",
"is-image-url": "^1.1.8",
"open": "8.4.0",
"ora": "5.4.1"
"open": "^8.4.0",
"ora": "^5.4.1"
},
"devDependencies": {
"@commitlint/cli": "^17.7.1",
Expand Down
Loading

0 comments on commit fc27b93

Please sign in to comment.