40
votes
Accepted
New line in Title of an org-mode exported html document
Org mode 8 no longer accepts LaTeX characters like that. The correct way to do it is embed export snippets in the title:
#+TITLE: Foo @@latex:\\@@ Bar
I assume therefore that if you want to export ...
26
votes
Accepted
How to make Emacs render HTML without having to save the file?
My preferred tool for live-editing HTML documents is skewer-mode. It updates the document in the browser without a refresh, so you get instant feedback on your changes.
Here's a demo video that shows ...
24
votes
How to make Emacs render HTML without having to save the file?
Impatient Mode will get you most of the way there. Here's a cool video.
It's especially handy when doing the first styling and prototyping. Since it renders the current buffer, you'll have to put all ...
21
votes
Accepted
How prettify (newlines and indentation) an optimized HTML/JS file?
You can use the built-in sgml-mode for this.
M-x sgml-mode - Enable the sgml-mode major mode so that sgml-pretty-print command auto-loads.
C-x h - Select the whole buffer.
M-x sgml-pretty-print
To ...
19
votes
Accepted
Org mode - Parsing rich HTML directly when pasting?
is it feasible to make one?
Since this is emacs, yes.
My approach is to use a 3rd party tools that can take HTML and convert to plain text or even directly to Org format. I think this is an ugly ...
16
votes
Accepted
How to include rendered HTML in org mode?
If you want to include literal HTML in your org file, and have it exported only when you export to HTML, use an export block:
#+BEGIN_EXPORT html
<br>
<h2>This is the footer.</h2>
&...
15
votes
Accepted
Set the background of org-exported <code> blocks according to theme
First, I believe org can use htmlize to automatically color your source code blocks according to your theme.
Alternatively.
Check out http://definitelyaplug.b0.cx/post/custom-inlined-css-in-org-mode-...
13
votes
Accepted
Creating permalinks for sections in HTML exported from org-mode
You can get this result by setting the CUSTOM_ID property.
From the following file:
* Test
:PROPERTIES:
:CREATED: [2014-10-02 Thu 11:48]
:END:
** Sub no custom
:PROPERTIES:
:CREATED: [2014-10-02 ...
12
votes
Accepted
How do I export an ORG file to an interactive HTML site?
What you are looking for is org-info.js, a JavaScript library to be used in conjunction with HTML files generated from Org. This library adds support for folding, navigation, etc.
Take a look at ...
12
votes
Accepted
HTML mode that closes tags
With the default HTML mode as of Emacs 24.4, you can get the same behavior as Sublime Text (automatic insertion of the closing tag if you type </) by putting the following line in your init file:
(...
11
votes
Accepted
Format a HTML paper with Org-mode
Maybe something like this (tested with LaTeX and HTML)
#+TITLE: An Orged Paper
#+AUTHOR: Rasmus
#+DATE: A Dark Day for Science
#+RESULTS: html-header
#+begin_abstract
#+begin_center
{{{html-only(*...
11
votes
Accepted
automatically move to n-th character on line after each C-n or C-p
set-goal-column might be what you're looking for :
set-goal-column is an interactive compiled Lisp function in
`simple.el'.
It is bound to C-x C-n.
(set-goal-column ARG)
Set the current horizontal ...
10
votes
How to convert a series of lines into a working HTML list?
Alternatively to query replace you can go with multiple-cursors:
Also consider using something like this:
(defun wrap-html-tag (tagName)
"Add a tag to beginning and ending of current word or text ...
10
votes
Accepted
no html/jsx indentation in jsx-mode
This is a known issue and as of now, it has not been fixed. I've decided to forego jsx-mode for this reason and just use web-mode. It has support for JSX and is better suited for mixed content files.
...
9
votes
Accepted
How to add new markup to org-mode HTML export?
Org is extremely versatile when it comes to defining links, so they're probably your best bet. For that you need the org-add-link-type function.
(org-add-link-type "audio" #'ignore #'endless/export-...
9
votes
no html/jsx indentation in jsx-mode
FYI for anyone else who comes across this issue, this is because this jsx-mode project is not made to edit Facebook's React JSX templates but rather this other compiled javascript language also called ...
9
votes
Accepted
Org-mode external links not working when exported to HTML
The string behind :: is actually a search. In this context one understands the relevant comment in the source code of the function org-html-link in the library file ox-html.el (org 8.2.5).
It says:
...
8
votes
How to convert a series of lines into a working HTML list?
You can use query-replace-regexp (C-M-%). Replace ^\(.*\)$ with <li>\1</li>.
8
votes
Markdown preview in Emacs using pandoc
After a while, I found the answer myself:
In a nutshell: Use a combination of Eww and markdown mode, and configure markdown mode to render markdown with pandoc.
Alas, easier said than done.
Update ...
7
votes
Accepted
How to convert a series of lines into a working HTML list?
The most direct way of doing this would be to
Mark the region of text lines to become a list
Press M-% (query-replace)
Type C-q C-j RET </li> C-q C-j <li> RET (C-q C-j inserts a quoted ...
6
votes
Accepted
HTML editing with preview
You have some options: http://wikemacs.org/wiki/Markdown#Impatient-mode the best for html looking to be impatient-mode, it allows to see the changes in your browser while you type.
After ...
6
votes
Accepted
Emacs script to indent files from the command line
@glucas's answer is correct in its diagnosis, but has a minor problem (you want the 0th element of argv) and is incomplete. Here is a more complete example:
#!/usr/bin/env -S emacs --script
(find-...
5
votes
How to make Emacs render HTML without having to save the file?
You could write a minor mode that refreshes the rendered webpage after you modify any relevant buffer.
Of course, doing so after each keystroke would be overkill, so using a timer and rendering when ...
5
votes
How to add new markup to org-mode HTML export?
You can use the org-mode macro replacement to achieve this.
A macro called AUDIO can be defined as below
#+MACRO AUDIO @@html:<audio src="$1"></audio>@@
Using your example, here is ...
5
votes
Finding the place where auto-fill-mode is getting enabled and disabling it
You can get Emacs to show you a stack trace when the function is called, so that you can figure out what called it.
M-x debug-on-entry RET auto-fill-mode RET
trigger the issue
Check the stack trace. ...
5
votes
Accepted
How can I generate the <abbr> HTML tag from org-mode?
I guess the simplest way is to define a macro in your orgmode file with:
#+MACRO: abbr @@html:<abbr title="$1">$2</abbr>@@
You can then add an abbr in your text with:
{{{abbr(Definition,...
5
votes
Do not add TITLE as heading to body when exporting org file
You can hide the title by providing the appropriate CSS setting. For example, add this line to your file (and hit C-c C-c to activate the change):
#+HTML_HEAD: <style type="text/css"> <!--/*...
5
votes
Accepted
Org-Mode: Exclude specific code line from html export
Take a look at the prologue header argument for Babel source blocks. You can use it to prepend some text to a code block prior to execution, and, like any other header argument, it isn't included in ...
5
votes
Center image in GitHub's README.org
To center with CSS, you need to use margin-left: auto; and margin-right: auto;
try this
#+ATTR_HTML: :style margin-left: auto; margin-right: auto;
[[/path/to/img.png]]
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
html × 175org-mode × 88
org-export × 69
latex × 22
web-mode × 11
org-babel × 8
mathjax × 8
javascript × 7
indentation × 6
pdf × 6
eww × 6
css × 6
images × 5
web-browser × 5
major-mode × 3
org-publish × 3
w3m × 3
right-to-left × 3
hooks × 2
completion × 2
gnus × 2
replace × 2
auto-complete-mode × 2
whitespace × 2
org-link × 2