Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add examples for API and high-level workflow #3

Open
MichaelCurrin opened this issue Feb 11, 2021 · 3 comments
Open

Add examples for API and high-level workflow #3

MichaelCurrin opened this issue Feb 11, 2021 · 3 comments

Comments

@MichaelCurrin
Copy link

MichaelCurrin commented Feb 11, 2021

I found these as exported functions at the bottom of the very long 1MB compiler script.

  compileScript,
  compileStyle,
  compileStyleAsync,
  compileTemplate,
  generateCodeFrame,
  parse,
  rewriteDefault,

It would be nice to list those all in the README.md

@MichaelCurrin
Copy link
Author

The current example as console.log(parse(....)); // component to parse. is too vague - how / what do I pass as component.

Example content.

## API

### parse

```typescript
import { parse } from "https://deno.land/x/vue_sfc_compiler/mod.ts";

const component = ... // Is this a Vue object, a dictionary, a loaded .vue file?
parse(component)
```

### compileScript

Used to compile a Vue script tag into a whatever...

Example:

```typescript
import { compileScript } from "https://deno.land/x/vue_sfc_compiler/mod.ts";

const x = '<script>console.log()</script>'
compileScript(x)
``` 

@MichaelCurrin MichaelCurrin changed the title Add examples for high-level workflow Add examples for API and high-level workflow Feb 11, 2021
@MichaelCurrin
Copy link
Author

In the currently high-level workflow section of the README.md file, it would be also be useful to have examples for each with a code block of just a few lines.

@MichaelCurrin
Copy link
Author

Oh I see in the content in README.md was lifted as is from https://www.npmjs.com/package/@vue/compiler-sfc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant