-
Notifications
You must be signed in to change notification settings - Fork 149
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
content: investigate markdown display options #1311
Comments
Concept-wise we should consider (at least) following:
After we have list of suitable Flask extensions to use or if we decide to implement something simple on our own, we should consider following:
|
Quick comments to the points you raised:
|
IMHO we should also consider client-side rendering since in the future we might add a live editing tool (WYSIWYG style), so the editor and the previewer should not have any conflicts/differences on rendering. Any thoughts on this? |
@pamfilos The WYSIWIG editing tool would be the "live installation" use case, with rich Markdown-aware deposit UI, that I was mentioning in my last point. This will come later, so far GitHub PRs should be enough for all editing needs. Anyway, I see two things. Firstly, hopefully we can standardise on a very easy Markdown flavour that would be displayable both client-side and server-side without too much differences. Secondly, if we need some obscure Markdown flavour, then any client-side vs server-side rendering differences may be alleviated if the deposit UI simply makes Ajax calls to preview user-supplied Markdown... |
So far I have been looking into Flask-Markdown and Flask-Mistune. I made a PR #1335 which includes both implementations In addition to py-gfm, I also found another python-markdown extension that tries to mimic GFM-syntax: http://facelessuser.github.io/pymdown-extensions/extensions/github/ Mistune didn't support pygments style code highlighting out-of-the-box so based on couple of examples I threw together a custom rendered and formatter for pygments and configured Flask-Mistune to use those. All of the examples are using safe-filter provided by Jinja to escape HTML. I also though of using meta-extensions for MultiMarkdown (https://github.com/fletcher/MultiMarkdown/wiki/MultiMarkdown-Syntax-Guide), but as usual that should be first tested that it doesn't mess up with GFM extensions. Shouldn't mess up anything, but should be tested first. I'm not sure if we want to support relative linking, but we might run into trouble if we do so. I don't know how markdown-parsers or client browsers will react to the use of relative links in markdown-files. |
* moves created markdown page examples to fixture data * removes ‘/md’ views * updates article schema to accept md/html body content * amends article ‘detail’ for changes * closes cernopendata#1311 Signed-off-by: Pamfilos Fokianos <[email protected]>
* moves created markdown page examples to fixture data * removes ‘/md’ views * updates article schema to accept md/html body content * amends article ‘detail’ for changes * closes cernopendata#1311 Signed-off-by: Pamfilos Fokianos <[email protected]>
* moves created markdown page examples to fixture data * removes ‘/md’ views * updates article schema to accept md/html body content * amends article ‘detail’ for changes * closes cernopendata#1311 Signed-off-by: Pamfilos Fokianos <[email protected]>
The source code of some static template pages (=guides) or of some dynamic record pages (=news articles) might be written in the Markdown format rather than HTML.
This ticket is about investigating available tools that could help us in displaying Markdown-authored pages in the COD3 ecosystem.
For example, check
Flask-Markdown
extensions that would permit to write Flask templates not in Jinja, but in Markdown.For example, check
pandoc
tools that would read Article record body in Markdown from the DB and render them to users in HTML. (Later, a user could deposit articles via UI, so having a Markdown previewer plugged in the deposit form will also be interesting... but that will come later.)Remember to investigate both scenarios, rendering static guides and rendering dynamic records.
The text was updated successfully, but these errors were encountered: