Re: [O] htmlize

2017-10-25 Thread Jean-Christophe Helary
Thank you Jonas !

Jean-Christophe 


> On Oct 25, 2017, at 21:51, Jonas Bernoulli  wrote:
> 
> This was discussed here: https://github.com/hniksic/emacs-htmlize/issues/7.




Re: [O] htmlize

2017-10-25 Thread Jonas Bernoulli
This was discussed here: https://github.com/hniksic/emacs-htmlize/issues/7.



[O] htmlize

2017-10-24 Thread Jean-Christophe Helary
I tried to export to html and org told me to first install htmlize ( 
https://github.com/hniksic/emacs-htmlize).

I tried to find an emacs-htmlize in the package list, and found nothing, so I 
went to the github page and since  saw it was a seemingly normal el package 
called htmlize I checked again in the packages, found it and installed it 
directly from emacs.

Why doesn't org suggest to use package.el to install htmlize? That would be 
less confusing to users who don't have it installed by default.

Jean-Christophe 





Re: [O] htmlize and #+INCLUDE:

2012-11-01 Thread Fabrice Popineau
Thanks for the confirmation. There is no problem. It was me doing it wrong.
It works ok now.
I just have to chose between syntaxhighlighter, google code prettify or
htmlize.
I tend to prefer htmlize (probably more flexible as I can hack elisp code)
but there is thing about using my current theme with which I'm not very
comfortable.

Anyway, the more I'm using org-mode and the new exporter, the more I like
it.

Thanks for providing us with this tool.

Fabrice


2012/11/1 Nicolas Goaziou 

> Fabrice Popineau  writes:
>
> > Given the fact that '#+INCLUDE: "file" src java' is expanded into an src
> > block,
> > I assume that htmlize should apply there too. Am I wrong?
>
> I think you're correct. A quick test shows me fontification is fine. Do
> you have an ECM to show the problem?
>
> Regards,
>


Re: [O] htmlize and #+INCLUDE:

2012-11-01 Thread Nicolas Goaziou
Fabrice Popineau  writes:

> Given the fact that '#+INCLUDE: "file" src java' is expanded into an src
> block,
> I assume that htmlize should apply there too. Am I wrong?

I think you're correct. A quick test shows me fontification is fine. Do
you have an ECM to show the problem?

Regards,



Re: [O] htmlize and #+INCLUDE:

2012-11-01 Thread Fabrice Popineau
> > Is there something special to do for htmlize to process an #+INCLUDE'd
> > source file ?
>
> No.
>
> Do you mean that it should work out of the box or that it is not working
at all?
Because for me:
- I can htmlize src blocks (with BEGIN_SRC)
- I can highlight src blocks with syntaxhighlighter  (by new-exporting to
html)
- I can highlight included src blocks with syntaxhighlighter

Given the fact that '#+INCLUDE: "file" src java' is expanded into an src
block,
I assume that htmlize should apply there too. Am I wrong?

Greetings,

Fabrice


Re: [O] htmlize and #+INCLUDE:

2012-11-01 Thread Nicolas Goaziou
Hello,

Fabrice Popineau  writes:

> Is there something special to do for htmlize to process an #+INCLUDE'd
> source file ?

No.

> Besides this, as far as I Can see, I have to use :
> #+BEGIN_SRC java

> but

> #+INCLUDE: file java

It's #+INCLUDE: "file" src java

> Why to use a colon in one case and not in the other one? Or am I wrong
> here?

#+INCLUDE: is a keyword, like #+TITLE: whereas #+BEGIN_SRC is a block,
like #+BEGIN_CENTER. Not the same object, not the same syntax.


Regards,

-- 
Nicolas Goaziou



[O] htmlize and #+INCLUDE:

2012-11-01 Thread Fabrice Popineau
Hi all,

Is there something special to do for htmlize to process an #+INCLUDE'd
source file ?
Up to now, it seems to ignore it. I'm using the new exporter.

Besides this, as far as I Can see, I have to use :
#+BEGIN_SRC java
but
#+INCLUDE: file java

Why to use a colon in one case and not in the other one? Or am I wrong here?

Best regards and thanks in advance for explanations

Fabrice


Re: [O] htmlize doesn't work in --batch mode

2012-09-19 Thread Dmitri Makarov
Hi Bastien

I actually wrote an ant script that controls the off-line publishing.
It's fairly simple, assuming ELPA packages installed in ~/.emacs.d/elpa

Another important thing to note is that font-lock-mode is not enabled by default
in --batch mode.  So I ended up writing an extra .el file that is loaded
specifically for off-line publishing.

I'll paste here the relevant fragments to share in case somebody wants to do
something similar

Here are fragments of org.el loaded by emacs --batch command:

(defun common-hook-actions ()
  "Peform actions common for all programming language modes"
  (font-lock-mode 1)
  ;; a series of set-face-attribute commands to define the
  ;; fontification for SRC blocks
  (set-face-attribute 'font-lock-builtin-face nil
  :slant 'normal
  :weight 'normal
  :underline nil
  :foreground "#FF")
  ;; more of the same
)

(add-hook 'c-mode-hook
  (lambda ()
(common-hook-actions)))

;; more mode-hooks can be added

(setq org-publish-timestamp-directory "../.org-timestamps/")
;; at this point I have (setq org-publish-project-alist
;; for the projects we need to publish

And this is a fragment of my build.xml:

  


  
  
  
  
  
  

  

  


  

  

  

  


  
  
  
  
  
  
  

  

All of the above creates completely autonomous publishing project. We actually
use it collaboratively, so other people can checkout the repository, edit org
files, build html (or pdf) from the org project and publish updated content on
the web-server without having to modify their ~/.emacs (or ~/.emacs.d/init.el)
files.  Everything is done with two simple shell commands invoking ant.

I hope somebody will find this useful.

Regards,

Dmitri

On Sep 19, 2012, at 7:03 PM, Bastien  wrote:

> Hi Dmitri,
> 
> Dmitri Makarov  writes:
> 
>> If anyone interested, it's easy to explicitly load the required ELPA
>> packages in batch mode.  For example, the following command loads htmlize
>> for publishing org files in batch mode
>> 
>> emacs --batch -l ~/.emacs.d/init.el --eval "(progn (add-to-list 'load-path
>> \"~/.emacs.d/elpa/htmlize-20120616.1716\") (require 'htmlize))" -f
>> org-publish-all
>> 
>> It should be easy to include such a command in a makefile or build.xml and
>> automatically locate the latest installation of necessary packages rather
>> than explicitly specifying the path.
> 
> I let Achim be the final judge on this -- my intuitions in this areas
> are just too fragile.  But my gut feeling is that this would be too
> complicated, and the solution above is simple enough.
> 
>> Still I wonder why ELPA packages are not loaded by default in --batch
>> mode even though (package-initialize) is being evaluated.
> 
> Please ask this on the emacs-devel mailing list, I'm sure this will help
> many other users.  Several users (including me) have been puzzled by the
> way ELPA packages are loaded/initialized in Emacs.
> 
> Best,
> 
> -- 
> Bastien




Re: [O] htmlize doesn't work in --batch mode

2012-09-19 Thread Achim Gratz
Bastien writes:
> Dmitri Makarov  writes:
>> It should be easy to include such a command in a makefile or build.xml and
>> automatically locate the latest installation of necessary packages rather
>> than explicitly specifying the path.

That's what BTEST_POST is there for in the build system, you can set it
up to either load a package directly or add to the load-path first and
then require the package.  Just have a look to see how it is done.

> I let Achim be the final judge on this -- my intuitions in this areas
> are just too fragile.  But my gut feeling is that this would be too
> complicated, and the solution above is simple enough.

It is generally a bad idea to guess how the user configured his/her
system and a lot of init files are simply incompatible with batch mode.

However, the OP didn't have a problem with the build system if I read
him correctly.  My advice there is to make a minimal separate init file
just for the batch export process and load that.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptation for Waldorf microQ V2.22R2:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada




Re: [O] htmlize doesn't work in --batch mode

2012-09-19 Thread Bastien
Hi Dmitri,

Dmitri Makarov  writes:

> If anyone interested, it's easy to explicitly load the required ELPA
> packages in batch mode.  For example, the following command loads htmlize
> for publishing org files in batch mode
>
> emacs --batch -l ~/.emacs.d/init.el --eval "(progn (add-to-list 'load-path
> \"~/.emacs.d/elpa/htmlize-20120616.1716\") (require 'htmlize))" -f
> org-publish-all
>
> It should be easy to include such a command in a makefile or build.xml and
> automatically locate the latest installation of necessary packages rather
> than explicitly specifying the path.

I let Achim be the final judge on this -- my intuitions in this areas
are just too fragile.  But my gut feeling is that this would be too
complicated, and the solution above is simple enough.

> Still I wonder why ELPA packages are not loaded by default in --batch
> mode even though (package-initialize) is being evaluated.

Please ask this on the emacs-devel mailing list, I'm sure this will help
many other users.  Several users (including me) have been puzzled by the
way ELPA packages are loaded/initialized in Emacs.

Best,

-- 
 Bastien



[O] htmlize doesn't work in --batch mode

2012-09-14 Thread Dmitri Makarov
If anyone interested, it's easy to explicitly load the required ELPA packages 
in batch mode.  For example, the following command loads htmlize for publishing 
org files in batch mode

emacs --batch -l ~/.emacs.d/init.el --eval "(progn (add-to-list 'load-path 
\"~/.emacs.d/elpa/htmlize-20120616.1716\") (require 'htmlize))" -f 
org-publish-all

It should be easy to include such a command in a makefile or build.xml and 
automatically locate the latest installation of necessary packages rather than 
explicitly specifying the path.

Still I wonder why ELPA packages are not loaded by default in --batch mode even 
though (package-initialize) is being evaluated.

Regards,

Dmitri




[O] htmlize doesn't work in --batch mode

2012-09-11 Thread Dmitri Makarov
Hi all,

I'm having a problem with offline exports.
If I run emacs in --batch mode like this

emacs -batch -l ~/.emacs.d/init.el -eval '(org-publish-all)'

it doesn't seem to load the packages installed by the ELPA package manager.
In particular it doesn't load htmlize package and also loads the bundled org
version 7.8.11 whereas I have newer version 7.9.1 installed in packages.

Also, it seems for the new version of org to take over the bundled org
package when I run emacs in normal window mode I have to invoke
(require 'org-install) from after-init-hook like this

(add-hook 'after-init-hook
  (lambda ()
(load-file "~/.emacs.d/org.el")))

org.el among other things includes (require 'org-install)

If I place (require 'org-install) directly in my init.el,
emacs loads the org package bundled with the emacs installation,
not the one installed by the package manager, probably because
package-initialize is evaluated after init.el has been loaded.

Is this normal?  Did anyone have the same problem?
My emacs version is GNU Emacs 24.2.1.

I hope my questions make sense, as I don't really have much experience with 
emacs package management, and it seems difficult to describe the problem 
clearly.
I apologize for this is not being an org-mode question, but since many org users
use htmlize, I figure some of them probably want to export their org files
in batch mode, and perhaps they've faced the same issues with packages
in batch mode that I'm having.

Regards,

Dmitri