kaushalmodi / ox-hugo

A carefully crafted Org exporter back-end for Hugo
https://ox-hugo.scripter.co
GNU General Public License v3.0
882 stars 132 forks source link

Line nos do not get disabled when code block is exported #489

Closed kishvanchee closed 2 years ago

kishvanchee commented 2 years ago

I would like to enable linenos by default and disable them for specific code block exports.

Actual Behavior

Line nos don't get disabled when exported.

```text
| col_1 | col_2 | col_3 |
| col_1 | col_2 | col_3 |
| col_1 | col_2 | col_3 |
![Screenshot_20211231_021437](https://user-images.githubusercontent.com/24776049/147787468-495391aa-3daf-4db7-afee-bdadb20aeee0.png)

## Expected Behavior
| col_1 | col_2 | col_3 |
| col_1 | col_2 | col_3 |
| col_1 | col_2 | col_3 |
![Screenshot_20211231_022611](https://user-images.githubusercontent.com/24776049/147787458-ecfce75a-90ce-485a-a3c0-f63b53c2f650.png)

This is documented in Hugo's docs - https://gohugo.io/content-management/syntax-highlighting/#highlight-shortcode . This is a related thread - https://discourse.gohugo.io/t/how-to-enable-line-numbers-by-default-and-override-on-some-code-blocks/24998/4

## How to Reproduce the Issue

This is my `config.toml` for the `markup`

[markup] [markup.highlight] anchorLineNos = false codeFences = true guessSyntax = false hl_Lines = "" lineAnchors = "" lineNoStart = 1 lineNos = true lineNumbersInTable = true

noClasses = false

style = "pygments"
tabWidth = 4

### Example Org File

** TODO Post removing lines nos :PROPERTIES: :EXPORT_FILE_NAME: post-removing-lines-nos :END:

+begin_src text :linenos nil

| col_1 | col_2 | col_3 | | col_1 | col_2 | col_3 | | col_1 | col_2 | col_3 |

+end_src


### Generated Markdown File or Error

+++ title = "Post removing lines nos" lastmod = 2021-12-31T02:24:29+05:30 draft = true +++

| col_1 | col_2 | col_3 |
| col_1 | col_2 | col_3 |
| col_1 | col_2 | col_3 |

## Ox-Hugo Debug Information

<!--

  (Step 1) Run `M-x org-hugo-debug-info`.

     *That will copy the debug info in Markdown format to the kill ring.*
     So do *not* manually do any other kill (copy/cut) operation after that!

  See step 2 below.
-->

<details>
  <summary>Debug Info</summary>

# Debug information for `ox-hugo`

## Emacs Version

    GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.27, cairo version 1.17.4)
     of 2021-03-26

## Org Version

    Org mode version 9.4.6 (9.4.6-??-652430128 @ /home/kishore/.emacs.d/.local/straight/build-27.2/org/)

## Hugo Version

    hugo v0.91.2+extended linux/amd64 BuildDate=unknown

### Org `load-path` shadows

**Warning**: Possible mixed installation of Org

    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-C hides /usr/share/emacs/27.2/lisp/org/ob-C
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-forth hides /usr/share/emacs/27.2/lisp/org/ob-forth
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-core hides /usr/share/emacs/27.2/lisp/org/ob-core
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-dot hides /usr/share/emacs/27.2/lisp/org/ob-dot
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-fortran hides /usr/share/emacs/27.2/lisp/org/ob-fortran
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-octave hides /usr/share/emacs/27.2/lisp/org/ob-octave
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-lua hides /usr/share/emacs/27.2/lisp/org/ob-lua
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-groovy hides /usr/share/emacs/27.2/lisp/org/ob-groovy
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/org-colview hides /usr/share/emacs/27.2/lisp/org/org-colview
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-comint hides /usr/share/emacs/27.2/lisp/org/ob-comint
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-hledger hides /usr/share/emacs/27.2/lisp/org/ob-hledger
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-asymptote hides /usr/share/emacs/27.2/lisp/org/ob-asymptote
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-ocaml hides /usr/share/emacs/27.2/lisp/org/ob-ocaml
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ol-bbdb hides /usr/share/emacs/27.2/lisp/org/ol-bbdb
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-org hides /usr/share/emacs/27.2/lisp/org/ob-org
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-exp hides /usr/share/emacs/27.2/lisp/org/ob-exp
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/org-indent hides /usr/share/emacs/27.2/lisp/org/org-indent
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/org-duration hides /usr/share/emacs/27.2/lisp/org/org-duration
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/org hides /usr/share/emacs/27.2/lisp/org/org
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-mscgen hides /usr/share/emacs/27.2/lisp/org/ob-mscgen
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/org-attach hides /usr/share/emacs/27.2/lisp/org/org-attach
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-emacs-lisp hides /usr/share/emacs/27.2/lisp/org/ob-emacs-lisp
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-vala hides /usr/share/emacs/27.2/lisp/org/ob-vala
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ox-icalendar hides /usr/share/emacs/27.2/lisp/org/ox-icalendar
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-screen hides /usr/share/emacs/27.2/lisp/org/ob-screen
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/org-compat hides /usr/share/emacs/27.2/lisp/org/org-compat
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-sql hides /usr/share/emacs/27.2/lisp/org/ob-sql
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-scheme hides /usr/share/emacs/27.2/lisp/org/ob-scheme
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/org-faces hides /usr/share/emacs/27.2/lisp/org/org-faces
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-ruby hides /usr/share/emacs/27.2/lisp/org/ob-ruby
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/org-table hides /usr/share/emacs/27.2/lisp/org/org-table
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/org-timer hides /usr/share/emacs/27.2/lisp/org/org-timer
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/org-list hides /usr/share/emacs/27.2/lisp/org/org-list
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob hides /usr/share/emacs/27.2/lisp/org/ob
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ox-md hides /usr/share/emacs/27.2/lisp/org/ox-md
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/org-src hides /usr/share/emacs/27.2/lisp/org/org-src
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ol-docview hides /usr/share/emacs/27.2/lisp/org/ol-docview
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/org-clock hides /usr/share/emacs/27.2/lisp/org/org-clock
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-coq hides /usr/share/emacs/27.2/lisp/org/ob-coq
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ox-org hides /usr/share/emacs/27.2/lisp/org/ox-org
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ox-beamer hides /usr/share/emacs/27.2/lisp/org/ox-beamer
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ox-html hides /usr/share/emacs/27.2/lisp/org/ox-html
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ox-ascii hides /usr/share/emacs/27.2/lisp/org/ox-ascii
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-latex hides /usr/share/emacs/27.2/lisp/org/ob-latex
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-sed hides /usr/share/emacs/27.2/lisp/org/ob-sed
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-picolisp hides /usr/share/emacs/27.2/lisp/org/ob-picolisp
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/org-loaddefs hides /usr/share/emacs/27.2/lisp/org/org-loaddefs
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ox-odt hides /usr/share/emacs/27.2/lisp/org/ox-odt
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/org-protocol hides /usr/share/emacs/27.2/lisp/org/org-protocol
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/org-crypt hides /usr/share/emacs/27.2/lisp/org/org-crypt
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-tangle hides /usr/share/emacs/27.2/lisp/org/ob-tangle
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/org-footnote hides /usr/share/emacs/27.2/lisp/org/org-footnote
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ol-rmail hides /usr/share/emacs/27.2/lisp/org/ol-rmail
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/org-feed hides /usr/share/emacs/27.2/lisp/org/org-feed
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/org-capture hides /usr/share/emacs/27.2/lisp/org/org-capture
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/org-macs hides /usr/share/emacs/27.2/lisp/org/org-macs
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-eval hides /usr/share/emacs/27.2/lisp/org/ob-eval
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-processing hides /usr/share/emacs/27.2/lisp/org/ob-processing
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-shen hides /usr/share/emacs/27.2/lisp/org/ob-shen
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ol hides /usr/share/emacs/27.2/lisp/org/ol
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-io hides /usr/share/emacs/27.2/lisp/org/ob-io
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ox-texinfo hides /usr/share/emacs/27.2/lisp/org/ox-texinfo
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-clojure hides /usr/share/emacs/27.2/lisp/org/ob-clojure
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/org-entities hides /usr/share/emacs/27.2/lisp/org/org-entities
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ol-mhe hides /usr/share/emacs/27.2/lisp/org/ol-mhe
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ox-man hides /usr/share/emacs/27.2/lisp/org/ox-man
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-haskell hides /usr/share/emacs/27.2/lisp/org/ob-haskell
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-ebnf hides /usr/share/emacs/27.2/lisp/org/ob-ebnf
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ol-eww hides /usr/share/emacs/27.2/lisp/org/ol-eww
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/org-macro hides /usr/share/emacs/27.2/lisp/org/org-macro
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/org-datetree hides /usr/share/emacs/27.2/lisp/org/org-datetree
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-js hides /usr/share/emacs/27.2/lisp/org/ob-js
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-sqlite hides /usr/share/emacs/27.2/lisp/org/ob-sqlite
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ol-irc hides /usr/share/emacs/27.2/lisp/org/ol-irc
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-css hides /usr/share/emacs/27.2/lisp/org/ob-css
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-maxima hides /usr/share/emacs/27.2/lisp/org/ob-maxima
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/org-mobile hides /usr/share/emacs/27.2/lisp/org/org-mobile
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/org-mouse hides /usr/share/emacs/27.2/lisp/org/org-mouse
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/org-goto hides /usr/share/emacs/27.2/lisp/org/org-goto
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-python hides /usr/share/emacs/27.2/lisp/org/ob-python
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-calc hides /usr/share/emacs/27.2/lisp/org/ob-calc
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-ledger hides /usr/share/emacs/27.2/lisp/org/ob-ledger
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/org-agenda hides /usr/share/emacs/27.2/lisp/org/org-agenda
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-stan hides /usr/share/emacs/27.2/lisp/org/ob-stan
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/org-habit hides /usr/share/emacs/27.2/lisp/org/org-habit
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-sass hides /usr/share/emacs/27.2/lisp/org/ob-sass
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-lilypond hides /usr/share/emacs/27.2/lisp/org/ob-lilypond
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-lob hides /usr/share/emacs/27.2/lisp/org/ob-lob
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ol-w3m hides /usr/share/emacs/27.2/lisp/org/ol-w3m
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ol-eshell hides /usr/share/emacs/27.2/lisp/org/ol-eshell
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-eshell hides /usr/share/emacs/27.2/lisp/org/ob-eshell
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-plantuml hides /usr/share/emacs/27.2/lisp/org/ob-plantuml
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-R hides /usr/share/emacs/27.2/lisp/org/ob-R
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/org-lint hides /usr/share/emacs/27.2/lisp/org/org-lint
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/org-element hides /usr/share/emacs/27.2/lisp/org/org-element
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-shell hides /usr/share/emacs/27.2/lisp/org/ob-shell
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-J hides /usr/share/emacs/27.2/lisp/org/ob-J
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-lisp hides /usr/share/emacs/27.2/lisp/org/ob-lisp
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ol-bibtex hides /usr/share/emacs/27.2/lisp/org/ol-bibtex
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ox hides /usr/share/emacs/27.2/lisp/org/ox
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-ditaa hides /usr/share/emacs/27.2/lisp/org/ob-ditaa
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ol-gnus hides /usr/share/emacs/27.2/lisp/org/ol-gnus
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-makefile hides /usr/share/emacs/27.2/lisp/org/ob-makefile
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/org-plot hides /usr/share/emacs/27.2/lisp/org/org-plot
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ol-info hides /usr/share/emacs/27.2/lisp/org/ol-info
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-perl hides /usr/share/emacs/27.2/lisp/org/ob-perl
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/org-pcomplete hides /usr/share/emacs/27.2/lisp/org/org-pcomplete
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/org-keys hides /usr/share/emacs/27.2/lisp/org/org-keys
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/org-archive hides /usr/share/emacs/27.2/lisp/org/org-archive
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-awk hides /usr/share/emacs/27.2/lisp/org/ob-awk
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/org-inlinetask hides /usr/share/emacs/27.2/lisp/org/org-inlinetask
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ox-publish hides /usr/share/emacs/27.2/lisp/org/ox-publish
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-java hides /usr/share/emacs/27.2/lisp/org/ob-java
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/org-id hides /usr/share/emacs/27.2/lisp/org/org-id
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-abc hides /usr/share/emacs/27.2/lisp/org/ob-abc
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/org-num hides /usr/share/emacs/27.2/lisp/org/org-num
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/org-ctags hides /usr/share/emacs/27.2/lisp/org/org-ctags
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-table hides /usr/share/emacs/27.2/lisp/org/ob-table
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/org-refile hides /usr/share/emacs/27.2/lisp/org/org-refile
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ox-latex hides /usr/share/emacs/27.2/lisp/org/ox-latex
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-matlab hides /usr/share/emacs/27.2/lisp/org/ob-matlab
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/org-attach-git hides /usr/share/emacs/27.2/lisp/org/org-attach-git
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/org-tempo hides /usr/share/emacs/27.2/lisp/org/org-tempo
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-ref hides /usr/share/emacs/27.2/lisp/org/ob-ref
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/org-install hides /usr/share/emacs/27.2/lisp/org/org-install
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/ob-gnuplot hides /usr/share/emacs/27.2/lisp/org/ob-gnuplot
    /home/kishore/.emacs.d/.local/straight/build-27.2/org/org-version hides /usr/share/emacs/27.2/lisp/org/org-version

Study the output of `M-x list-load-path-shadows`.

## `ox-hugo` defcustoms

<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">

<colgroup>
<col  class="org-left" />

<col  class="org-left" />
</colgroup>
<tbody>
<tr>
<td class="org-left">org-hugo-section</td>
<td class="org-left">&ldquo;posts&rdquo;</td>
</tr>

<tr>
<td class="org-left">org-hugo-use-code-for-kbd</td>
<td class="org-left">nil</td>
</tr>

<tr>
<td class="org-left">org-hugo-preserve-filling</td>
<td class="org-left">t</td>
</tr>

<tr>
<td class="org-left">org-hugo-delete-trailing-ws</td>
<td class="org-left">t</td>
</tr>

<tr>
<td class="org-left">org-hugo-prefer-hyphen-in-tags</td>
<td class="org-left">t</td>
</tr>

<tr>
<td class="org-left">org-hugo-allow-spaces-in-tags</td>
<td class="org-left">t</td>
</tr>

<tr>
<td class="org-left">org-hugo-tag-processing-functions</td>
<td class="org-left">(org-hugo&#x2013;tag-processing-fn-replace-with-spaces-maybe org-hugo&#x2013;tag-processing-fn-replace-with-hyphens-maybe)</td>
</tr>

<tr>
<td class="org-left">org-hugo-auto-set-lastmod</td>
<td class="org-left">nil</td>
</tr>

<tr>
<td class="org-left">org-hugo-export-with-toc</td>
<td class="org-left">nil</td>
</tr>

<tr>
<td class="org-left">org-hugo-export-with-section-numbers</td>
<td class="org-left">nil</td>
</tr>

<tr>
<td class="org-left">org-hugo-front-matter-format</td>
<td class="org-left">&ldquo;toml&rdquo;</td>
</tr>

<tr>
<td class="org-left">org-hugo-default-static-subdirectory-for-externals</td>
<td class="org-left">&ldquo;ox-hugo&rdquo;</td>
</tr>

<tr>
<td class="org-left">org-hugo-external-file-extensions-allowed-for-copying</td>
<td class="org-left">(&ldquo;jpg&rdquo; &ldquo;jpeg&rdquo; &ldquo;tiff&rdquo; &ldquo;png&rdquo; &ldquo;svg&rdquo; &ldquo;gif&rdquo; &ldquo;mp4&rdquo; &ldquo;pdf&rdquo; &ldquo;odt&rdquo; &ldquo;doc&rdquo; &ldquo;ppt&rdquo; &ldquo;xls&rdquo; &ldquo;docx&rdquo; &ldquo;pptx&rdquo; &ldquo;xlsx&rdquo;)</td>
</tr>

<tr>
<td class="org-left">org-hugo-date-format</td>
<td class="org-left">&ldquo;%Y-%m-%dT%T%z&rdquo;</td>
</tr>

<tr>
<td class="org-left">org-hugo-paired-shortcodes</td>
<td class="org-left">&ldquo;&rdquo;</td>
</tr>

<tr>
<td class="org-left">org-hugo-langs-no-descr-in-code-fences</td>
<td class="org-left">nil</td>
</tr>

<tr>
<td class="org-left">org-hugo-suppress-lastmod-period</td>
<td class="org-left">0.0</td>
</tr>

<tr>
<td class="org-left">org-hugo-front-matter-format</td>
<td class="org-left">&ldquo;toml&rdquo;</td>
</tr>
</tbody>
</table>

  <!--
      (Step 2) Paste the Markdown contents (copied to kill-ring in
               Step 1 above)  after `</summary>` and before
               `</details>` below.
  -->

</details>
kaushalmodi commented 2 years ago

This is almost a duplicate of https://github.com/kaushalmodi/ox-hugo/issues/326.

ox-hugo doesn't yet support specifying the linenos value. I personally haven't yet tried enabling line numbers by default. I need to try this out and implement.

kaushalmodi commented 2 years ago

@kishvanchee This should now work:

#+begin_src text :linenos false
| col_1 | col_2 | col_3 |
| col_1 | col_2 | col_3 |
| col_1 | col_2 | col_3 |
#+end_src

The difference from your example is that the :linenos value should be false and not nil.


As your "source block" is "text", the Org example block looks better IMO:

#+begin_example :linenos false
| col_1 | col_2 | col_3 |
| col_1 | col_2 | col_3 |
| col_1 | col_2 | col_3 |
#+end_example

Updated doc: https://ox-hugo.scripter.co/doc/source-blocks/#line-number-style--linenos

Updated tests:

kishvanchee commented 2 years ago

@kaushalmodi thank you. Can confirm, it works on my end too.