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 option for src=<file>.py #21

Open
AlbertDeFusco opened this issue Aug 14, 2022 · 1 comment
Open

Add option for src=<file>.py #21

AlbertDeFusco opened this issue Aug 14, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@AlbertDeFusco
Copy link
Collaborator

Instead of copying the contents of the script into the HTML I would like to have the option to declare the path to the source input.

I will submit a PR for this use case shortly.

For example (the new flag is only a suggestion, a better recommended name or default behavior is appreciated)

> pyscript wrap --no-copy-source input-file.py -o index.html
> cat index.html
<!DOCTYPE html>
<html lang="en">
<head>
    <title>PyScript App</title>
    <link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css"/>
    <script defer src="https://pyscript.net/alpha/pyscript.js"></script>
</head>
<body>
    <py-script src="input-file.py"></py-script>
</body>
</html>
@mattkram
Copy link
Collaborator

I wasn't aware the src= attribute worked for <py-script>. Cool!

Definitely open for this and also potentially a way to put the source file into paths:.

My original method was really intended to make a single static file, without need for web server at all, but I think there are many valid use cases and we should make it very configurable (and simple too).

@mattkram mattkram added the enhancement New feature or request label Sep 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants