-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
274 additions
and
500 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,5 @@ test/leak/libvips.supp | |
package-lock.json | ||
.idea | ||
.firebase | ||
.astro | ||
docs/dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
// @ts-check | ||
import { defineConfig } from 'astro/config'; | ||
import starlight from '@astrojs/starlight'; | ||
|
||
export default defineConfig({ | ||
site: 'https://sharp.pixelplumbing.com', | ||
integrations: [ | ||
starlight({ | ||
title: 'sharp', | ||
description: | ||
'High performance Node.js image processing. The fastest module to resize JPEG, PNG, WebP and TIFF images.', | ||
logo: { | ||
src: './src/assets/sharp-logo.svg', | ||
alt: '#' | ||
}, | ||
customCss: ['./src/styles/custom.css'], | ||
head: [{ | ||
tag: 'meta', | ||
attrs: { | ||
'http-equiv': 'Content-Security-Policy', | ||
content: "default-src 'self'; connect-src 'self'; object-src 'none'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https://cdn.jsdelivr.net/gh/lovell/; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://static.cloudflareinsights.com/beacon.min.js/;" | ||
} | ||
}, { | ||
tag: 'link', | ||
attrs: { | ||
rel: 'author', | ||
href: '/humans.txt', | ||
type: 'text/plain' | ||
} | ||
}, { | ||
tag: 'script', | ||
attrs: { | ||
type: 'application/ld+json' | ||
}, | ||
content: JSON.stringify({ | ||
'@context': 'https://schema.org', | ||
'@type': 'SoftwareSourceCode', | ||
name: 'sharp', | ||
description: 'High performance Node.js image processing', | ||
url: 'https://sharp.pixelplumbing.com', | ||
codeRepository: 'https://github.com/lovell/sharp', | ||
programmingLanguage: ['JavaScript', 'C++'], | ||
runtimePlatform: 'Node.js', | ||
copyrightHolder: { | ||
'@context': 'https://schema.org', | ||
'@type': 'Person', | ||
name: 'Lovell Fuller' | ||
}, | ||
copyrightYear: 2013, | ||
license: 'https://www.apache.org/licenses/LICENSE-2.0' | ||
}) | ||
}], | ||
sidebar: [ | ||
{ label: 'Home', link: '/' }, | ||
{ label: 'Installation', slug: 'install' }, | ||
{ | ||
label: 'API', | ||
items: [ | ||
{ label: 'Constructor', slug: 'api-constructor' }, | ||
{ label: 'Input metadata', slug: 'api-input' }, | ||
{ label: 'Output options', slug: 'api-output' }, | ||
{ label: 'Resizing images', slug: 'api-resize' }, | ||
{ label: 'Compositing images', slug: 'api-composite' }, | ||
{ label: 'Image operations', slug: 'api-operation' }, | ||
{ label: 'Colour manipulation', slug: 'api-colour' }, | ||
{ label: 'Channel manipulation', slug: 'api-channel' }, | ||
{ label: 'Global properties', slug: 'api-utility' } | ||
] | ||
}, | ||
{ label: 'Performance', slug: 'performance' }, | ||
{ label: 'Changelog', slug: 'changelog' } | ||
], | ||
social: { | ||
openCollective: 'https://opencollective.com/libvips', | ||
github: 'https://github.com/lovell/sharp' | ||
} | ||
}) | ||
] | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright 2013 Lovell Fuller and others. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
'use strict'; | ||
|
||
import fs from 'node:fs/promises'; | ||
import path from 'node:path'; | ||
import jsdoc2md from 'jsdoc-to-markdown'; | ||
|
||
const pages = { | ||
constructor: 'Constructor', | ||
input: 'Input metadata', | ||
resize: 'Resizing images', | ||
composite: 'Compositing images', | ||
operation: 'Image operations', | ||
colour: 'Colour manipulation', | ||
channel: 'Channel manipulation', | ||
output: 'Output options', | ||
utility: 'Global properties' | ||
}; | ||
|
||
Object.keys(pages).forEach(async (m) => { | ||
const input = path.join('lib', `${m}.js`); | ||
const output = path.join('docs', 'src', 'content', 'docs', `api-${m}.md`); | ||
|
||
const ast = await jsdoc2md.getTemplateData({ files: input }); | ||
const markdown = await jsdoc2md.render({ | ||
data: ast, | ||
'global-index-format': 'none', | ||
'module-index-format': 'none' | ||
}); | ||
|
||
const cleanMarkdown = | ||
`---\ntitle: ${pages[m]}\n---\n\n` + | ||
markdown | ||
.replace(/(## )([A-Za-z0-9]+)([^\n]*)/g, '$1$2\n> $2$3\n') // simplify headings | ||
.replace(/<a name="[A-Za-z0-9+]+"><\/a>/g, '') // remove anchors | ||
.replace(/\*\*Kind\*\*: global[^\n]+/g, '') // remove all "global" Kind labels (requires JSDoc refactoring) | ||
.trim(); | ||
|
||
await fs.writeFile(output, cleanMarkdown); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"name": "sharp-docs", | ||
"type": "module", | ||
"version": "0.0.1", | ||
"private": true, | ||
"scripts": { | ||
"dev": "astro dev", | ||
"start": "astro dev", | ||
"build": "astro build", | ||
"preview": "astro preview", | ||
"astro": "astro" | ||
}, | ||
"dependencies": { | ||
"@astrojs/starlight": "^0.31.0", | ||
"astro": "^5.1.7" | ||
} | ||
} |
File renamed without changes
File renamed without changes
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
User-agent: * | ||
Disallow: | ||
|
||
Sitemap: https://sharp.pixelplumbing.com/sitemap-index.xml |
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.