emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* :noweb no-export and syntax highlighting upon export to html
@ 2015-11-05 11:38 Joost Helberg
  2015-11-05 14:45 ` Aaron Ecay
  0 siblings, 1 reply; 4+ messages in thread
From: Joost Helberg @ 2015-11-05 11:38 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 897 bytes --]

ls,

In the org-code below syntax highlighting in both code-blocks in the
emacs-buffer is fine, but the html-export only works nice in case of
using :noweb yes, the no-export option screws up syntax highlighting in
the html-output (two screenshots included).

I understood that htmlize is used for html-export and that it honours
the faces in the emacs-buffer. It seems as if htmlize doesn't do this
after encountering the '>>' token.

Can I avoid this? Are settings involved?

Org-code:

/bla/ is for re-use in scripts.
#+caption: /bla/:
#+name: bla
#+begin_src sh 
   # this sits in projects/t-stuff
#+end_src

#+caption: /t1.sh/:
#+name: t1
#+begin_src sh :tangle t1.sh :noweb no-export 
  <<bla>>
  for i in `seq 1 10`
  do
    echo $i
  done
#+end_src

#+caption: /t2.sh/:
#+name: t2
#+begin_src sh :tangle t2.sh :noweb yes 
  <<bla>>
  for i in `seq 1 10`
  do
    echo $i
  done
#+end_src


[-- Attachment #2: emacs-buffer.png --]
[-- Type: image/png, Size: 11510 bytes --]

[-- Attachment #3: org-html-export.png --]
[-- Type: image/png, Size: 17048 bytes --]

[-- Attachment #4: Type: text/plain, Size: 45 bytes --]


many regards,

Joost Helberg

-- 
Snow B.V.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: :noweb no-export and syntax highlighting upon export to html
  2015-11-05 11:38 :noweb no-export and syntax highlighting upon export to html Joost Helberg
@ 2015-11-05 14:45 ` Aaron Ecay
  2015-11-08 10:39   ` Joost Helberg
  0 siblings, 1 reply; 4+ messages in thread
From: Aaron Ecay @ 2015-11-05 14:45 UTC (permalink / raw)
  To: Joost Helberg, emacs-orgmode

Hi Joost,

Org’s html export relies on the syntax of the source block being valid
in the block’s language, for the corresponding emacs major mode to
highlight it properly.  In general, I wouldn’t rely on it behaving
properly in the presence of unexpanded noweb references.  That said...

2015ko azaroak 5an, Joost Helberg-ek idatzi zuen:
> 
> ls,
> 
> In the org-code below syntax highlighting in both code-blocks in the
> emacs-buffer is fine, but the html-export only works nice in case of
> using :noweb yes, the no-export option screws up syntax highlighting in
> the html-output (two screenshots included).
> 
> I understood that htmlize is used for html-export and that it honours
> the faces in the emacs-buffer. It seems as if htmlize doesn't do this
> after encountering the '>>' token.

Your example works fine for me on latest org master.  Can you send your
org version?  (M-x org-version)  What happens if you insert the code for
t1 into an sh-mode buffer: is it highlighted as expected?

-- 
Aaron Ecay

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: :noweb no-export and syntax highlighting upon export to html
  2015-11-05 14:45 ` Aaron Ecay
@ 2015-11-08 10:39   ` Joost Helberg
  2015-11-08 17:19     ` Aaron Ecay
  0 siblings, 1 reply; 4+ messages in thread
From: Joost Helberg @ 2015-11-08 10:39 UTC (permalink / raw)
  To: Aaron Ecay; +Cc: emacs-orgmode

Dear Aaron,

I was running close to the development version, but not close
enough. It's solved now in the current version of org-mode.

At first I accepted this odd behaviour, but then I realized htmlize is
supposed to give you what you see on screen, hence this was a bug.

regards,

Joost

>>>>> "Aaron" == Aaron Ecay <aaronecay@gmail.com> writes:
 > From: Aaron Ecay <aaronecay@gmail.com>
 > To: Joost Helberg <joost@snow.nl>, emacs-orgmode@gnu.org
 > Subject: Re: [O] :noweb no-export and syntax highlighting upon export
 > Date: 2015-11-05T15:45:34+0100

 > Hi Joost,

 > Org’s html export relies on the syntax of the source block being valid
 > in the block’s language, for the corresponding emacs major mode to
 > highlight it properly.  In general, I wouldn’t rely on it behaving
 > properly in the presence of unexpanded noweb references.  That said...

 > 2015ko azaroak 5an, Joost Helberg-ek idatzi zuen:
 >> 
 >> ls,
 >> 
 >> In the org-code below syntax highlighting in both code-blocks in the
 >> emacs-buffer is fine, but the html-export only works nice in case of
 >> using :noweb yes, the no-export option screws up syntax highlighting in
 >> the html-output (two screenshots included).
 >> 
 >> I understood that htmlize is used for html-export and that it honours
 >> the faces in the emacs-buffer. It seems as if htmlize doesn't do this
 >> after encountering the '>>' token.

 > Your example works fine for me on latest org master.  Can you send your
 > org version?  (M-x org-version)  What happens if you insert the code for
 > t1 into an sh-mode buffer: is it highlighted as expected?

 > -- 
 > Aaron Ecay


-- 
Snow B.V.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: :noweb no-export and syntax highlighting upon export to html
  2015-11-08 10:39   ` Joost Helberg
@ 2015-11-08 17:19     ` Aaron Ecay
  0 siblings, 0 replies; 4+ messages in thread
From: Aaron Ecay @ 2015-11-08 17:19 UTC (permalink / raw)
  To: Joost Helberg; +Cc: emacs-orgmode

Hi Joost,

2015ko azaroak 8an, Joost Helberg-ek idatzi zuen:
> 
> Dear Aaron,
> 
> I was running close to the development version, but not close
> enough. It's solved now in the current version of org-mode.
> 
> At first I accepted this odd behaviour, but then I realized htmlize is
> supposed to give you what you see on screen, hence this was a bug.

I’m glad the bug has disappeared (at least, that’s what I understand
from your message).  Thanks for the update, and do let us know if it
comes back.

Thanks,

-- 
Aaron Ecay

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-11-08 17:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-05 11:38 :noweb no-export and syntax highlighting upon export to html Joost Helberg
2015-11-05 14:45 ` Aaron Ecay
2015-11-08 10:39   ` Joost Helberg
2015-11-08 17:19     ` Aaron Ecay

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).