Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 13 additions & 30 deletions {{ cookiecutter.format }}/www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,50 +16,33 @@

<!-- PyScript -->

<script type="module">
// Hide the splash screen when the page is ready.
import { hooks } from "https://pyscript.net/releases/2024.11.1/core.js";
hooks.main.onReady.add(() => {
document.getElementById("briefcase-splash").classList.add("hidden");
});
</script>

<link rel="stylesheet" href="https://pyscript.net/releases/2024.11.1/core.css">
<script type="module" src="https://pyscript.net/releases/2024.11.1/core.js"></script>
<!--@@ PyScript:start @@-->
<!--@@ PyScript:end @@-->

<!-- App Style -->
<!-- Toolkit Head Insert (any valid <head> content)-->

<!--@@ head:start @@-->
<!--@@ head:end @@-->

{% if cookiecutter.style_framework == "Bootstrap v4.6" %}
<link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css"
integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N"
crossorigin="anonymous">
{% elif cookiecutter.style_framework == "Shoelace v2.3" %}
<link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.3.0/dist/themes/light.css" />
<script type="module"
src="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.3.0/dist/shoelace.js"></script>
{% endif %}
<link rel="stylesheet" href="/static/css/briefcase.css">
</head>
<body id="app-placeholder">
<div id="briefcase-splash">
<img src="static/logo-32.png" alt="Splash screen logo">
<p>Loading...</p>
</div>
{% if cookiecutter.style_framework == "Bootstrap v4.6" %}
<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js"
integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js"
integrity="sha384-Fy6S3B9q64WdZWQUiU+q4/2Lc9npb8tCaSX9FK7E8HnRr0Jz8D6OP9dO5Vg3Q9ct"
crossorigin="anonymous"></script>
{% endif %}

Comment thread
freakboy3742 marked this conversation as resolved.
<script type="py" async="false" config="pyscript.toml">
import runpy
result = runpy.run_module(
"{{ cookiecutter.module_name }}", run_name="__main__", alter_sys=True
)
</script>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is (obviously) a PyScript specific insertion - possibly not the actual Python code, but at the very least the <script> tag. It might be worth putting this into Briefcase as one of the insertions, on a body-python inclusion (and maybe rename the python inclusion as head-python)


<!-- Toolkit Body Insert (any valid <script> tags)-->

<!--@@ end:start @@-->
<!--@@ end:end @@-->

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"end:end" is a bit ambiguous... "body-end" or "BodyEnd" (not sure what naming convention we're using here) might be better.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, thanks Russell
On that note, do you think it would it be worth having a set of "BodyStart" markers towards the top of the body?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't think of an obvious reason you'd need one - but it doesn't cost anything to have the inclusion in case it's needed.


</body>
</html>
12 changes: 7 additions & 5 deletions {{ cookiecutter.format }}/www/static/css/briefcase.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ div#briefcase-splash img {
}
}

/*******************************************************************
* WARNING: Do not remove or modify this comment block, or add any
* content below this block. Briefcase will add content here during
* the build step.
******************* Wheel contributed styles **********************/
/************************* Toolkit styles *************************/

/* WARNING: Do not modify content between the @@ CSS:start @@ and
@@ CSS:end @@ markers. */

/*@@ CSS:start @@*/
/*@@ CSS:end @@*/
Loading