[DRE-commits] [ruby-org] 148/303: Property drawer items can include hyphens (e.g. :noweb-ref:) http://orgmode.org/manual/noweb_002dref.html

Jérémy Bobbio lunar at alioth.debian.org
Fri Aug 9 17:33:47 UTC 2013


This is an automated email from the git hooks/post-receive script.

lunar pushed a commit to branch master
in repository ruby-org.

commit 0ddffaf4b4bc1d4f5b650ee58f83c1879fbe88bd
Author: Waldemar Quevedo <waldemar.quevedo at gmail.com>
Date:   Sun Jun 10 22:23:02 2012 +0900

    Property drawer items can include hyphens (e.g. :noweb-ref:)
    http://orgmode.org/manual/noweb_002dref.html
---
 lib/org-ruby/line.rb                      |    2 +-
 spec/html_examples/properties_drawer.html |   33 +++++++++++++++++++++++++
 spec/html_examples/properties_drawer.org  |   37 +++++++++++++++++++++++++++++
 3 files changed, 71 insertions(+), 1 deletion(-)

diff --git a/lib/org-ruby/line.rb b/lib/org-ruby/line.rb
index db6f233..131fda6 100644
--- a/lib/org-ruby/line.rb
+++ b/lib/org-ruby/line.rb
@@ -55,7 +55,7 @@ module Orgmode
       check_assignment_or_regexp(:property_drawer, PropertyDrawerRegexp)
     end
 
-    PropertyDrawerItemRegexp = /^\s*:(\w+):\s*(.*)$/i
+    PropertyDrawerItemRegexp = /^\s*:([0-9A-Za-z_\-]+):\s*(.*)$/i
 
     def property_drawer_item?
       @line =~ PropertyDrawerItemRegexp
diff --git a/spec/html_examples/properties_drawer.html b/spec/html_examples/properties_drawer.html
new file mode 100644
index 0000000..afd0ce1
--- /dev/null
+++ b/spec/html_examples/properties_drawer.html
@@ -0,0 +1,33 @@
+<h1 class="title">The mount point of the fullest disk</h1>
+<h2>query all mounted disks</h2>
+<pre class="src">
+<code class="sh">
+  df \
+</code>
+</pre>
+<h2>strip the header row</h2>
+<pre class="src">
+<code class="sh">
+  <table>
+    <tr><td>sed '1d' \</tr>
+  </table>
+</code>
+</pre>
+<h2>sort by the percent full</h2>
+<pre class="src">
+<code class="sh">
+  <table>
+    <tr><td>awk '{print $5 " " $6}'</td><td>sort -n</td><td>tail -1 \</tr>
+  </table>
+</code>
+</pre>
+<h2>extract the mount point</h2>
+<pre class="src">
+<code class="sh">
+  <table>
+    <tr><td>awk '{print $2}'</tr>
+  </table>
+</code>
+</pre>
+<h1>Properties drawer example</h1>
+<p>These properties are metadata so they should not be visible.</p>
diff --git a/spec/html_examples/properties_drawer.org b/spec/html_examples/properties_drawer.org
new file mode 100644
index 0000000..d267c61
--- /dev/null
+++ b/spec/html_examples/properties_drawer.org
@@ -0,0 +1,37 @@
+# Example taken from the wiki
+# http://orgmode.org/manual/noweb_002dref.html#noweb_002dref
+* The mount point of the fullest disk
+  :PROPERTIES:
+  :noweb-ref: fullest-disk
+  :END:
+
+** query all mounted disks
+#+BEGIN_SRC sh
+  df \
+#+END_SRC
+
+** strip the header row
+#+BEGIN_SRC sh
+  |sed '1d' \
+#+END_SRC
+
+** sort by the percent full
+#+BEGIN_SRC sh
+  |awk '{print $5 " " $6}'|sort -n |tail -1 \
+#+END_SRC
+
+** extract the mount point
+#+BEGIN_SRC sh
+  |awk '{print $2}'
+#+END_SRC
+
+* Properties drawer example
+   :PROPERTIES:
+   :ARCHIVE_TIME: 2009-12-26 Sat 22:16
+   :ARCHIVE_FILE: ~/brians-brain/content/projects/orgmode_parser.org
+   :ARCHIVE_OLPATH: <%= @page.title %>/Future Development
+   :ARCHIVE_CATEGORY: orgmode_parser
+   :ARCHIVE_TODO: DONE
+   :END:
+
+These properties are metadata so they should not be visible.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-org.git



More information about the Pkg-ruby-extras-commits mailing list