Class Orgmode::Line
In: lib/org-ruby/line.rb
Parent: Object

Represents a single line of an orgmode file.

Methods

Constants

PropertyDrawerRegexp = /^\s*:(PROPERTIES|END):/i
PropertyDrawerItemRegexp = /^\s*:([0-9A-Za-z_\-]+):\s*(.*)$/i
UnorderedListRegexp = /^\s*(-|\+|\s+[*])\s+/
DefinitionListRegexp = /^\s*(-|\+|\s+[*])\s+(.*\s+|)::($|\s+)/
OrderedListRegexp = /^\s*\d+(\.|\))\s+/
HorizontalRuleRegexp = /^\s*-{5,}\s*$/
BlockRegexp = /^\s*#\+(BEGIN|END)_(\w*)\s*([0-9A-Za-z_\-]*)?\s*([^\":\n]*\"[^\"\n*]*\"[^\":\n]*|[^\":\n]*)?\s*([^\n]*)?/i   1) block delimiters 2) block type (src, example, html…) 3) switches (e.g. -n -r -l "asdf") 4) header arguments (:hello world)
InlineExampleRegexp = /^\s*:\s/
RawTextRegexp = /^(\s*)#\+(\w+):\s*/
InBufferSettingRegexp = /^#\+(\w+):\s*(.*)$/
ResultsBlockStartsRegexp = /^\s*#\+RESULTS:\s*(.+)?$/i
LinkAbbrevRegexp = /^\s*#\+LINK:\s*(\w+)\s+(.+)$/i
IncludeFileRegexp = /^\s*#\+INCLUDE:\s*"([^"]+)"(\s+([^\s]+)\s+(.*))?$/i

Attributes

assigned_paragraph_type  [RW]  A line can have its type assigned instead of inferred from its content. For example, something that parses as a "table" on its own ("| one | two|\n") may just be a paragraph if it‘s inside #+BEGIN_EXAMPLE. Set this property on the line to assign its type. This will then affect the value of paragraph_type.
indent  [R]  The indent level of this line. this is important to properly translate nested lists from orgmode to textile. TODO 2009-12-20 bdewey: Handle tabs
major_mode  [R]  Major modes associate paragraphs with a table, list and so on.
paragraph_type  [R]  Paragraph type determined for the line.
parser  [R]  Backpointer to the parser that owns this line.
properties  [RW]  In case more contextual info is needed we can put here

Public Class methods

Public Instance methods

TODO: COMMENT block should be considered here

Tests if a line is a comment.

Determines the paragraph type of the current line.

Called without a block, this method determines if the line contains an in-buffer setting. Called with a block, the block will get called if the line contains an in-buffer setting with the key and value for the setting.

Test if the line matches the "inline example" case: the first character on the line is a colon.

Tests if a line contains metadata instead of actual content.

Extracts meaningful text and excludes org-mode markup, like identifiers for lists or headings.

Checks if this line is raw text.

Checks if this line is a table header.

#+TITLE: is special because even though that it can be written many times in the document, its value will be that of the last one

[Validate]