Skip to content

Commit 843ce25

Browse files
DavidLiedleclaude
andcommitted
Fix: replace #+begin_src org with #+begin_example throughout
#+begin_src org blocks whose content contains org headings (* lines) cause the org-mode parser to break out of the block, rendering the #+begin_src/#+end_src markers as plain text and the headings as real headings. #+begin_example is the correct verbatim display construct for org-syntax examples in a book — no evaluation, no parser confusion. 167 blocks replaced across 12 chapters. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 519a0eb commit 843ce25

12 files changed

+334
-334
lines changed

02-getting-started.org

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Let's create your first =.org= file. In Emacs:
6565

6666
Congratulations! You're now in Org-Mode. Let's type something:
6767

68-
#+begin_src org
68+
#+begin_example
6969
* Welcome to Org-Mode
7070

7171
This is a top-level heading. The asterisk at the start makes it special.
@@ -91,7 +91,7 @@ thoughts, notes—whatever you need.
9191

9292
Org files are organized as an outline. This structure is the foundation of
9393
everything else.
94-
#+end_src
94+
#+end_example
9595

9696
Type this into your file (or something like it—creativity encouraged).
9797

@@ -171,15 +171,15 @@ Don't panic if elisp is unfamiliar. You're not expected to become an Emacs Lisp
171171

172172
An Org file is fundamentally an outline with superpowers:
173173

174-
#+begin_src org
174+
#+begin_example
175175
* Level 1
176176
** Level 2
177177
*** Level 3
178178
**** Level 4
179179

180180
Back to level 1
181181
** Another Level 2
182-
#+end_src
182+
#+end_example
183183

184184
That's it. That's the core structure. Everything else in Org-Mode—todos, timestamps, tags, properties, tables, code blocks—gets added to this outline foundation.
185185

03-document-structure.org

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@ You've mastered the basics: headings, folding, moving things around. Now let's e
1111

1212
We've established that asterisks create headings:
1313

14-
#+begin_src org
14+
#+begin_example
1515
* One asterisk = Level 1
1616
** Two asterisks = Level 2
1717
*** Three asterisks = Level 3
18-
#+end_src
18+
#+end_example
1919

2020
But headings in Org-Mode are more than visual organization—they're structural containers with their own properties, metadata, and behaviors.
2121

2222
** The Anatomy of a Heading
2323

2424
A complete heading can include several components:
2525

26-
#+begin_src org
26+
#+begin_example
2727
* TODO Write documentation :work:urgent:
2828
SCHEDULED: <2025-01-15 Wed>
2929
:PROPERTIES:
@@ -32,7 +32,7 @@ A complete heading can include several components:
3232

3333
This is the heading body. Everything until the next heading belongs to
3434
this section.
35-
#+end_src
35+
#+end_example
3636

3737
Let's break this down:
3838
- =*= - The level indicator
@@ -49,32 +49,32 @@ Each component is optional. A heading can be just =* Simple= or a metadata-rich
4949

5050
Org-Mode supports rich text formatting using simple markup:
5151

52-
#+begin_src org
52+
#+begin_example
5353
*bold text*
5454
/italic text/
5555
_underlined text_
5656
=verbatim text= (displayed in monospace)
5757
~code~ (also monospace)
5858
+strikethrough text+
59-
#+end_src
59+
#+end_example
6060

6161
When Org-Mode displays these, they render beautifully, but open the file in any text editor and it's still human-readable. This is the plain-text philosophy in action.
6262

6363
** Escaping Special Characters
6464

6565
Need to write an actual asterisk without creating a heading? Precede it with a comma or use a zero-width space:
6666

67-
#+begin_src org
67+
#+begin_example
6868
,* This is not a heading
69-
#+end_src
69+
#+end_example
7070

7171
* Lists: Bullets, Numbers, and Checkboxes
7272

7373
Org-Mode has sophisticated list support. Simple to start, powerful when you need it.
7474

7575
** Unordered Lists
7676

