瀏覽代碼

Add material to introduction of source code chapter

Dan Davison 15 年之前
父節點
當前提交
a8616afcac
共有 1 個文件被更改,包括 28 次插入1 次删除
  1. 28 1
      doc/source-code-chapter.texi

+ 28 - 1
doc/source-code-chapter.texi

@@ -1,4 +1,31 @@
-@chapter Working with source code or Embedded Source Code
+@chapter Working With Source Code or Embedded Source Code
+
+Source code can be included in Org-mode documents using a @samp{src} block:
+
+FIXME: This example is also in the Literal Examples section.
+@example
+#+BEGIN_SRC emacs-lisp
+(defun org-xor (a b)
+   "Exclusive or."
+   (if a (not b) b))
+#+END_SRC
+@end example
+
+Org supports the following ways of working with such code blocks:
+
+@itemize @bullet
+@item
+Editing in the appropriate Emacs major-mode (@kbd{C-c '})
+@item
+Export with appropriate markup
+@item
+Extraction (``tangling'') into pure code files.
+@item
+Execution, with results captured in the Org buffer
+@item
+Using code blocks in table formulas
+@end itemize
+
 
 @section Syntax
   :PROPERTIES: