.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 Mar 05, 2024 19:24 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 (Blackfriday)

tags: src-block highlight shortcode blackfriday linenum


Description/Summary

Org reference Hugo highlight shortcode with line numbers 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 (Blackfriday)"
Title "Source blocks with line number annotation (Blackfriday)"
ResourceType "page"
Kind "page"
Section "posts"
Draft false
Type "posts"
Layout ""
Permalink "https://ox-hugo.scripter.co/test/posts/source-block-with-line-numbers-blackfriday/"
RelPermalink "/posts/source-block-with-line-numbers-blackfriday/"
Data
page.Data{} (type:page.Data)
NextPageSource blocks with langs that need to be replaced in Markdown
PrevPageSource blocks with line number annotation (Goldmark)
NextInSectionSource blocks with langs that need to be replaced in Markdown
PrevInSectionSource blocks with line number annotation (Goldmark)

Page Params (Debug)

KeyTypeValue
draftbool false
iscjklanguagebool false
lastmodtime.Time 2022-03-08 20:49:23 -0500 -0500
tags[]string "src-block" "highlight" "shortcode" "blackfriday" "linenum"
titlestring "Source blocks with line number annotation (Blackfriday)"

File Object (Debug)

FileInfo VariableValue
UniqueID "6213c518b6696daff3c0f538ca15fc56"
BaseFileName "source-block-with-line-numbers-blackfriday"
TranslationBaseName "source-block-with-line-numbers-blackfriday"
Lang "en"
Section "posts"
LogicalName "source-block-with-line-numbers-blackfriday.md"
Dir "posts/"
Ext "md"
Path "posts/source-block-with-line-numbers-blackfriday.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]