77-
#+begin_src org
77+
#+begin_example
7878
* Shopping List
7979
- Milk
8080
- Eggs
@@ -83,13 +83,13 @@ Org-Mode has sophisticated list support. Simple to start, powerful when you need
8383
- Coffee
8484
- Dark roast
8585
- Bread
86-
#+end_src
86+
#+end_example
8787

8888
Start a line with =-=, =+=, or =*= (if not at the start of the line) to create a list item. Press =M-RET= on a list item to create another at the same level.
8989

9090
** Ordered Lists
9191

92-
#+begin_src org
92+
#+begin_example
9393
* Recipe Steps
9494
1. Preheat oven to 350°F
9595
2. Mix dry ingredients
@@ -98,27 +98,27 @@ Start a line with =-=, =+=, or =*= (if not at the start of the line) to create a
9898
3. Baking powder
9999
3. Add wet ingredients
100100
4. Bake for 25 minutes
101-
#+end_src
101+
#+end_example
102102

103103
Org-Mode automatically renumbers lists when you add or remove items. Move an item with =M-up/down= and the numbers update automatically. It's the little things.
104104

105105
** Description Lists
106106

107-
#+begin_src org
107+
#+begin_example
108108
* Git Commands
109109
- git add :: Stage changes for commit
110110
- git commit :: Save staged changes to history
111111
- git push :: Send commits to remote repository
112112
- git pull :: Fetch and merge remote changes
113-
#+end_src
113+
#+end_example
114114

115115
The =::= separator creates description lists—perfect for glossaries, definitions, or any term/description pairs.
116116

117117
** Checkbox Lists
118118

119119
Here's where lists get seriously useful:
120120

121-
#+begin_src org
121+
#+begin_example
122122
* Project Tasks
123123
- [ ] Design mockups
124124
- [ ] Get client approval
@@ -129,26 +129,26 @@ Here's where lists get seriously useful:
129129
- [ ] Dashboard
130130
- [ ] Reports
131131
- [ ] Deploy to staging
132-
#+end_src
132+
#+end_example
133133

134134
=[ ]= creates an unchecked box, =[X]= is checked. Press =C-c C-c= (Control-c twice) on a checkbox to toggle it.
135135

136136
The magic: parent items show completion statistics:
137137

138-
#+begin_src org
138+
#+begin_example
139139
* Project Tasks [1/5]
140140
- [ ] Task 1
141141
- [X] Task 2
142142
- [ ] Task 3
143143
- [ ] Task 4
144144
- [ ] Task 5
145-
#+end_src
145+
#+end_example
146146

147147
Or as a percentage:
148148

149-
#+begin_src org
149+
#+begin_example
150150
* Project Tasks [20%]
151-
#+end_src
151+
#+end_example
152152

153153
Add =[/]= or =[%]= after the heading text, and Org-Mode calculates it automatically when you toggle child checkboxes. This is phenomenal for tracking progress in nested task lists.
154154

@@ -182,7 +182,7 @@ Narrowing is underrated. Working on one section of a large document? Narrow to i
182182

183183
Drawers are collapsible sections for metadata that you don't need to see all the time:
184184

185-
#+begin_src org
185+
#+begin_example
186186
* Project Meeting Notes
187187
:PROPERTIES:
188188
:MEETING_DATE: 2025-01-15
@@ -195,70 +195,70 @@ Drawers are collapsible sections for metadata that you don't need to see all the
195195
:END:
196196

197197
The actual meeting notes go here.
198-
#+end_src
198+
#+end_example
199199

200200
The =:PROPERTIES:= drawer stores key-value pairs. The =:LOGBOOK:= drawer (auto-created) stores notes and state changes. Press TAB on a drawer to collapse/expand it.
201201

202202
You can create custom drawers too:
203203

204-
#+begin_src org
204+
#+begin_example
205205
* Project
206206
:RESOURCES:
207207
- https://docs.example.com
208208
- https://github.com/example/repo
209209
:END:
210-
#+end_src
210+
#+end_example
211211

212212
* Blocks: Special Sections
213213

214214
Blocks are regions with special formatting or behavior:
215215

216216
** Quote Blocks
217217

