logo
down
shadow

How to use HTMLIZE in a function and change the local buffer to HTMLIZE output buffer?


How to use HTMLIZE in a function and change the local buffer to HTMLIZE output buffer?

Content Index :

How to use HTMLIZE in a function and change the local buffer to HTMLIZE output buffer?
Tag : emacs , By : August
Date : January 11 2021, 03:34 PM

it should still fix some issue htmlize-buffer returns the htmlized buffer, so you can just use that as the buffer arg to browser-url-of-buffer.
(defun print-to-browser ()
  (interactive)
  (browse-url-of-buffer (htmlize-buffer)))

Comments
No Comments Right Now !

Boards Message :
You Must Login Or Sign Up to Add Your Comments .

Share : facebook icon twitter icon

Emacs htmlize in batch mode?


Tag : emacs , By : Erwin
Date : March 29 2020, 07:55 AM
this one helps. Does using the first one with -nw work? that should prevent an X window being opened, but there should still be enough of the 'GUI' part of emacs present to be able to initialise the faces system. It's still not as elegant as -batch (it'll fail if run from a non-terminal process, eg crontab) but it'll be less irritating.

Tag : html , By : 40a
Date : March 29 2020, 07:55 AM
help you fix your problem for @Andreas 's hints, I add following code to htmlize.el. Currently the org-link can be htmlized to clickable link.
The code was shared on github:
(defun expand-org-link (&optional buffer)
  "Change [[url][shortname]] to [[url] [shortname]] by adding a space between url and shortname"
  (goto-char (point-min))
  (while (re-search-forward "\\[\\[\\([^][]+\\)\\]\\(\\[\\([^][]+\\)\\]\\)?\\]"
                nil t)
    (let ((url (match-string 1))
      (link-text (match-string 3)))
      (delete-region (match-beginning 0) (match-end 0))
      (insert "[[" url "] [" link-text "]]"))))

(defun shrink-org-link (&optional buffer)
  "Change [[url] [shortname]] to [[url][shortname]], remove the space between url and shortname"
  (goto-char (point-min))
  (while (re-search-forward "\\[\\[\\([^][]+\\)\\] \\(\\[\\([^][]+\\)\\]\\)?\\]"
                nil t)
    (let ((url (match-string 1))
      (link-text (match-string 3)))
      (delete-region (match-beginning 0) (match-end 0))
      (insert "[[" url "][" link-text "]]"))))

(defun transform-org-link ()
  "transform htmlized <span> to <a>"
  (goto-char (point-min))
  (while (re-search-forward "\\[\\[<span \\([^>]+\\)>\\([^][]+\\)</span>\\] \\[\\([^][]+\\)\\]\\]"
                nil t)
    (let ((style (match-string 1))
          (url (match-string 2))
      (link-text (match-string 3)))
      (delete-region (match-beginning 0) (match-end 0))
      (insert "<a " style " href=\"" url "\">" link-text "</a>"))))

org-mode highlighting using minted for latex and htmlize for html


Tag : latex , By : Matt Logan
Date : March 29 2020, 07:55 AM
To fix this issue I'm trying to rewrite some document from latex in org-mode. , You can patch the file _mapping.py in ../pygments/lexers/, line 193:
'NasmLexer': ('pygments.lexers.asm', 'NASM', ('nasm','asm'), ('*.asm', '*.ASM'), ('text/x-nasm',)),

how to disable background attribution in htmlize.el when exporting html


Tag : python , By : Adam May
Date : March 29 2020, 07:55 AM
should help you out omg, at last using the command M-x htmlize-buffer, i found it may be due to the variable py-number-face and py-variable-name-face. then I just set them to nil at .emacs file.

How to get htmlize.el work for project publishing in Emacs org-mode?


Tag : emacs , By : Francis
Date : March 29 2020, 07:55 AM
Related Posts Related QUESTIONS :
  • How to send every command to Emacs Term?
  • How to send <C-left> into Emacs term?
  • Build C program in gcc and run it in valgrind using Emacs
  • setting new shortcut for tag search on emacs org-mode
  • Setting a directory using "system-name" on Elisp
  • Change Emacs theme with mode
  • Run function with arguments inside of a standard hook
  • Org-Mode: call the noweb insertion from the noweb insertion
  • How does emacs interpreter evaluate an expression?
  • verilog_mode autoreginput behavior when using assignment
  • How to compile CEDET 1.0pre7 compilation for Emacs 23.1.50 on Windows?
  • How to gracefully exit SLIME and Emacs?
  • How to setup custom font in emacs?
  • Other editors that can use slime/swank?
  • Opening multiple files at once in Emacs
  • Opening emacs without the scratch buffer when opening a file
  • Doom emacs display various themes in terminal
  • Why does emacs fail to install 'gnu-elpa-keyring-update-' and some other packages?
  • How can I change the behavior of a key in Emacs?
  • How to prevent macroexpand-all to skip first form in list?
  • How to change color of a certain string in Emacs?
  • Multiple-cursors in Emacs does not modify all the cursors
  • Emacs's run scl before compile command
  • Remove the suffix of a returned filename
  • How to Call a Function in Emacs Mode Line Format
  • shadow
    Privacy Policy - Terms - Contact Us © scrbit.com