markdown-css

CSS for making regular HTML look like plain-text markdown.

Github星跟踪图

Markdown.css

A perverse way to make your HTML look like markdown, purely via CSS.

Use the markdown.css file to make regular HTML look like plain-text markdown. No JavaScript hacks are needed. View the demo to see what I’m talking about.

The styles are written in markdown.less. If you want to hack on this project, you can convert the less files to css with build.sh or run the watch_less.sh script to have it auto-update when the files change.

This is built to support all of the standard markdown elements with a few minor issues.

Issues:

  • repeats for h1, hr, and blockquote use characters that are repeated 100 times, so width greater than 100 characters or a blockquote more than a 100 lines will not be perfect
  • pseudo elements (:before, :after) don’t work with images (except opera), so I didn’t support making images look like markdown

Bookmarklet

Try out the experimental bookmarklet, linked at the bottom of the demo. Created in the bookmarklet generator with the following code and a jquery include:

$('link[rel=stylesheet]').add('style').remove();
$('[style]').attr('style', '');
$('head').append('<link rel="stylesheet" href="http://mrcoles.com/media/test/markdown-css/markdown.css" type="text/css" />');
$('body').addClass('markdown').css({width: '600px', margin: '2em auto', 'word-wrap': 'break-word'});
$('a img').css({'max-height': '1em', 'max-width': '1em'});

主要指标

概览
名称与所有者mrcoles/markdown-css
主编程语言CSS
编程语言Shell (语言数: 3)
平台
许可证MIT License
所有者活动
创建于2013-02-06 06:06:21
推送于2020-10-02 13:12:55
最后一次提交2018-12-15 17:15:08
发布数0
用户参与
星数1.4k
关注者数46
派生数167
提交数43
已启用问题?
问题数10
打开的问题数4
拉请求数4
打开的拉请求数1
关闭的拉请求数3
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?