218-
#+begin_src org
218+
#+begin_example
219219
#+BEGIN_QUOTE
220220
The best way to predict the future is to invent it.
221221
— Alan Kay
222222
#+END_QUOTE
223-
#+end_src
223+
#+end_example
224224

225225
** Example Blocks
226226

227-
#+begin_src org
227+
#+begin_example
228228
#+BEGIN_EXAMPLE
229229
This text is displayed in monospace
230230
and preserves spacing exactly.
231231
#+END_EXAMPLE
232-
#+end_src
232+
#+end_example
233233

234234
** Source Code Blocks
235235

236-
#+begin_src org
236+
#+begin_example
237237
#+BEGIN_SRC python
238238
def fibonacci(n):
239239
if n <= 1:
240240
return n
241241
return fibonacci(n-1) + fibonacci(n-2)
242-
#+END_SRC
242+
#+end_example
243243
#+end_src
244244

245245
We'll dive deep into code blocks in Chapter 11 (spoiler: they're executable).
246246

247247
** Center Blocks
248248

249-
#+begin_src org
249+
#+begin_example
250250
#+BEGIN_CENTER
251251
This text will be centered when exported.
252252
#+END_CENTER
253-
#+end_src
253+
#+end_example
254254

255255
Press =C-c '= (Control-c single-quote) inside a code block to edit it in a dedicated buffer with full syntax highlighting and language-specific features. Edit, then =C-c '= again to return. It's magical.
256256

257257
* Comments and Comment Blocks
258258

259259
Sometimes you need notes that don't export:
260260

261-
#+begin_src org
261+
#+begin_example
262262
# This is a comment line (won't export)
263263

264264
* A Regular Heading
@@ -272,21 +272,21 @@ Great for draft notes or internal documentation.
272272
#+END_COMMENT
273273

274274
This also exports.
275-
#+end_src
275+
#+end_example
276276

277277
You can also comment entire subtrees:
278278

279-
#+begin_src org
279+
#+begin_example
280280
* COMMENT This heading won't export
281281
Neither will anything inside it.
282282
Great for drafts or deprecated sections.
283-
#+end_src
283+
#+end_example
284284

285285
* Footnotes: Academic Precision
286286

287287
Org-Mode has first-class footnote support:
288288

289-
#+begin_src org
289+
#+begin_example
290290
The Org-Mode manual[fn:1] is comprehensive but dense. Some prefer community
291291
guides[fn:2] for learning.
292292

@@ -295,21 +295,21 @@ guides[fn:2] for learning.
295295
[fn:1] https://orgmode.org/manual/
296296

297297
[fn:2] Various blogs and tutorials exist, though quality varies.
298-
#+end_src
298+
#+end_example
299299

300300
Or use inline footnotes:
301301

302-
#+begin_src org
302+
#+begin_example
303303
Org-Mode was created in 2003[fn::Though it built on earlier work in Outline mode].
304-
#+end_src
304+
#+end_example
305305

306306
Press =C-c C-c= on a footnote reference to jump to its definition. Press it again to jump back. Org-Mode handles numbering automatically.
307307

308308
* Horizontal Rules
309309

310310
Sometimes you need a visual separator:
311311

312-
#+begin_src org
312+
#+begin_example
313313
* Section One
314314

315315
Content here.
@@ -319,22 +319,22 @@ Content here.
319319
* Section Two
320320

321321
More content.
322-
#+end_src
322+
#+end_example
323323

324324
Five or more dashes on a line creates a horizontal rule.
325325

326326
* Archiving Old Content
327327

328328
Documents grow. Eventually you'll want to move completed or outdated items without deleting them:
329329

330-
#+begin_src org
330+
#+begin_example
331331
* Active Projects
332332
** TODO Current work
333333
** DONE Old project
334334
:PROPERTIES:
335335
:ARCHIVE: this/file/name.org::* Archived Projects
336336
:END:
337-
#+end_src
337+
#+end_example
338338

339339
=C-c C-x C-a= archives the current subtree, moving it to your archive file (or archive location) while preserving its structure and metadata.
340340

0 commit comments

Comments
 (0)