Skip to content

Commit

Permalink
Update for yaml format
Browse files Browse the repository at this point in the history
  • Loading branch information
davepagurek committed Mar 5, 2024
1 parent 422037d commit c87477d
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 238 deletions.
File renamed without changes
Binary file added public/images/libraries/p5.xr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions src/content/libraries/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# p5.js Libraries

p5.js welcomes libraries contributed by others! <a href="https://github.com/processing/p5.js/blob/main/contributor_docs/creating_libraries.md">Check out the libraries tutorial</a> for more specifics about how to create one. If you have created a library and would like to have it included in the list, follow the instructions below!

1. Fork the repo
2. Add a file to the `src/content/libraries` folder named `yourLibraryName.yaml`
3. Inside it, add the following content:
- `name`: The name of the library
- `category`: A category that you think best fits your library. Your choices include: `drawing`, `color`, `ui`, `math`, `physics`, `algorithms`, `3d`, `ai-ml-cv`, `animation`, `filters`, `language`, `hardware`, `sound`, `data`, `networking`, `export`, or `utils`.
- `description`: A one-sentence description of the library
- `author`: An object containing `name`, your name, and `url`, an optional link to your website
- `sourceUrl`: A link to the library's source code (e.g. its repo on GitHub or GitLab)
- (Optional) `websiteUrl`: A link to a website for the library
- (Optional) `npm`: If applicable, the package name for the library on <a href="https://www.npmjs.com/">npm</a>
- (Optional) `npmFilePath`: A path like `'dist/library.min.js'` if a specific file in the library should be used from npm
- `featuredImage`: An object about the preview thumbnail for the library, with `url`, the path to the image in the `public/images/libraries` folder, and `altText`, a short description of its contents for screen readers
- (Optional) `license`: A <a href="https://docs.npmjs.com/cli/v10/configuring-npm/package-json#license">string describing the software license of the library.</a> This may be omitted if your package is on npm and has license info there
4. Add a **1500x1000** image of your library into `public/images/libraries`
5. Submit a pull request and we'll review your submission

We add libraries that are open-source, includes some documentation and examples, and <a href="https://github.com/processing/p5.js/blob/main/CODE_OF_CONDUCT.md">follow our code of conduct.</a>
29 changes: 26 additions & 3 deletions src/content/libraries/config.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,39 @@
import { z, defineCollection } from "astro:content";
import { author, image } from "../shared";

const categories = ["core", "ar-vr"] as const;
const categories = [
"drawing",
"color",
"ui",
"math",
"physics",
"algorithms",
"3d",
"ai-ml-cv",
"animation",
"filters",
"language",
"hardware",
"sound",
"data",
"networking",
"export",
"utils",
] as const;

export const librariesCollection = defineCollection({
type: "data",
schema: z.object({
name: z.string(),
description: z.string().optional(),
description: z.string(),
category: z.enum(categories),
url: z.string().url(),
sourceUrl: z.string().url(),
websiteUrl: z.string().url().optional(),
// 1500x1000
featuredImage: image(),
author: author(),
license: z.string().optional(),
npm: z.string().optional(),
npmFilePath: z.string().optional(),
}),
});
12 changes: 12 additions & 0 deletions src/content/libraries/p5.warp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: p5.warp
description: Fast 3D domain warping using shaders.
category: 3d
sourceUrl: https://github.com/davepagurek/p5.warp
featuredImage:
url: p5.warp.png
altText: Four images of a 3D airplane twisting upside-down
author:
name: Dave Pagurek
url: https://www.davepagurek.com
npm: p5.warp
license: MIT
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
name: p5.xr
description: A library for creating VR and AR sketches with p5.
category: ar-vr
url: https://p5xr.org/
category: 3d
sourceUrl: https://github.com/stalgiag/p5.xr
websiteUrl: https://p5xr.org
featuredImage:
url: https://github.com/stalgiag/p5.xr/raw/main/docs/assets/xr-tear.png
url: p5.xr.png
altText: A crying face
author:
name: Stalgia Grigg
url: https://www.stalgiagrigg.name/
npm: p5.xr
npmFilePath: dist/p5xr.min.js
license: MIT
21 changes: 0 additions & 21 deletions src/libraries/README.md

This file was deleted.

Binary file removed src/libraries/docs-assets/propose-changes.png
Binary file not shown.
148 changes: 0 additions & 148 deletions src/libraries/libraries.ts

This file was deleted.

63 changes: 0 additions & 63 deletions src/libraries/types.ts

This file was deleted.

0 comments on commit c87477d

Please sign in to comment.