From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: Extract document structure from Org file Date: Fri, 03 Jul 2015 13:58:27 +0200 Message-ID: <87twtl3124.fsf@gmx.us> References: <87egkpfxe3.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34048) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAzcB-00041Z-3J for emacs-orgmode@gnu.org; Fri, 03 Jul 2015 07:58:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZAzc6-00063p-19 for emacs-orgmode@gnu.org; Fri, 03 Jul 2015 07:58:43 -0400 Received: from plane.gmane.org ([80.91.229.3]:49837) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAzc5-00063e-Qk for emacs-orgmode@gnu.org; Fri, 03 Jul 2015 07:58:37 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZAzc4-0000iJ-Az for emacs-orgmode@gnu.org; Fri, 03 Jul 2015 13:58:36 +0200 Received: from 46.166.188.227 ([46.166.188.227]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 03 Jul 2015 13:58:36 +0200 Received: from rasmus by 46.166.188.227 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 03 Jul 2015 13:58:36 +0200 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 Hi Oleg, Oleg Sivokon writes: > Suppose I wanted to extract the structure from an Org document, where, > what's important for me would be to have it cathegorically divided into > headers, paragraphs of text, technical information and inclusion of > other documents (code snippets). How would I do it? You would use org-element. Try org-element-parse-buffer and org-element-map and maybe org-element-interpret-data. There's also a bunch of regexp for identifying/finding particular types of elements. Cheers, Rasmus -- To err is human. To screw up 10⁶ times per second, you need a computer