mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-24 15:44:59 +08:00
Org writer: preserve line-numbering for example and code blocks.
This commit is contained in:
committed by
Albert Krewinkel
parent
053c683d35
commit
c998b937c1
@@ -0,0 +1,41 @@
|
||||
```
|
||||
% pandoc -f rst -t org
|
||||
.. code:: haskell
|
||||
:number-lines: 42
|
||||
|
||||
main = putStrLn "Hello World!"
|
||||
unsafePerformIO main
|
||||
^D
|
||||
#+BEGIN_SRC haskell -n 42
|
||||
main = putStrLn "Hello World!"
|
||||
unsafePerformIO main
|
||||
#+END_SRC
|
||||
```
|
||||
|
||||
```
|
||||
% pandoc -f org -t native
|
||||
#+BEGIN_SRC lisp -n 20
|
||||
(+ 1 1)
|
||||
#+END_SRC
|
||||
|
||||
#+BEGIN_SRC lisp +n 10
|
||||
(+ 2 2)
|
||||
#+END_SRC
|
||||
^D
|
||||
[CodeBlock ("",["commonlisp","numberLines"],[("org-language","lisp"),("startFrom","20")]) "(+ 1 1)\n"
|
||||
,CodeBlock ("",["commonlisp","numberLines","continuedSourceBlock"],[("org-language","lisp"),("startFrom","10")]) "(+ 2 2)\n"]
|
||||
```
|
||||
|
||||
```
|
||||
% pandoc -f native -t org
|
||||
[CodeBlock ("",["commonlisp","numberLines"],[("org-language","lisp"),("startFrom","20")]) "(+ 1 1)\n"
|
||||
,CodeBlock ("",["commonlisp","numberLines","continuedSourceBlock"],[("org-language","lisp"),("startFrom","10")]) "(+ 2 2)\n"]
|
||||
^D
|
||||
#+BEGIN_SRC lisp -n 20
|
||||
(+ 1 1)
|
||||
#+END_SRC
|
||||
|
||||
#+BEGIN_SRC lisp +n 10
|
||||
(+ 2 2)
|
||||
#+END_SRC
|
||||
```
|
||||
Reference in New Issue
Block a user