From c468ea92b0a8e409db94ab175804a2e7a92e9459 Mon Sep 17 00:00:00 2001 From: Gregory Soutade Date: Mon, 19 May 2014 18:20:25 +0200 Subject: [PATCH] Add inline image in Markdown syntax Change default font for my blog --- dynastie/generators/markdown2.py | 19 ++++++-- dynastie/sites/blog.soutade.fr/_ljdc.xml | 6 +++ dynastie/sites/blog.soutade.fr/css/blog.css | 54 +++++++++++++++------ dynastie/templates/add_post.html | 1 + dynastie/templates/edit_post.html | 1 + 5 files changed, 62 insertions(+), 19 deletions(-) diff --git a/dynastie/generators/markdown2.py b/dynastie/generators/markdown2.py index dafa409..fe3bcaa 100755 --- a/dynastie/generators/markdown2.py +++ b/dynastie/generators/markdown2.py @@ -1118,6 +1118,11 @@ class Markdown(object): if is_img: start_idx -= 1 + is_inline_img = start_idx > 0 and text[start_idx-1] == "#" + if is_inline_img: + start_idx -= 1 + is_img = 1 + url, title = match.group("url"), match.group("title") if url and url[0] == '<': url = url[1:-1] # '' -> 'url' @@ -1133,10 +1138,16 @@ class Markdown(object): else: title_str = '' if is_img: - result = '%s + + 84208887361 +
http://thecodinglove.com/post/84208887361/when-the-intern-modifies-my-code
+ when the intern modifies my code + http://i.imgur.com/8jw2zLm.gif +
83611569882
http://thecodinglove.com/post/83611569882/when-its-finally-time-to-leave-work
diff --git a/dynastie/sites/blog.soutade.fr/css/blog.css b/dynastie/sites/blog.soutade.fr/css/blog.css index 582c056..45be0a8 100755 --- a/dynastie/sites/blog.soutade.fr/css/blog.css +++ b/dynastie/sites/blog.soutade.fr/css/blog.css @@ -42,7 +42,7 @@ div.body z-index:12; display:inline; color:black; - font-family: Verdana,Geneva,Arial,Helvetica,Sans-Serif; + font-family: Sans-Serif; font-size: 50px; padding-left:180px; } @@ -97,7 +97,7 @@ div.menu div.menu_content div.menu div.menu_content div.menu_content_header { - font-family: Tahoma,Arial,Helvetica,Sans-Serif; + font-family: Sans-Serif; font-size: 17px; background-image: url("/images/BlockHeaderIcon.png"); background-repeat: no-repeat; @@ -114,7 +114,7 @@ div.menu div.menu_content div.menu_content_content div.menu_content_content a { - font-family: Tahoma,Arial,Helvetica,Sans-Serif; + font-family: Sans-Serif; color: #5e6a34; font-weight: normal; font-style: normal; @@ -122,7 +122,7 @@ div.menu_content_content a div.menu div.menu_content div.menu_content_content a:link { - font-family: Tahoma,Arial,Helvetica,Sans-Serif; + font-family: Sans-Serif; color: #5e6a34; font-weight: normal; font-style: normal; @@ -130,7 +130,7 @@ div.menu div.menu_content div.menu_content_content a:link div.menu div.menu_content div.menu_content_content a:hover { - font-family: Tahoma,Arial,Helvetica,Sans-Serif; + font-family: Sans-Serif; color: #5e6a34; font-weight: normal; font-style: normal; @@ -146,6 +146,11 @@ div.menu div.menu_content div.menu_content_content li list-style-image: url("/images/BlockContentBullets.png"); } +div.menu a img +{ + display:inline; +} + div.footer { width:100%; @@ -163,7 +168,7 @@ div.post div.post div.post_header { display:block; - font-family: Tahoma,Arial,Helvetica,Sans-Serif; + font-family: Sans-Serif; color: #3c3e2d; padding-bottom:5px; } @@ -185,7 +190,7 @@ div.post div.post_header div.title text-align:left; text-indent:0; line-height:inherit; - font-family: Verdana, Geneva, Arial, Helvetica, Sans-Serif; + font-family: Sans-Serif; font-size: 26px; color: #181B0D; } @@ -207,7 +212,7 @@ div.post_header div.title > a text-align:left; text-indent:0; line-height:inherit; - font-family: Verdana, Geneva, Arial, Helvetica, Sans-Serif; + font-family: Sans-Serif; font-size: 26px; color: #181B0D; } @@ -229,7 +234,7 @@ div.post_header div.title > a:hover text-align:left; text-indent:0; line-height:inherit; - font-family: Verdana, Geneva, Arial, Helvetica, Sans-Serif; + font-family: Sans-Serif; font-size: 26px; color: #181B0D; } @@ -259,7 +264,7 @@ div.post_header div.post_sub_header > div.author_icon div.author div.post_header div.post_sub_header div.date { display:inline; - font-family: Tahoma,Arial,Helvetica,Sans-Serif; + font-family: Sans-Serif; background-image: url('/images/dateicon.png'); background-repeat: no-repeat; background-position: left center; @@ -270,7 +275,7 @@ div.post div.post_content { display:block; margin-top:1%; - font-family: Tahoma, Arial, Helvetica, Sans-Serif; + font-family: Sans-Serif; color: #171811; } @@ -318,11 +323,30 @@ div.navigation a, a:link, a:hover { - font-family: Tahoma,Arial,Helvetica,Sans-Serif; + font-family: Sans-Serif; color: #818f00; text-decoration:none; } +a img +{ + margin-left: auto; + margin-right: auto; + display:block; +} + +.inlineimage +{ + display:inline; + margin-right: 50px; +} + +a .inlineimage +{ + display:inline; + margin-right: 50px; +} + h1, h2, h3, h4, h5, h6, h1 a, h2 a, h3 a, h4 a, h5 a, h6 a h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover h1 a:visited, h2 a:visited, h3 a:visited, h4 a:visited, h5 a:visited, h6 a:visited { font-weight: normal; @@ -331,7 +355,7 @@ h1, h2, h3, h4, h5, h6, h1 a, h2 a, h3 a, h4 a, h5 a, h6 a h1 a:hover, h2 a:hove h1, h1 a, h1 a:link, h1 a:visited, h1 a:hover { - font-family: Verdana,Geneva,Arial,Helvetica,Sans-Serif; + font-family: Sans-Serif; padding-top:20px; font-size: 28px; color: #818f00; @@ -339,7 +363,7 @@ h1, h1 a, h1 a:link, h1 a:visited, h1 a:hover h2, h2 a, h2 a:link, h2 a:visited, h2 a:hover { - font-family: Verdana,Geneva,Arial,Helvetica,Sans-Serif; + font-family: Sans-Serif; padding-top:18px; font-size: 26px; color: #8c9d4d; @@ -347,7 +371,7 @@ h2, h2 a, h2 a:link, h2 a:visited, h2 a:hover h3, h3 a, h3 a:link, h3 a:visited, h3 a:hover { - font-family: Verdana,Geneva,Arial,Helvetica,Sans-Serif; + font-family: Sans-Serif; padding-top:15px; font-size: 21px; color: #65684b; diff --git a/dynastie/templates/add_post.html b/dynastie/templates/add_post.html index 05909a8..a9321b8 100755 --- a/dynastie/templates/add_post.html +++ b/dynastie/templates/add_post.html @@ -65,6 +65,7 @@ Available tags:
  • Second element
    ![Picture](https://bits.wikimedia.org/images/wikimedia-button.png)
    Picture
    +
    #[Inline Picture](https://bits.wikimedia.org/images/wikimedia-button.png)
    Picture
    [Link](http://www.wikipedia.org)
    Link

    diff --git a/dynastie/templates/edit_post.html b/dynastie/templates/edit_post.html index 70ad474..3971bf2 100755 --- a/dynastie/templates/edit_post.html +++ b/dynastie/templates/edit_post.html @@ -77,6 +77,7 @@ Available tags:
  • Second element
    ![Picture](https://bits.wikimedia.org/images/wikimedia-button.png)
    Picture
    +
    #[Inline Picture](https://bits.wikimedia.org/images/wikimedia-button.png)
    Picture
    [Link](http://www.wikipedia.org)
    Link