.Kind (page): .Type (posts) / .Layout ()
Bundle: n/a (regular page)
[ categories | projects | tags | search ]
Hugo Sandbox

This is an unofficial Hugo sandbox site to try to replicate possible bugs in hugo.

It is updated automatically after each commit to the hugo-sandbox repo. It was last updated on Oct 09, 2018 14:48 UTC.


This page was created/modified in commit 669d193 "Copy ox-hugo test site" on 2017-11-02.
Markdown source of this page

Source blocks with line number annotation

tags: src-block


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")


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")

Page (Debug)

Page VariableValue
Name "Source blocks with line number annotation"
Title "Source blocks with line number annotation"
ResourceType "page"
Kind "page"
Section "posts"
Draft false
Type "posts"
Layout ""
Permalink "https://hugo-sandbox.netlify.com/posts/source-block-with-line-numbers/"
RelPermalink "/posts/source-block-with-line-numbers/"
RSSLink ""
Data
KeyTypeValue
Pageshugolib.Pages
NextPageSource blocks with highlighting
PrevPageSpaces in categories
NextInSectionSource blocks with highlighting
PrevInSectionSpaces in categories

Page Params (Debug)

KeyTypeValue
draftbool false
iscjklanguagebool false
lastmodtime.Time 2017-11-02 10:12:52 -0400 -0400
tags[]string "src-block"
titlestring "Source blocks with line number annotation"

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.50-DEV (commit d5d50e2f, using Chroma commit d5ca12b) .

[Back to Hugo Sandbox home]