[FEATURE] Allow writing html with `markdown`
See original GitHub issueIt 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).
- Custom GitHub markdown css: https://github.com/sindresorhus/github-markdown-css
➡️ 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:
- Created a year ago
- Reactions:2
- Comments:5 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think it’s a great proposal and probably a component that should be in core…
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!