emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Tim Cross <theophilusx@gmail.com>
To: "M. Pger" <mpger@protonmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: no syntax highlighting for code blocks with org-publish
Date: Tue, 19 Jul 2022 17:51:25 +1000	[thread overview]
Message-ID: <86v8rtfrxs.fsf@gmail.com> (raw)
In-Reply-To: <inTtQOKWAhnFydjBE9fQOOdo_oV6kIPG5_E0d8DsfFiYMIJ4RNLRk68Id6dyrzy1qIDK8YJu0Wty7objv22vR31PNrh-qB9vKxMgHPxNAu8=@protonmail.com>


"M. Pger" <mpger@protonmail.com> writes:

> Thanks for your suggestion. I added the following:
>
> #+begin_src elisp :eval no :exports code
>   (setq my-var "org mailing list")
>   (message "Hello, %s" my-var)
> #+end_src
>
> When exported with ~C-c C-e h o~, syntax highlighting is implemented (with colors). When
> exported with org-publish interestingly I have no color, but =setq= is in bold. Would it
> be possible that ox-publish implements some kind of really basic builtin syntax
> highlighting and ignores htmlize?
>
>

I tried both exporting an org file into html and publishing and didn't
get any syntax highlighting for either case. Had a closer look and
noticed it didn't look like htmlize was being loaded. Did a (require
'htmlize) and did both an export and publish, betting syntax
highlighting for both.

My suspicion is that for the publish option, htmlize wasn't loaded?
Maybe worth doing an explicit require and then call org-publish directly
and see if that makes any difference.

Below is the basic publish alist setting I used. Doubt all the slots are
relevant - it was just a snippet from another project I grabbed to get
setup. 

I also run M-x org-publish <ret> orgfiles <ret> rather than the export menu.

(setq org-publish-project-alist
      '(("orgfiles"
         :base-directory "~/playground/org/"
         :base-extension "org"
         :recursive t
         :publishing-directory "~/Public"
         :publishing-function org-html-publish-to-html
         :exclude "PrivatePage.org"
         :html-style-default ""
         :html-scripts ""
         :html-htmlize-output-type 'inline-css
         :html-doctype "html5"
         :html-html5-fancy t
         :html-validation-link nil
         ))) 


  reply	other threads:[~2022-07-19  8:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-17 17:24 no syntax highlighting for code blocks with org-publish M. Pger
2022-07-17 23:42 ` Ihor Radchenko
2022-07-18  8:57   ` M. Pger
2022-07-18 21:50     ` Tim Cross
2022-07-18 22:55       ` M. Pger
2022-07-19  7:51         ` Tim Cross [this message]
2022-07-19 15:34           ` M. Pger
2022-07-19 22:33             ` Tim Cross
2022-07-19 23:14               ` M. Pger
2022-07-20  5:22                 ` M. Pger
2022-07-21 11:38                   ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86v8rtfrxs.fsf@gmail.com \
    --to=theophilusx@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=mpger@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).