Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Markdown, my friend – we have to talk
Search
stefan judis
September 11, 2018
Technology
750
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Markdown, my friend – we have to talk
stefan judis
September 11, 2018
More Decks by stefan judis
See All by stefan judis
Back to boring (part 2)
stefanjudis
0
370
Playwright can do this?
stefanjudis
0
240
Things you should know about Frontend Development in 2022
stefanjudis
0
560
Throw yourself out there for fun and profit
stefanjudis
0
140
Back to Boring
stefanjudis
1
530
Wanna scale up? Make sure your CMS is ready for it!
stefanjudis
0
280
Did we(b development) lose the right direction?
stefanjudis
6
2.2k
Regular expressions – my secret love
stefanjudis
1
1.1k
Write a Function
stefanjudis
0
620
Other Decks in Technology
See All in Technology
【FinOps】データドリブンな意思決定を目指して
z63d
3
540
Kotlin 開発のツラミを爆破した話! / Explode the difficulty of Kotlin dev!
eller86
0
120
ご挨拶「10周年を迎える共創ラボのこれまでとこれから」
iotcomjpadmin
0
160
なぜ人は自分のプロジェクトを 「なんちゃってアジャイル」と 自嘲するのか
kozotaira
0
200
組織における AI-DLC 実践
askul
0
220
秘密度ラベル初心者が第1歩でつまづかないための「設計・運用」ポイント
seafay
PRO
1
530
スタートアップにおけるアジャイルの実践について #shibuyagile
murabayashi
1
460
Docker Desktop不要の時代が来る? WSL標準の「wslc」で Linuxコンテナを動かしてみた.
ueponx
0
300
そこにあるから地図ができる~位置を示す"モノ"を愉しむ~ - Interface 2026年6月号GPS特集オフ会 / interface_202606_GPS_offline
sakaik
1
140
AWS PrivateLink × SCIM で実現する セキュアで運⽤負荷の低い Databricks 基盤の構築
tsuda7
0
110
“ID沼入口” - 基本とセキュリティから始める、考え続けるためのID管理技術勉強会 告知&イントロ
ritou
0
300
LiDAR SLAMの実装とセンサ融合 ~Lie群からContinuous-Time LIOまで~
naokiakai
1
430
Featured
See All Featured
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.1k
Optimizing for Happiness
mojombo
378
71k
Six Lessons from altMBA
skipperchong
29
4.3k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.2k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
950
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.9k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.4k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
870
ラッコキーワード サービス紹介資料
rakko
1
3.8M
Skip the Path - Find Your Career Trail
mkilby
1
160
The Limits of Empathy - UXLibs8
cassininazir
1
370
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
1.1k
Transcript
@stefanjudis *Markdown, my friend* **We have to talk!**
STEFAN JUDIS @stefanjudis www.stefanjudis.com
[email protected]
None
What have these sites in common?
WYSIWYG
“ I don't want to and feel bad setting up
polluted WYSIWYG editors.
None
Everything is broken!
None
None
It's a mix of content and presentation
Html
Html
Too flexible Too easy to mess up Mixes content and
looks HTML is the goal
You want to limit the user!
Markdown
# Heading ## Sub-heading Text attributes _italic_, **bold**, `monospace`. Bullet
list: * apples * oranges * pears A [link](http://example.com).  Heading Sub-heading Text attributes italic, bold, monospace. Bullet list: - apple - oranges - pears A link.
Inline <abbr title="Hypertext Markup Language">HTML</abbr> is supported. Inline HTML is
supported.
“ The key design goal [of markdown] is readability.
None
None
Markdown is not "feature-complete" ("semantical correct" is not a thing)
# Heading And a paragraph...
# Heading And a paragraph... 
None
Responsive images
// my-markdown-renderer.js import marked from 'marked' export default (text) =>
marked(text);
// my-markdown-renderer.js import marked from 'marked' const renderer = new
marked.Renderer() export default (text) => marked(text, { renderer });
// my-markdown-renderer.js import marked from 'marked' const renderer = new
marked.Renderer() renderer.image = (href, title, text) => { return `<img src="${href}" srcset="https: //images.contentful.com/ .../duck.png?w=100 100w, https: //images.contentful.com/ .../duck.png?w=500 500w, https: //images.contentful.com/ .../duck.png?w1000 1000w" sizes="(min-width: 900px) 1000px, (max-width: 900px) and (min-width: 400px) 50em" alt="${text}">` } export default (text) => marked(text, { renderer });
// my-markdown-renderer.js import marked from 'marked' const renderer = new
marked.Renderer() renderer.image = (href, title, text) => { return `<img src="${href}" srcset="https: //images.contentful.com/ .../duck.png?w=100 100w, https: //images.contentful.com/ .../duck.png?w=500 500w, https: //images.contentful.com/ .../duck.png?w1000 1000w" sizes="(min-width: 900px) 1000px, (max-width: 900px) and (min-width: 400px) 50em" alt="${text}">` } export default (text) => marked(text, { renderer });
# Heading And a paragraph... 
# Heading And a paragraph...  And a paragraph... 
And a paragraph...
# Heading And a paragraph... ??? And a paragraph... 
And a paragraph...
"Video hack"
// my-markdown-renderer.js import marked from 'marked' const renderer = new
marked.Renderer() renderer.image = (href, title, text) => { return `<img src="${href}" srcset="https: //images.contentful.com/ .../duck.png?w=100 100w, https: //images.contentful.com/ .../duck.png?w=500 500w, https: //images.contentful.com/ .../duck.png?w1000 1000w" sizes="(min-width: 900px) 1000px, (max-width: 900px) and (min-width: 400px) 50em" alt="${text}">` } export default (text) => marked(text, { renderer });
// my-markdown-renderer.js import marked from 'marked' const renderer = new
marked.Renderer() renderer.image = (href, title, text) => { if (/\.mp4$/.test(href)) { return ` <video controls preload="metadata"> <source src="${href}" type="video/mp4"> </video> ` } return `<img src="${href}" srcset="https: //images.contentful.com/ .../duck.png?w=100 100w, https: //images.contentful.com/ .../duck.png?w=500 500w, https: //images.contentful.com/ .../duck.png?w1000 1000w" sizes="(min-width: 900px) 1000px, (max-width: 900px) and (min-width: 400px) 50em" alt="${text}">` } export default (text) => marked(text, { renderer });
// my-markdown-renderer.js import marked from 'marked' const renderer = new
marked.Renderer() renderer.image = (href, title, text) => { if (/\.mp4$/.test(href)) { return ` <video controls preload="metadata"> <source src="${href}" type="video/mp4"> </video> ` } return `<img src="${href}" srcset="https: //images.contentful.com/ .../duck.png?w=100 100w, https: //images.contentful.com/ .../duck.png?w=500 500w, https: //images.contentful.com/ .../duck.png?w1000 1000w" sizes="(min-width: 900px) 1000px, (max-width: 900px) and (min-width: 400px) 50em" alt="${text}">` } export default (text) => marked(text, { renderer });
// my-markdown-renderer.js import marked from 'marked' const renderer = new
marked.Renderer() renderer.image = (href, title, text) => { if (/\.mp4$/.test(href)) { return ` <video controls preload="metadata"> <source src="${href}" type="video/mp4"> </video> ` } return `<img src="${href}" srcset="https: //images.contentful.com/ .../duck.png?w=100 100w, https: //images.contentful.com/ .../duck.png?w=500 500w, https: //images.contentful.com/ .../duck.png?w1000 1000w" sizes="(min-width: 900px) 1000px, (max-width: 900px) and (min-width: 400px) 50em" alt="${text}">` } export default (text) => marked(text, { renderer }); Not pretty, but "works"
# Heading And a paragraph...  And a paragraph... 
And a paragraph...
# Heading And a paragraph...  And a paragraph... 
And a paragraph...
# Heading And a paragraph...  And a paragraph... ???
And a paragraph...
# Heading And a paragraph... ???  And a paragraph...
??? And a paragraph...
# Heading And a paragraph... ???  And a paragraph...
??? ??? !!! ??? Duck!
# Heading And a paragraph... ???  And a paragraph...
??? ??? !!! ??? Duck! Markdown is not made for "complex" use cases
Limited functionality Focuses on semantics Easy to grasp
Limited functionality Not powerful enough Editors don't like it HTML
is "allowed"
How can you solve this with Contentful?
www.contentful.com/r/knowledgebase/topics-and-assemblies/
None
Duck!
{ "sys": { "contentType": { "sys": { "id": "page" }
} }, "fields": { "title": "Page", "components": [ { "sys": { "contentType": { "sys": { "id": "chart" } } } } ] }, ... }
{ "sys": { "contentType": { "sys": { "id": "page" }
} }, "fields": { "title": "Page", "components": [ { "sys": { "contentType": { "sys": { "id": "chart" } } } } ] }, ... } <Page> <Chart /> ... </Page>
{ "sys": { "contentType": { "sys": { "id": "page" }
} }, "fields": { "title": "Page", "components": [ { "sys": { "contentType": { "sys": { "id": "chart" } } } } ] }, ... } <Page> <Chart /> ... </Page> Structured data is perfect for a component-driven approach!
www.contentful.com/blog/2017/10/11/love-letter-to-component-ready-cms/
www.youtube.com/watch?v=i17FKTtIifM&t=408s
MDX
“ MDX is Markdown + JSX, bringing the world of
components to Markdown.
import { Chart } from ' ../components/chart' # Here's a
chart The chart is rendered inside our MDX document. <Chart />
www.docz.site
revealjs.com
jxnblk.com/mdx-deck/
None
It's Reveal.js on steroids.
Are these slide made with mdx-deck?
Could this work in Contentful?
Demo
codesandbox.io
www.npmjs.com/package/smooshpack
None
Stefan, you're breaking portability!
Yeah, kinda...
None
Devs will love it Perfect for docs Component-based
Easy to mess up Not made for publishing Needs file
access Breaks portability easily
None
Love it! But it's not suited for our content editing
needs.
A [link](http://example.com).
A [link](http://example.com).
Duck!
Duck! Duck!
Duck! Duck! Duck!
Duck! Duck! Duck! Duck!
Alice! Alice! Alice! Alice!
Alice! Alice! Alice! Alice! That's not possible with hardcoded values.
Back to square one!
None
None
None
None
Structured Text
Demo
None
www.npmjs.com/package/@contentful/structured-text-html-serializer
www.npmjs.com/package/@contentful/structured-text-html-serializer Serializer will be available for common languages
It supports underline Visual interface Fewer content types
Incoming links support Connected editing flow Platform-portable
www.contentful.com/r/knowledgebase/topics-and-assemblies/
www.contentful.com/r/knowledgebase/topics-and-assemblies/ Topics & Assemblies will still be a thing
Proper content modelling stays important!
So, what about the hover-duck? Duck!
Inline references will be possible Duck!
You can sign up for the alpha today. Talk to
me!
THANKS FOR LISTENING @stefanjudis