-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Export Org src blocks to code fenced Markdown by default
The option is set by the HUGO_CODE_FENCE property. - If set to t (default), Markdown code fence is used. - Else Hugo `highlight' shortcode is used. Add examples.
- Loading branch information
1 parent
e974a39
commit 67ec798
Showing
5 changed files
with
166 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
example-site/content-org/src-blocks-with-highlight-shortcode.org
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#+HUGO_BASE_DIR: ../ | ||
#+HUGO_CODE_FENCE: nil | ||
|
||
#+OPTIONS: loffset:1 | ||
#+SEQ_TODO: TODO DRAFT DONE | ||
|
||
* Source blocks with Hugo =highlight= shortcode | ||
:PROPERTIES: | ||
:EXPORT_FILE_NAME: shortcode-src-blocks | ||
:END: | ||
Here are few variables that you might like to change in the =local.mk=: | ||
- =prefix= :: Org installation directory | ||
#+BEGIN_SRC makefile | ||
prefix = /dir/where/you/want/to/install/org # Default: /usr/share | ||
#+END_SRC | ||
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. | ||
- =infodir= :: Org Info installation directory. I like to keep the | ||
Info file for development version of Org in a separate | ||
directory. | ||
#+BEGIN_SRC makefile | ||
infodir = $(prefix)/org/info # Default: $(prefix)/info | ||
#+END_SRC | ||
- =ORG_MAKE_DOC= :: Types of Org documentation you'd like to build by | ||
default. | ||
#+BEGIN_SRC makefile | ||
# Define below you only need info documentation, the default includes html and pdf | ||
ORG_MAKE_DOC = info pdf card # html | ||
#+END_SRC | ||
- =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. | ||
#+BEGIN_SRC makefile | ||
# 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 - Headline 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 | ||
#+END_SRC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
+++ | ||
title = "Code-fenced source blocks" | ||
date = 2017-07-13T17:49:22-04:00 | ||
tags = [] | ||
draft = false | ||
+++ | ||
|
||
Here are few variables that you might like to change in the `local.mk`: | ||
|
||
- **`prefix`:** Org installation directory | ||
|
||
```makefile | ||
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. | ||
- **`infodir`:** Org Info installation directory. I like to keep the Info file for development version of Org in a separate directory. | ||
```makefile | ||
infodir = $(prefix)/org/info # Default: $(prefix)/info | ||
``` | ||
- **`ORG_MAKE_DOC`:** Types of Org documentation you’d like to build by default. | ||
```makefile | ||
# 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. | ||
```makefile | ||
# 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 - Headline 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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
+++ | ||
title = "Source blocks with Hugo `highlight` shortcode" | ||
date = 2017-07-13T17:57:58-04:00 | ||
tags = [] | ||
draft = false | ||
+++ | ||
|
||
Here are few variables that you might like to change in the `local.mk`: | ||
|
||
- **`prefix`:** Org installation directory | ||
|
||
{{< highlight makefile>}} | ||
prefix = /dir/where/you/want/to/install/org # Default: /usr/share | ||
{{< /highlight >}} | ||
|
||
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. | ||
- **`infodir`:** Org Info installation directory. I like to keep the Info file for development version of Org in a separate directory. | ||
|
||
{{< highlight makefile>}} | ||
infodir = $(prefix)/org/info # Default: $(prefix)/info | ||
{{< /highlight >}} | ||
- **`ORG_MAKE_DOC`:** Types of Org documentation you’d like to build by default. | ||
|
||
{{< highlight makefile>}} | ||
# Define below you only need info documentation, the default includes html and pdf | ||
ORG_MAKE_DOC = info pdf card # html | ||
{{< /highlight >}} | ||
- **`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. | ||
|
||
{{< highlight makefile>}} | ||
# 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 - Headline 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 | ||
{{< /highlight >}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters