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

Project Status #83

Open
12 tasks
AnnMarieW opened this issue Feb 10, 2022 · 0 comments
Open
12 tasks

Project Status #83

AnnMarieW opened this issue Feb 10, 2022 · 0 comments

Comments

@AnnMarieW
Copy link
Collaborator

AnnMarieW commented Feb 10, 2022

Multi Page Apps

A better, easier way to make Multi-page apps with Dash

Status

🎉 Now available in dash 2.5.1!

Convert your multi-page app from a dash-labs pages plug-in to the pages feature in dash 2.5.1 in 3 easy steps:

  1. Remove import dash_labs as dl or upgrade dash-labs to V1.1.0
    There is a conflict between dash-labs versions less than 1.1.0 when running a pages app in dash 2.5.1

  2. Change:

app = Dash(__name__, plugins=[dl.plugins.pages])

to:

app = Dash(__name__, use_pages=True)
  1. Change:
dl.plugins.page_container

to:

dash.page_container

That's it!

👉 Thepages feature will no longer be developed and maintained here in dash-labs. I recommend all dash-labs multi-page apps be converted to use the pages feature in dash 2.5.1



MarkdownAIO

MarkdownAIO is a Dash feature that allows you to write Dash Apps as Markdown files. Simply pass in a Markdown file and MarkdownAIO will return a set of components with the option to display and/or execute code blocks. So it’s part:

  • Documentation helper
  • Markdown / Text authoring tool
  • Easy way to bring a markdown file into an app without doing open('file.md')

Status: Pull request in Dash Labs. Feature preview available. Project on hold pending re-write to make it easier to write secure dash apps

Summary of Open items:

  • Current way of running the code with exec can increase the risk of running malicious code. Project is on hold until this issue is solved. One potential solution is to only run code added to a markdown file like this: {% include example1.py %} This will ensure that only code on the server can be executed.

  • Raise error if using MarkdownAIO with exec within a callback. See discussion here: MarkdownAIO #82 (comment)

  • Improve the Stylesheet and add examples. Or find a better way to do this.

  • Do a dash-labs release

  • Write a parser for the yaml front-matter in Markdown files.
    The purpose is to improve security by limiting the scope to pages/ and MarkdownAIO data. Use json.loads instead of eval or exec. This will also remove the pyaml and python-frontmatter dependency. See discussion: MarkdownAIO #82 (comment)

  • Improve error handling and error messages

  • Write community forum announcement

  • Create dash pull request 🎊

  • Documentation

    • online feature preview: https://dashlabs.pythonanywhere.com/markdownaio/overview
    • Review, update and add content.
    • Add more info and concrete examples about writing secure dash apps with MarkdownAIO
    • Add examples for front-matter in Markdown files.
    • how to escape three back tick code fences in the docs
    • how to escape the {% include myfile.py %} in docs
  • Feature Request - Add Markdown files to hot reload in dash.
    That way users can have the same hot-reloading dev experience when working in markdown. Pull request in Dash.

  • Feature request- Be able to use different sub-components.
    Use-case is to use Prism from the dash-mantine-componets library to display code.

  • Feature request - Be able to change defaults globally so it doesn't have to be done for each MarkdownAIO() instance.

@AnnMarieW AnnMarieW pinned this issue Feb 10, 2022
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