Commit 16ff1fdee9

16ff1fdee9a8efde57576b194bf40e149ef1d9a5

parent: 136d9c584c

Verified · cmc

cmc <hello@cleberg.net> · 2026-11-21 18:46 UTC

Test ODT export of dot, latex and processing blocks with results in the buffer

Layout: unified · split

Tests/OrgCoreTests/ODTExportTests.swift +97
@@ -489,6 +489,103 @@ struct ODTExportTests {
489489 * A
490490 ** B
491491 """,
492 "babel-languages-results": """
493 #+OPTIONS: toc:nil
494 #+begin_src dot
495 a
496 #+end_src
497
498 #+RESULTS:
499 : resdot
500
501 #+begin_src dot :file graph.png
502 digraph { b }
503 #+end_src
504
505 #+RESULTS:
506 [[file:graph.png]]
507
508 #+begin_src latex
509 c
510 #+end_src
511
512 #+RESULTS:
513 #+begin_export latex
514 c
515 #+end_export
516
517 #+begin_src processing
518 d
519 #+end_src
520
521 #+RESULTS:
522 : resprocessing
523
524 #+begin_src org
525 e
526 #+end_src
527
528 #+RESULTS:
529 : resorg
530
531 #+begin_src gnuplot :file plot.png
532 f
533 #+end_src
534
535 #+RESULTS:
536 [[file:plot.png]]
537
538 after
539 """,
540 "babel-languages-exports": """
541 #+OPTIONS: toc:nil
542 #+begin_src dot :exports results
543 a
544 #+end_src
545
546 #+RESULTS:
547 : resdot
548
549 #+begin_src dot :file pic.png :exports both
550 digraph { b }
551 #+end_src
552
553 #+RESULTS:
554 [[file:pic.png]]
555
556 #+begin_src latex :exports results
557 c
558 #+end_src
559
560 #+RESULTS:
561 #+begin_export latex
562 c
563 #+end_export
564
565 #+begin_src processing :exports both
566 d
567 #+end_src
568
569 #+RESULTS:
570 : resprocessing
571
572 #+begin_src dot :exports none
573 g
574 #+end_src
575
576 #+RESULTS:
577 : resnone
578
579 #+begin_src dot :file none.png :exports results
580 h
581 #+end_src
582
583 #+begin_src latex :exports both
584 i
585 #+end_src
586
587 after
588 """,
492589 "babel-languages": """
493590 #+OPTIONS: toc:nil
494591 before
docs/manual/guide/12-export.org +1 −1
@@ -260,7 +260,7 @@ Export to ODT writes an OpenDocument text file (=.odt=) for LibreOffice, Pages o
260260- Tables keep their header rows, alignment cookies, column groups and cell borders. A table inside a list item ends the list, sits indented below it, and the list carries on after it, as in ox-odt.
261261- Images from =file:= links (PNG, JPEG, GIF and SVG) are put inside the file. Their size is their pixels at 96 to the inch, or =#+ATTR_ODT: :width=, =:length= (the height) or =:scale=, and no more than 17 by 20 cm. A caption or =#+NAME:= numbers figures, tables and source blocks, and a link to the name shows the number.
262262- LaTeX fragments and environments are kept as written, in code style, as ox-odt does without a MathML converter. Source blocks are not colored; a language Emacs has no mode for gets ox-odt's plain code style.
263- Without =:exports=, every source block exports its code, =dot=, =plantuml=, =ditaa=, =gnuplot=, =latex= and =lilypond= included: =emacs -Q= loads no Babel library to give them =results=. A line of only spaces in a source block is exported empty, unless =-i= keeps the indentation.
263- Without =:exports=, every source block exports its code, =dot=, =plantuml=, =ditaa=, =gnuplot=, =latex= and =lilypond= included: =emacs -Q= loads no Babel library to give them =results=, so their =#+RESULTS:= are left out, with or without =:file=. With =:exports results= or =both=, the =#+RESULTS:= already in the file are exported as they are. A line of only spaces in a source block is exported empty, unless =-i= keeps the indentation.
264264- Of the =#+OPTIONS=, =\n=, =f=, =|=, =e= and =d= (=t= or =nil=) are read, along with those every export reads.
265265- =#+ODT:= lines, =#+BEGIN_EXPORT odt= blocks and =@@odt:...@@= snippets go in as they are.
266266- The styles (=styles.xml=) are orgstar's own: A4 pages with 2 cm margins. =#+ODT_STYLES_FILE:= is not read.