GPLv2 instead
[elbb.git] / elbb-example-page.org
blob49cce3e1c3b22a8e7d469071569d772532934771
1 #+TITLE:    ELBB - Example of page with code
2 #+STARTUP:  odd hidestars unfold
3 #+AUTHOR:   Emacs Community
4 #+EMAIL:    bzg AT gnu DOT org
5 #+LANGUAGE: en
6 #+OPTIONS:  skip:nil toc:nil
8 * Fixed-width sections of code
10 : (substring "abcdefg" 0 3)
11 :   ==> "abc"
12 : (substring "abcdefg" -3 -1)
13 :   ==> "ef"
15 * BEGIN_EXAMPLE
17 #+BEGIN_EXAMPLE
18 (substring "abcdefg" 0 3)
19   ==> "abc"
20 (substring "abcdefg" -3 -1)
21   ==> "ef"
22 #+END_EXAMPLE
24 * BEGIN_SRC
26 #+BEGIN_SRC emacs-lisp
27 (defun chomp (str)
28   "..."
29   (let ((s (if (symbolp str)(symbol-name str) str)))
30     (save-excursion
31       (while (and
32               (not (null (string-match "^\\( \\|\f\\|\t\\|\n\\)" s)))
33               (> (length s) (string-match "^\\( \\|\f\\|\t\\|\n\\)" s)))
34         (setq s (replace-match "" t nil s)))
35       (while (and
36               (not (null (string-match "\\( \\|\f\\|\t\\|\n\\)$" s)))
37               (> (length s) (string-match "\\( \\|\f\\|\t\\|\n\\)$" s)))
38         (setq s (replace-match "" t nil s))))
39     s))
40 #+END_SRC
43 Read more on [[http://orgmode.org/manual/Literal-examples.html][Org's manual]].