From a017996aba0d14db7b4b95ec273a56bc8c1f2bd7 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Fri, 31 Aug 2012 09:02:54 -0500 Subject: [PATCH] yet better markmin has [[NEWLINE]], thanks Vladyslav --- VERSION | 2 +- applications/admin/languages/default.py | 15 ++ gluon/contrib/markmin/markmin2html.py | 232 +++++++++++++++--------- gluon/dal.py | 5 - gluon/tests/__init__.py | 1 + 5 files changed, 160 insertions(+), 95 deletions(-) diff --git a/VERSION b/VERSION index a684f03d..edc6d4fa 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.0.3 (2012-08-31 00:31:48) stable +Version 2.0.3 (2012-08-31 09:02:48) stable diff --git a/applications/admin/languages/default.py b/applications/admin/languages/default.py index beeff162..88f8dde5 100644 --- a/applications/admin/languages/default.py +++ b/applications/admin/languages/default.py @@ -33,6 +33,7 @@ 'created by': 'created by', 'crontab': 'crontab', 'currently running': 'currently running', +'currently saved or': 'currently saved or', 'database administration': 'database administration', 'Debug': 'Debug', 'defines tables': 'defines tables', @@ -43,17 +44,22 @@ 'Detailed traceback description': 'Detailed traceback description', 'direction: ltr': 'direction: ltr', 'Disable': 'Disable', +'docs': 'docs', 'download layouts': 'download layouts', 'download plugins': 'download plugins', 'Edit': 'Edit', 'Edit application': 'Edit application', +'edit views:': 'edit views:', +'Editing file "%s"': 'Editing file "%s"', 'Error snapshot': 'Error snapshot', 'Error ticket': 'Error ticket', 'Errors': 'Errors', 'Exception instance attributes': 'Exception instance attributes', 'exposes': 'exposes', +'exposes:': 'exposes:', 'extends': 'extends', 'file does not exist': 'file does not exist', +'file saved on %s': 'file saved on %s', 'filter': 'filter', 'Frames': 'Frames', 'Get from URL:': 'Get from URL:', @@ -64,8 +70,10 @@ 'inspect attributes': 'inspect attributes', 'Install': 'Install', 'Installed applications': 'Installed applications', +'Key bindings': 'Key bindings', 'languages': 'languages', 'Languages': 'Languages', +'Last saved on:': 'Last saved on:', 'loading...': 'loading...', 'locals': 'locals', 'Login': 'Login', @@ -89,10 +97,15 @@ 'Reload routes': 'Reload routes', 'request': 'request', 'response': 'response', +'restore': 'restore', +'revert': 'revert', 'rules are not defined': 'rules are not defined', 'rules:': 'rules:', "Run tests in this file (to run all files, you may also use the button labelled 'test')": "Run tests in this file (to run all files, you may also use the button labelled 'test')", 'Running on %s': 'Running on %s', +'Save': 'Save', +'Save via Ajax': 'Save via Ajax', +'Saved file hash:': 'Saved file hash:', 'session': 'session', 'shell': 'shell', 'Site': 'Site', @@ -110,7 +123,9 @@ 'These files are served without processing, your images go here': 'These files are served without processing, your images go here', 'Ticket ID': 'Ticket ID', 'Ticket Missing': 'Ticket Missing', +'to previous version.': 'to previous version.', 'To create a plugin, name a file/folder plugin_[name]': 'To create a plugin, name a file/folder plugin_[name]', +'toggle breakpoint': 'toggle breakpoint', 'Traceback': 'Traceback', 'Translation strings for the application': 'Translation strings for the application', 'Uninstall': 'Uninstall', diff --git a/gluon/contrib/markmin/markmin2html.py b/gluon/contrib/markmin/markmin2html.py index e0b955e2..e1f365c0 100755 --- a/gluon/contrib/markmin/markmin2html.py +++ b/gluon/contrib/markmin/markmin2html.py @@ -1,4 +1,4 @@ -#!/bin/env python +#!/usr/bin/env python # -*- coding: utf-8 -*- # created by Massimo Di Pierro # recreated by Vladyslav Kozlovskyy @@ -44,8 +44,8 @@ from markmin2pdf import markmin2pdf # requires pdflatex print markmin2pdf(m) `` ==================== -# This is a test block with new features: - +# This is a test block + with new features: This is a blockquote with a list with tables in it: ----------- @@ -71,7 +71,9 @@ a list with tables in it: -----------:blockquoteclass[blockquoteid] This this a new paragraph -with a table. Table has header, footer, sections, odd and even rows: +with a followed table. +Table has header, footer, sections, +odd and even rows: ------------------------------- **Title 1**|**Title 2**|**Title 3** ============================== @@ -98,6 +100,8 @@ Now lists can be multilevel: You can continue item text on next strings +. paragraph in an item + ++. Ordered item 1 of sublevel 2 with a paragraph (paragraph can start with point after plus or minus @@ -143,13 +147,13 @@ line 1 line 2 line 3 `` -++++. Yet another item with code block: -`` +++++. Yet another item with code block (we need to indent \`\` to add code block as part of item): + `` line 1 line 2 line 3 `` -This item finishes with this paragraph. + This item finishes with this paragraph. ... Item in sublevel 3 can be continued with paragraphs. @@ -201,7 +205,7 @@ We wanted a markup language with the following requirements: - support table, ul, ol, code - support html5 video and audio elements (html serialization only) - can align images and resize them -- can specify class for tables and code elements +- can specify class for tables, blockquotes and code elements - can add anchors - does not use _ for markup (since it creates odd behavior) - automatically links urls @@ -420,6 +424,23 @@ generates (the ``!`!`...`!`!:custom`` block is rendered by the ``custom=lambda`` function passed to ``render``). +### Line breaks + +``[[NEWLINE]]`` tag is used to break lines: +`` +#### Multiline [[NEWLINE]] + title +paragraph [[NEWLINE]] +with breaks[[NEWLINE]]in it +`` +generates: + +#### Multiline [[NEWLINE]] + title +paragraph [[NEWLINE]] +with breaks[[NEWLINE]]in it + + ### Html5 support Markmin also supports the