.Kind (page): .Type (posts) / .Layout ()
Bundle: n/a (regular page)
[ categories | tags | search ]
ox-hugo Test Site

This is the test site for the ox-hugo package for Emacs/Org-mode.

It is updated automatically after each commit to the ox-hugo repo. It was last updated on Oct 05, 2024 21:20 UTC.


This page was created/modified in commit efdf4c0 "Change `linenos` arg value to `true`; update tests" on 2022-03-08.
Markdown source of this page

Source blocks with line number annotation (Goldmark)

tags: src-block annotations goldmark linenum


Description/Summary

Org reference Cases # Default new line number start # Org source # #+begin_src emacs-lisp -n ;; this will export with line number 1 (default) (message "This is line 2") #+end_src Output # 1 2 ;; this will export with line number 1 (default) (message "This is line 2") Specify new line number start # Org source # #+begin_src emacs-lisp -n 20 ;; this will export with line number 20 (message "This is line 21") #+end_src Output # 20 21 ;; this will export with line number 20 (message "This is line 21") Default continued line numbers # Org source # #+begin_src emacs-lisp +n ;; This will be listed as line 22 (message "This is line 23") #+end_src Output # 22 23 ;; This will be listed as line 22 (message "This is line 23") Specify continued line numbers jump # Org source # #+begin_src emacs-lisp +n 10 ;; This will be listed as line 33 (message "This is line 34") #+end_src Output # 33 34 ;; This will be listed as line 33 (message "This is line 34") Specifying linenos parameter # (message "This is line 1") (message "This is line 2") (message "This is line 3") 30(message "This is line 30") 31(message "This is line 31") 32(message "This is line 32")


Content

Cases #

Default new line number start #

Org source #

#+begin_src emacs-lisp -n
;; this will export with line number 1 (default)
(message "This is line 2")
#+end_src

Output #

1
2
;; this will export with line number 1 (default)
(message "This is line 2")

Specify new line number start #

Org source #

#+begin_src emacs-lisp -n 20
;; this will export with line number 20
(message "This is line 21")
#+end_src

Output #

20
21
;; this will export with line number 20
(message "This is line 21")

Default continued line numbers #

Org source #

#+begin_src emacs-lisp +n
;; This will be listed as line 22
(message "This is line 23")
#+end_src

Output #

22
23
;; This will be listed as line 22
(message "This is line 23")

Specify continued line numbers jump #

Org source #

#+begin_src emacs-lisp +n 10
;; This will be listed as line 33
(message "This is line 34")
#+end_src

Output #

33
34
;; This will be listed as line 33
(message "This is line 34")

Specifying linenos parameter #

(message "This is line 1")
(message "This is line 2")
(message "This is line 3")
30(message "This is line 30")
31(message "This is line 31")
32(message "This is line 32")

Page (Debug)

Page VariableValue
Name "Source blocks with line number annotation (Goldmark)"
Title "Source blocks with line number annotation (Goldmark)"
ResourceType "page"
Kind "page"
Section "posts"
Draft false
Type "posts"
Layout ""
Permalink "https://ox-hugo.scripter.co/test/posts/source-block-with-line-numbers/"
RelPermalink "/posts/source-block-with-line-numbers/"
Data
page.Data{} (type:page.Data)
NextPageSource blocks with line number annotation (Blackfriday)
PrevPageSpaces in categories
NextInSectionSource blocks with line number annotation (Blackfriday)
PrevInSectionSpaces in categories

Page Params (Debug)

KeyTypeValue
aliases[]string "/posts/source-block-with-line-numbers-goldmark"
draftbool false
iscjklanguagebool false
lastmodtime.Time 2022-03-08 20:49:23 -0500 -0500
tags[]string "src-block" "annotations" "goldmark" "linenum"
titlestring "Source blocks with line number annotation (Goldmark)"

File Object (Debug)

FileInfo VariableValue
UniqueID "7b78d4912277fad301b39ac0006807b4"
BaseFileName "source-block-with-line-numbers"
TranslationBaseName "source-block-with-line-numbers"
Lang "en"
Section "posts"
LogicalName "source-block-with-line-numbers.md"
Dir "posts/"
Ext "md"
Path "posts/source-block-with-line-numbers.md"

This site is generated using the ox-hugo package for Emacs/Org-mode + hugo-bare-min-theme + Hugo 0.101.0 (commit 466fa43c16709b4483689930a4f9ac8add5c9f66) . This site is powered by Netlify.
[Test Site home | ox-hugo home]