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

Support rendering of indented markdown #828

Closed
MarcSkovMadsen opened this issue Dec 1, 2019 · 1 comment
Closed

Support rendering of indented markdown #828

MarcSkovMadsen opened this issue Dec 1, 2019 · 1 comment
Labels
type: discussion Requiring community discussion
Milestone

Comments

@MarcSkovMadsen
Copy link
Collaborator

MarcSkovMadsen commented Dec 1, 2019

I would really like to be able to easily use Markdown in Panel because it's so easy to write content with text, images and code and get a beautiful looking pages back.

But in Panel there are some pains to using Markdown. One pain is that indentation of markdown text is not supported.

When I write a longer markdown text in a python file in my editor (VS Code), then the default "python indentation" is not handled by pn.pane.Markdown. It's easist to understand from the code and images below.

image

image

I would like a solution where indented text is rendered nicely. For example by removing leading spaces/ tabs from the text.

A solution like this would lower the friction to using Panel.

Streamlit does this.

The code is here

import panel as pn


def main():
    text_error = """
    This is not formatted correctly by Markdown due to the indentation!"""
    text_ok = """
This is formatted correctly by Markdown!
"""
    app = pn.Column(
        pn.pane.Markdown(text_error),
        pn.pane.HTML("<hr>", sizing_mode="stretch_width"),
        pn.pane.Markdown(text_ok),
    )
    app.servable()


main()
@MarcSkovMadsen MarcSkovMadsen added the TRIAGE Default label for untriaged issues label Dec 1, 2019
@philippjfr philippjfr added type: discussion Requiring community discussion and removed TRIAGE Default label for untriaged issues labels Dec 3, 2019
@philippjfr philippjfr added this to the v0.7.1 milestone Dec 18, 2019
@philippjfr philippjfr modified the milestones: v0.7.1, v0.8.0 Jan 16, 2020
@MarcSkovMadsen
Copy link
Collaborator Author

I can confirm this works with the latest release candidate for Panel 0.8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: discussion Requiring community discussion
Projects
None yet
Development

No branches or pull requests

2 participants