This Emacs package provides the Org source block header argument :emph
.
The value of :emph
is a list ’(BEG END FACE)
consisting of two regexps BEG
and END
and a face specification FACE
.
BEG
and END
are the regular expressions matching the beginning and the end
of the region to be emphasized with FACE
.
Supported are currently:
- Highlighting of the Org buffer itself
- HTML-Export
This package is inspired by the following two https://emacs.stackexchange.com questions:
- Emphasize text snippets in source blocks
- Noweb references in sh blocks breaks the syntax highlighting
- Put the file
org-src-emph.el
anywhere in yourload-path
. - Optionally byte-compile
org-src-emph.el
. - Add
(require 'org-src-emph)
into your init file.
#+BEGIN_SRC C++ :emph '(("°" "°" 'bold))
std::cout << "°These words are highlighted.°\n";
#+END_SRC
#+NAME: F
#+BEGIN_SRC sh
"Noweb source!"
#+END_SRC
#+BEGIN_SRC sh :noweb yes :emph '(("<<" ">>"))
#!bash
if [[ "$1" == "Noweb reference" ]]; then
echo <<F()>>
else
echo "nothing"
fi
echo "Finish"
#+END_SRC