question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[FEATURE] Allow writing html with `markdown`

See original GitHub issue

It will be nice to be able to author a page by just writing it’s contents with markdown.

➡️ Describe the solution you’d like If you could provide an html tag for markdown content: <py-md></py-md>, that could go a long way for easily writing markdown content within the tag.

➡️ Perhaps it could behave as a <div></div> which could render the markdown with GitHub flavored markdown by default and alternatively with some other custom-defined css (either locally maintained or via a CDN).

➡️ Describe alternatives you’ve considered Although you can still include markdown content currently as follows, perhaps a dedicated html tag <py-md></py-md> could make it rather convenient to author with markdown.

<html>
<head>
<py-env>
	- markdown
	- emoji
<py-env>
</head>

<body>
<py-script>
import markdown
import emoji
md_text = f"""\
# Heading 1

This is some test content.

## Heading 2

This is some emoji: {emoji.emojize(":zap:")}

![image](https://user-images.githubusercontent.com/10201242/167243920-46aa83ae-735d-4af6-a841-3d787a7396ce.png)

```python hl_lines="1 3"
import numpy as np

x = np.arange(10)

print(x)
```
"""

html = markdown.markdown(md_text, extensions=['fenced_code', 'codehilite'])
print(html)
</py-script>
</body>
</html>

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
fpligercommented, May 19, 2022

I think it’s a great proposal and probably a component that should be in core…

1reaction
marimeirelescommented, Sep 29, 2022

Yeah we have this half implemented in our code. We need a way to rendering md. Doesn’t seem too complicated to fix, but I guess all of this will undergo redesign. So… Will keep this one open and keep track of it in our output rendering EPIC. Thanks for the issue!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting Started | Markdown Guide
Markdown Here is a free and open-source browser extension that converts Markdown-formatted text into HTML that's ready to send. Collaboration. Collaboration and ...
Read more >
Markdown Syntax Documentation - Daring Fireball
Markdown's syntax is intended for one purpose: to be used as a format for writing for the web. Markdown is not a replacement...
Read more >
The Ultimate Guide to Writing & Publishing with Markdown
Markdown is a plain text formatting syntax for writers. It allows you to quickly write structured content for the web, and have it...
Read more >
Write html tag with Markdown? - syntax highlighting
If you use google-code-prettify, you could do this (I am currently doing this): $(document).ready(function() { $('pre').
Read more >
3.1 HTML document | R Markdown: The Definitive Guide
As we just mentioned before, Markdown was originally designed for HTML output, so it may not be surprising that the HTML format has...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found