π Design your README.md by Vue component.
BaseURL: http://readme.app.surmon.me/api/render
Template ID ?template_id=<template_id>
Use default template.
Template URL ?template_url=<template_url_xxx.vue>
Use your remote vue template.
Template string ?template_string=<template_content_string>
Use your vue template by query string.
begin with props.
, template render params will transmit to vue component's props
.
e.g. ?props.theme=dark&props.rows=2
will transmit to vue component { theme: 'dark', rows: '2' }
begin with svg.
, SVG render params will transmit to SVG wrapper's attributes.
e.g. ?svg.width=830&svg.height=100
will transmit to SVG wrapper <svg ... width="830" height="100">
![](https://readme.app.surmon.me/api/render?template_id=hello-world)
![](https://readme.app.surmon.me/api/render?template_id=hello-world&props.theme=dark)
![](https://readme.app.surmon.me/api/render?template_id=hello-world&svg.width=800&svg.height=300)
- must be a vue SFC component
- can't use Node.js API,
$ctx
only (see sandbox context) - plain SFC component only
template example:
<template>
<div class="main" :class="theme">
<p>content</p>
</div>
</template>
<script>
const { defineComponent } = $ctx.vue
export default defineComponent({
name: 'Example',
props: {
theme: {
type: String,
default: 'light'
}
}
})
</script>
<style>
.main {
width: 100px;
height: 100px;
}
</style>
# install dependencies
$ yarn
$ yarn dev
$ yarn build
$ yarn start
api
vercel serverlessapp/server
Node.js server