.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 Jan 20, 2022 20:12 UTC.


This page was created/modified in commit f705e5b "Make coderef work even when coderef links appear before code block" on 2022-01-13.
Markdown source of this page

Coderef

tags: src-block coderef annotation example-block


Description/Summary

Support anchoring the source and example block lines using Org coderef links.

Content

See info:org#Literal Examples.

In literal examples, Org interprets strings like (ref:name) as labels, and use them as targets for special hyperlinks like [[(name)]] — i.e., the reference name enclosed in single parenthesis.

Line numbers are always enabled if coderefs are used. The code blocks are exported as if the user always added the -n switches to the source or example block header.

Source block

Default line nums with coderef labels

1
2
(save-excursion                 (sc)
   (goto-char (point-min))      (jump)

In line sc we remember the current position. Line jump jumps to point-min.

Default line nums without coderef labels

1
2
(save-excursion
   (goto-char (point-min))

In line 1 we remember the current position. Line 2 jumps to point-min.

Custom line nums without coderef labels

20
21
(save-excursion
   (goto-char (point-min))

In line 20 we remember the current position. Line 21 jumps to point-min.

Custom line nums without coderef labels and with highlighting

20
21
(save-excursion
   (goto-char (point-min))

Line 21 jumps to point-min.

Reference to lines before code block

In line 1 we remember the current position. Line 2 jumps to point-min.

1
2
(save-excursion
   (goto-char (point-min))

Example block

20
21
(save-excursion
   (goto-char (point-min))

Line 21 jumps to point-min.


Page (Debug)

Page VariableValue
Name "Coderef"
Title "Coderef"
ResourceType "page"
Kind "page"
Section "posts"
Draft false
Type "posts"
Layout ""
Permalink "https://ox-hugo.scripter.co/test/posts/coderef/"
RelPermalink "/posts/coderef/"
Data
page.Data{} (type:page.Data)
NextPageCode-fenced source blocks with backticks
PrevPageCustom Creator
NextInSectionCode-fenced source blocks with backticks
PrevInSectionCustom Creator

Page Params (Debug)

KeyTypeValue
descriptionstring " Support anchoring the source and example block lines using Org coderef\n links.\n "
draftbool false
iscjklanguagebool false
lastmodtime.Time 2022-01-13 16:45:30 -0500 -0500
tags[]string "src-block" "coderef" "annotation" "example-block"
titlestring "Coderef"

File Object (Debug)

FileInfo VariableValue
UniqueID "adf531b06430b06fecc3d358620219d3"
BaseFileName "coderef"
TranslationBaseName "coderef"
Lang "en"
Section "posts"
LogicalName "coderef.md"
Dir "posts/"
Ext "md"
Path "posts/coderef.md"

This site is generated using the ox-hugo package for Emacs/Org-mode + hugo-bare-min-theme + Hugo 0.92.0 (commit b3549403) .
[Test Site home | ox-hugo home]