TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Markdown.css – make HTML look like plain-text

420 点作者 mrcoles超过 12 年前

24 条评论

samwillis超过 12 年前
Firstly this is awsome!<p>As much as I like kittens... This adds the markdown for images too:<p><pre><code> .markdown img { display: inline; content: ""; } .markdown img:before { content: "![" attr(alt) "](" attr(src) ")"; display: inline; color: #333333; } </code></pre> The trick to make it work with images is the `content: "";` on the img element to stop the browser from treating it as an image.<p>EDIT:<p>See it here: <a href="http://jsfiddle.net/F2mjs/" rel="nofollow">http://jsfiddle.net/F2mjs/</a><p>Anyone know how to make the link clickable?
评论 #5214254 未加载
评论 #5214166 未加载
评论 #5214164 未加载
评论 #5214567 未加载
almost超过 12 年前
This is cool :) I do a similar thing on my site[1]to make it look like Org-mode files (which is what I use to write it). I enjoy the fact that so much processing goes into making it look just like it did to begin with :p<p>1: <a href="http://almostobsolete.net" rel="nofollow">http://almostobsolete.net</a>
kilovoltaire超过 12 年前
very clever, particularly how the width of the equals signs below an h1 is made to match the text width using hidden overflow:<p><a href="https://github.com/mrcoles/markdown-css/blob/0d00981143172aad4f9939f6deed8106ca4000b5/markdown.css#L61" rel="nofollow">https://github.com/mrcoles/markdown-css/blob/0d00981143172aa...</a>
评论 #5213842 未加载
评论 #5214118 未加载
TwistedWeasel超过 12 年前
It's interesting and seems well implemented but I don't understand the use case? Why would you need this?<p>If you want plain text inside HTML isn't what the &#60;pre&#62; tag is for?
评论 #5213995 未加载
评论 #5214295 未加载
评论 #5214171 未加载
评论 #5214653 未加载
评论 #5214062 未加载
评论 #5213990 未加载
kmf超过 12 年前
This is awesome. Projects like this make me appreciate the fortitude of Markdown. John has made a project that essentially got it right on the first try[1], with very few patches or additions. In a world of software development where I'm running `gem update` <i>all</i> the time, it's nice to have something like Markdown which really knocked it out of the park in one try. I don't have to check the docs to know if the syntax for URL linking changed, and <i>your</i> implementation isn't going to be any different from mine. It's nice to have a standard like that everyone can rally behind.<p>[1]: I'm aware of projects like MMD, which AFAIK are primarily add-ons to the original Markdown syntax. I also realize that Markdown isn't perfect: Jeff Atwood has a good write-up on this from late 2009 -- <a href="http://www.codinghorror.com/blog/2009/12/responsible-open-source-code-parenting.html" rel="nofollow">http://www.codinghorror.com/blog/2009/12/responsible-open-so...</a>
leeoniya超过 12 年前
shameless plug: client-side (or node) html &#62; markdown, like <i>actual</i> conversion<p>demo: <a href="http://leeoniya.github.com/reMarked.js/" rel="nofollow">http://leeoniya.github.com/reMarked.js/</a><p>repo: <a href="https://github.com/leeoniya/reMarked.js" rel="nofollow">https://github.com/leeoniya/reMarked.js</a>
评论 #5217573 未加载
评论 #5214574 未加载
评论 #5215907 未加载
kzrdude超过 12 年前
I still wonder why Markdown is so popular while reStructuredText is not. I find the latter much easier to read, it looks better in both plain and rendered format (and rst2pdf makes nice docs).
评论 #5214986 未加载
评论 #5215089 未加载
评论 #5218978 未加载
kevinburke超过 12 年前
Heh, I did something a year ago to do the opposite - take a plain markdown file and give it some styles.<p><a href="http://kevinburke.bitbucket.org/markdowncss/" rel="nofollow">http://kevinburke.bitbucket.org/markdowncss/</a><p>HN discussion: <a href="http://news.ycombinator.com/item?id=2827892" rel="nofollow">http://news.ycombinator.com/item?id=2827892</a>
Foomandoonian超过 12 年前
Same as ReMarkdown? <a href="http://fvsch.com/code/remarkdown/" rel="nofollow">http://fvsch.com/code/remarkdown/</a>
评论 #5215913 未加载
molf超过 12 年前
Pretty cool. Would it also be possible to include the markdown markup when copying the text?
评论 #5213964 未加载
评论 #5213979 未加载
danso超过 12 年前
Finally. A proper use-case for displaying content with the :before selector.
评论 #5214187 未加载
评论 #5215357 未加载
评论 #5215649 未加载
评论 #5218088 未加载
sgt超过 12 年前
I think could be interesting for Phrack as they are (or should be) modernizing their e-zine format.<p>In that way, the old school boys can still keep their pure-ASCII, and others may wish to apply some other CSS to make it more pleasant to read.
unfoldedorigami超过 12 年前
Just submitted a pull request to auto-increment the ordered list numbering so it doesn't repeat 1. over and over.<p><a href="https://github.com/mrcoles/markdown-css/pull/4" rel="nofollow">https://github.com/mrcoles/markdown-css/pull/4</a>
评论 #5215776 未加载
dfc超过 12 年前
This is nice. The one use case its missing for me is copy/paste with formatting. Currently I use:<p><pre><code> $ pandoc -f html -t markdown http://example.org/page.htm &#62; page.mdwn</code></pre>
dergachev超过 12 年前
If you're interested in this, you should also know about Showdown.js, a library that converts markdown into HTML client-side: <a href="https://github.com/coreyti/showdown" rel="nofollow">https://github.com/coreyti/showdown</a><p>For an example use, view the source of <a href="http://dergachev.github.com/pin-screenshot-bookmarklet" rel="nofollow">http://dergachev.github.com/pin-screenshot-bookmarklet</a>
lanna超过 12 年前
I'm much better at HTML than Markdown. I totally could use this when I'm forced to write Markdown.
评论 #5214623 未加载
president超过 12 年前
Awesome project. Is there anything that can actually convert HTML to Markdown though?
评论 #5214100 未加载
评论 #5214076 未加载
评论 #5214082 未加载
vysakh0超过 12 年前
Pretty neat and cool! Seeing this i got reminded how awesome markdown is and i just played around with my vim markdown plugin after long time.
mzs超过 12 年前
Cool, but the numbered list has everything lablled as '1.' for me: ff esr 10.0.12
评论 #5214431 未加载
评论 #5214402 未加载
drcoopster超过 12 年前
I find this clever. Use cases aside, it's fun.
wyck超过 12 年前
I don't understand this, Markdown is meant for writing.<p>Why don't you just output real markdown with something like Jekyll, Markdown Server (node) or Showdown?
评论 #5215351 未加载
asimjalis超过 12 年前
This is hilarious. Thank you :)
67726e超过 12 年前
Just curious, but what version of Opera did you get `:before` &#38; `:after` working on? I was just trying this out on the latest Opera and couldn't get it to work.
评论 #5214184 未加载
huhsamovar超过 12 年前
Does anybody else think we've come full circle now?<p>I don't see how this is at all useful. Just upload a .md file.