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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
360
Playwright can do this?
stefanjudis
0
240
Things you should know about Frontend Development in 2022
stefanjudis
0
550
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
関西に縁あるMicrosoft MVPsが語るCopilotの未来
kasada
0
1.2k
「気づいたら仕事が終わっている」バクラクAIエージェント本番運用の裏側 / layerx-bakuraku-aie2026
yuya4
19
11k
LLMと共に進化するプロセスを目指して
ymatsuwitter
12
3.6k
Terraformモジュールは、なぜ「魔境」化するのか
hayama17
2
220
Dario Amodi『Policy on the AI Exponential』を理解する
nagatsu
0
200
MIERUNE JCT 発表資料「宇宙から伊能忠敬ごっこ」
syuchimu
0
190
サプライチェーンセキュリティの空白地帯 - 信頼できる”依存性”の未来を考える
rung
PRO
2
780
AI Adaptable なテストを整える工夫 / Ways to Make Your Tests AI-Adaptable
bitkey
PRO
3
220
protovalidate-es を導入してみた
bengo4com
0
150
新しいVibe Codingと”自走”について
watany
5
110
実装は速くなった、レビューはどうする? ― 自身のレビューをAIで再現させるサーヴァントエンジニアリングのすゝめ / Implementation got faster. So what about reviews? — An invitation to Servant Engineering: Recreating your own code reviews with AI
nrslib
7
4.2k
Mastering Ruby Box
tagomoris
3
150
Featured
See All Featured
Optimizing for Happiness
mojombo
378
71k
Side Projects
sachag
455
43k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
400
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
820
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.4k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.3k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
250
Rebuilding a faster, lazier Slack
samanthasiow
85
9.5k
Unsuck your backbone
ammeep
672
58k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
210
A better future with KSS
kneath
240
18k
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