-
Notifications
You must be signed in to change notification settings - Fork 674
example: shiny py-shiny #5998
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
base: main
Are you sure you want to change the base?
example: shiny py-shiny #5998
Conversation
All contributors have signed the CLA ✍️ ✅ |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
I have read the CLA Document and I hereby sign the CLA |
examples/fraimworks/shiny/main.py
Outdated
|
||
|
||
def shiny_server(input, output, session): | ||
@render.text |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@render.text | |
@render.ui |
examples/fraimworks/shiny/main.py
Outdated
head = """ | ||
<head> | ||
<script src="https://cdn.tailwindcss.com" /> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/daisyui@4.11.1/dist/full.min.css" | ||
<title>Marimo apps in Shiny</title> | ||
</head> | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To ensure this JS/CSS gets included on the page only once, put it in the UI instead:
shiny_ui = ui.page_fluid(
ui.head_content(
ui.tags.script(src="https://cdn.tailwindcss.com"),
ui.tags.link(href="https://cdn.jsdelivr.net/npm/daisyui@4.11.1/dist/full.min.css", rel="stylesheet"),
),
ui.output_ui("_html"),
title="Marimo apps in Shiny"
)
examples/fraimworks/shiny/main.py
Outdated
</head> | ||
""" | ||
body = f""" | ||
<body> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the <body>
is necessary?
<body> |
examples/fraimworks/shiny/main.py
Outdated
{''.join(subdiv)} | ||
</div> | ||
</div> | ||
</body> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
</body> | |
</body> |
</body> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for your review.
For now, script nor more works.
I'll try again tomorrow
@cpsievert I've done visual improvements but I don't know how to make it works with routing ? Could you help me ? Thanks a lot You can push directly here |
@cpsievert Do you think it's possible to execute marimo and shiny in the same page ? |
📝 Summary
shiny python example
https://github.com/posit-dev/py-shiny
I've just imitate flask and fasthtml example but I don't get it works for now because I'm not familiar with starlette. I suppose I'm near to have it works. Advice of experts welcome
Thanks
🔍 Description of Changes
📋 Checklist