Skip to content

Commit

Permalink
Revert "chore: add missing buildSVG func in the usage doc"
Browse files Browse the repository at this point in the history
This reverts commit c729313.
  • Loading branch information
hikerpig authored Oct 25, 2023
1 parent 269b1ca commit 7dd01b3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 29 deletions.
10 changes: 1 addition & 9 deletions packages/pintora-cli/src/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,13 @@ import { Canvas, CanvasPattern } from 'canvas'
import { SVG_MIME_TYPE, DEFAUT_BGS } from './const'

export type CLIRenderOptions = {
/**
* pintora DSL to render
*/
code: string
devicePixelRatio?: number | null
mimeType?: string
/**
* Assign extra background color
*/
backgroundColor?: string
pintoraConfig?: Partial<PintoraConfig>
/**
* width of the output, height will be calculated according to the diagram content ratio
*/
width?: number
// height?: number
}

function renderPrepare(opts: CLIRenderOptions) {
Expand Down
20 changes: 0 additions & 20 deletions website/docs/advanced/api-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,20 +140,11 @@ It's a little bit more complicated in Node.js than in the browser, we need to bo

```ts
export type CLIRenderOptions = {
/**
* pintora DSL to render
*/
code: string
devicePixelRatio?: number | null
mimeType?: string
/**
* Assign extra background color
*/
backgroundColor?: string
pintoraConfig?: Partial<PintoraConfig>
/**
* width of the output, height will be calculated according to the diagram content ratio
*/
width?: number
}

Expand All @@ -172,17 +163,6 @@ Some example code:
import { render, PintoraConfig } from '@pintora/cli'
import * as fs from 'fs'
const buildSVG = async (code: string, config?: Partial<PintoraConfig>) => {
const str = await render({
code: code,
pintoraConfig: config,
mimeType: 'image/svg+xml',
width: 1000,
backgroundColor: '#fff',
})
fs.writeFileSync('example.svg', str)
}
const buildPNG = async (code: string, config?: Partial<PintoraConfig>) => {
const buf = await render({
code: code,
Expand Down

0 comments on commit 7dd01b3

Please sign in to comment.