Source blocks with highlight shortcode
tags: src-block highlight shortcode
Description/Summary
Note that to disable the code fence option, the value portion of the property needs to be left empty instead of setting to nil! :PROPERTIES: :EXPORT_HUGO_CODE_FENCE: :END: Here are few variables that you might like to change in the local.mk: prefix Org installation directory prefix = /dir/where/you/want/to/install/org # Default: /usr/share The .el files will go to $(prefix)/emacs/site-lisp/org by default. If you’d like to change that, you can tweak the lispdir variable.
Content
Note that to disable the code fence option, the value portion of the
property needs to be left empty instead of setting to nil
!
:PROPERTIES:
:EXPORT_HUGO_CODE_FENCE:
:END:
Here are few variables that you might like to change in the local.mk
:
prefix
- Org installation directory
The
prefix = /dir/where/you/want/to/install/org # Default: /usr/share
.el
files will go to$(prefix)/emacs/site-lisp/org
by default. If you’d like to change that, you can tweak thelispdir
variable. infodir
- Org Info installation directory. I like to keep the
Info file for development version of Org in a separate
directory.
infodir = $(prefix)/org/info # Default: $(prefix)/info
ORG_MAKE_DOC
- Types of Org documentation you’d like to build by
default.
# Define below you only need info documentation, the default includes html and pdf ORG_MAKE_DOC = info pdf card # html
ORG_ADD_CONTRIB
- Packages from the
contrib/
directory that you’d like to build along with Org. Below are the ones on my must-have list.# Define if you want to include some (or all) files from contrib/lisp # just the filename please (no path prefix, no .el suffix), maybe with globbing # org-eldoc - Heading breadcrumb trail in minibuffer # ox-extra - Allow ignoring just the heading, but still export the body of those headings # org-mime - Convert org buffer to htmlized format for email ORG_ADD_CONTRIB = org-eldoc ox-extra org-mime
Here’s an example of an emacs-lisp
block:
(defvar emacs-version-short (format "%s_%s"
emacs-major-version emacs-minor-version)
"A variable to store the current emacs versions as <MAJORVER>_<MINORVER>.
So, for emacs version 25.0.50.1, this variable will be 25_0.")
Here’s an example of a python
block (ox-hugo
Issue #314):
import itertools as it
import numpy as np
def permanent(m):
nr,nc = np.shape(m)
if nr != nc:
raise ValueError("Matrix must be square")
pm = 0
for p in it.permutations(range(nr)):
pm += np.product([m[i,p[i]] for i in range(nr)])
return pm
Page (Debug)
Page Variable | Value | |
---|---|---|
Name | "Source blocks with highlight shortcode" | |
Title | "Source blocks with highlight shortcode" | |
ResourceType | "page" | |
Kind | "page" | |
Section | "posts" | |
Draft | false | |
Type | "posts" | |
Layout | "" | |
Permalink | "https://ox-hugo.scripter.co/test/posts/highlight-shortcode-src-blocks/" | |
RelPermalink | "/posts/highlight-shortcode-src-blocks/" | |
Data |
| |
NextPage | Nested lists | |
PrevPage | Use Org Code markup for kbd tag | |
NextInSection | Nested lists | |
PrevInSection | Use Org Code markup for kbd tag |
Page Params (Debug)
Key | Type | Value |
---|---|---|
date | time.Time | 2017-07-31 00:00:00 +0000 UTC |
draft | bool | false |
iscjklanguage | bool | false |
lastmod | time.Time | 2022-05-27 12:20:31 -0400 -0400 |
publishdate | time.Time | 2017-07-31 00:00:00 +0000 UTC |
tags | []string | "src-block" "highlight" "shortcode" |
title | string | "Source blocks with highlight shortcode" |
File Object (Debug)
FileInfo Variable | Value |
---|---|
UniqueID | "b88ce64d8e58fbf3edd54400af0cca96" |
BaseFileName | "highlight-shortcode-src-blocks" |
TranslationBaseName | "highlight-shortcode-src-blocks" |
Lang | "en" |
Section | "posts" |
LogicalName | "highlight-shortcode-src-blocks.md" |
Dir | "posts/" |
Ext | "md" |
Path | "posts/highlight-shortcode-src-blocks.md" |