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 language-specific examples #28

Open
evanplaice opened this issue Sep 27, 2020 · 0 comments
Open

Add language-specific examples #28

evanplaice opened this issue Sep 27, 2020 · 0 comments

Comments

@evanplaice
Copy link
Member

It would be useful to have examples that demonstrate how to use different languages. To keep the code simple, use inline source.

Each example should demonstrate

  • which css/js imports are required
  • provide copy/pasteable source to help users get started

Here's what the examples for JavaScript would look like

/examples/cdn/language-javascript.html

<!DOCTYPE html>
<html>
<head>
  <script type="module" src="https://cdn.jsdelivr.net/gh/vanillawc/wc-codemirror/index.js"></script>
</head>
<body>

  <wc-codemirror mode="javascript">
    <script type="wc-content">
        function myGoodPerson(){
            return "what can I do for you ?"
        }
    </script>
  </wc-codemirror>

</body>
</html>

/examples/npm/language-javascript.html

<!DOCTYPE html>
<html>
<head>
  <script type="module" src="node_modules/@vanillawc/wc-codemirror/index.js"></script>
</head>
<body>

  <wc-codemirror mode="javascript">
    <script type="wc-content">
        function myGoodPerson(){
            return "what can I do for you ?"
        }
    </script>
  </wc-codemirror>

</body>
</html>
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