From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Alexander Subject: [PATCH] org-export-generic table exporting Date: Tue, 7 Feb 2012 23:44:42 -0500 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=20cf3071c910d244b304b86c8df4 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:53730) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RuzOh-0008LV-F3 for emacs-orgmode@gnu.org; Tue, 07 Feb 2012 23:44:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RuzOf-0003p1-PD for emacs-orgmode@gnu.org; Tue, 07 Feb 2012 23:44:47 -0500 Received: from caiajhbdcbhh.dreamhost.com ([208.97.132.177]:52169 helo=homiemail-a97.g.dreamhost.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RuzOf-0003oe-BV for emacs-orgmode@gnu.org; Tue, 07 Feb 2012 23:44:45 -0500 Received: from homiemail-a97.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a97.g.dreamhost.com (Postfix) with ESMTP id 1BC56286020 for ; Tue, 7 Feb 2012 20:44:43 -0800 (PST) Received: from mail-vx0-f169.google.com (mail-vx0-f169.google.com [209.85.220.169]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: tomalexander@paphus.com) by homiemail-a97.g.dreamhost.com (Postfix) with ESMTPSA id DDCF228600D for ; Tue, 7 Feb 2012 20:44:42 -0800 (PST) Received: by vcbf13 with SMTP id f13so129780vcb.0 for ; Tue, 07 Feb 2012 20:44:42 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --20cf3071c910d244b304b86c8df4 Content-Type: text/plain; charset=UTF-8 I noticed that the org-export-generic.el script had options for basic features like checkboxes but not for tables, which were locked into ascii exporting. The attached patch creates many variables to allow users to change the table formatting (much like how there are variables like ":body-list-checkbox-done"). I also created a generic exporter named "mediawiki" that demonstrates use of the table exporting. This is my first post to this mailing list, and my first ever contribution to an open-source project so I look forward to feedback and be kind when you point out any sort of mailing list etiquette I might have broken. -- Tom Alexander HS - Secretary Alpha Sigma Phi; Beta Psi Chapter Rensselaer Polytechnic Institute Class of 2013 --20cf3071c910d244b304b86c8df4 Content-Type: text/x-patch; charset=UTF-8; name="table_exporting.patch" Content-Disposition: attachment; filename="table_exporting.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gydvja0y0 RnJvbSA2ZTA3MmQ5N2QwNTZjYjYxZmM3ODEwYjhiOWZlYTQzZDNjZjk0ODllIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBUb20gQWxleGFuZGVyIDxjcmFmdGtpbGxlckBnbWFpbC5jb20+ CkRhdGU6IFR1ZSwgNyBGZWIgMjAxMiAyMDoxNToyOSAtMDUwMApTdWJqZWN0OiBbUEFUQ0hdIEFk ZGVkIHZhcmlhYmxlcyBmb3IgZXhwb3J0aW5nIHRhYmxlcyBpbmNsdWRpbmc6ICAgLQogYm9keS10 YWJsZS1zdGFydCAgIC0gYm9keS10YWJsZS1lbmQgICAtCiBib2R5LXRhYmxlLXJvdy1zdGFydCAg IC0gYm9keS10YWJsZS1yb3ctZW5kICAgLQogYm9keS10YWJsZS1jZWxsLXN0YXJ0ICAgLSBib2R5 LXRhYmxlLWNlbGwtZW5kICAgLQogYm9keS10YWJsZS1maXJzdC1jZWxsLXN0YXJ0ICAgLQogYm9k eS10YWJsZS1pbnRlcmlvci1jZWxsLXN0YXJ0ICAgLQogYm9keS10YWJsZS1pbnRlcmlvci1jZWxs LWVuZCAgIC0gYm9keS10YWJsZS1sYXN0LWNlbGwtZW5kICAKIC0gYm9keS10YWJsZS1obGluZS1z dGFydCAgIC0gYm9keS10YWJsZS1obGluZS1lbmQKCkFkZGVkIGEgbWVkaWF3aWtpIGV4cG9ydGVy IHdoaWNoIHVzZXMgdGhlIG5ldyB0YWJsZSBleHBvcnRpbmcKLS0tCiBjb250cmliL2xpc3Avb3Jn LWV4cG9ydC1nZW5lcmljLmVsIHwgICA4NyArKysrKysrKysrKysrKysrKysrKysrKysrKysrKysr KystLQogMSBmaWxlcyBjaGFuZ2VkLCA4MiBpbnNlcnRpb25zKCspLCA1IGRlbGV0aW9ucygtKQoK ZGlmZiAtLWdpdCBhL2NvbnRyaWIvbGlzcC9vcmctZXhwb3J0LWdlbmVyaWMuZWwgYi9jb250cmli L2xpc3Avb3JnLWV4cG9ydC1nZW5lcmljLmVsCmluZGV4IDQzNmJhZGMuLjllMjE5OTIgMTAwNjQ0 Ci0tLSBhL2NvbnRyaWIvbGlzcC9vcmctZXhwb3J0LWdlbmVyaWMuZWwKKysrIGIvY29udHJpYi9s aXNwL29yZy1leHBvcnQtZ2VuZXJpYy5lbApAQCAtMzI1LDYgKzMyNSw1MSBAQCBpbiB0aGlzIHdh eSwgaXQgd2lsbCBiZSB3cmFwcGVkLiIKICAgICAgOmJvZHktYnVsbGV0LWxpc3QtcHJlZml4ICAg ICAgICgiKiAiICIqKiAiICIqKiogIiAiKioqKiAiICIqKioqKiAiKQogICAgICApCiAgICAgOzsK KyAgICA7OyBtZWRpYXdpa2kKKyAgICA7OworICAgICgibWVkaWF3aWtpIgorICAgICA6ZmlsZS1z dWZmaXggICAgICAgIAkgICAgIi50eHQiCisgICAgIDprZXktYmluZGluZyAgICAgICAgICAgICAg ICAgICA/bQorCisgICAgIDpoZWFkZXItcHJlZml4ICAgICAgICAgICAgCSAgICAiIgorICAgICA6 aGVhZGVyLXN1ZmZpeCAgICAgICAgICAgIAkgICAgIiIKKworICAgICA6dGl0bGUtZm9ybWF0ICAg ICAgICAgICAgIAkgICAgIj0gJXMgPVxuIgorCisgICAgIDpkYXRlLWV4cG9ydCAgICAgICAgCSAg ICBuaWwKKworICAgICA6dG9jLWV4cG9ydCAgICAgICAgICAgICAgICAgICAgbmlsCisKKyAgICAg OmJvZHktaGVhZGVyLXNlY3Rpb24tbnVtYmVycyAgIG5pbAorICAgICA6Ym9keS1zZWN0aW9uLXBy ZWZpeCAgICAgICAgICAgIlxuIgorCisgICAgIDpib2R5LXNlY3Rpb24taGVhZGVyLXByZWZpeCAg ICAoIj0gIiAiPT0gIiAiPT09ICIKKwkJCQkgICAgICI9PT09ICIgIj09PT09ICIgIj09PT09PSAi KQorICAgICA6Ym9keS1zZWN0aW9uLWhlYWRlci1zdWZmaXggICAgKCIgPVxuXG4iICIgPT1cblxu IiAiID09PVxuXG4iCisJCQkJICAgICAiID09PT1cblxuIiAiID09PT09XG5cbiIgIiA9PT09PT1c blxuIikKKworICAgICA6Ym9keS1saW5lLWV4cG9ydC1wcmVmb3JtYXRlZCAgdCAgICAgICAgICA7 OyB5ZXMvbm8vbWF5YmU/Pz8KKyAgICAgOmJvZHktbGluZS1mb3JtYXQgICAgICAgICAgICAgICIl c1xuIgorICAgICA6Ym9keS1saW5lLXdyYXAgICAgICAgICAgICAgICAgNzUKKworICAgICA6Ym9k eS1saW5lLWZpeGVkLWZvcm1hdCAgICAgICAiICVzXG4iCisKKyAgICAgOmJvZHktbGlzdC1mb3Jt YXQgICAgICAgICAgICAgICIqICVzXG4iCisgICAgIDpib2R5LW51bWJlci1saXN0LWZvcm1hdCAg ICAgICAiIyAlc1xuIgorCisgICAgIDpib2R5LWJ1bGxldC1saXN0LXByZWZpeCAgICAgICAoIiog IiAiKiogIiAiKioqICIgIioqKiogIiAiKioqKiogIikKKyAgICAgOmJvZHktbGlzdC1jaGVja2Jv eC10b2RvICAgICAgICLimJAgIgorICAgICA6Ym9keS1saXN0LWNoZWNrYm94LWRvbmUgICAgICAg IuKYkiAiCisgICAgIDpib2R5LXRhYmxlLXN0YXJ0ICAgICAgICAgICAgICAie3wiCisgICAgIDpi b2R5LXRhYmxlLWVuZCAgICAg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