* Is there an environment for Org syntax?
@ 2014-03-14 21:41 Fletcher Charest
2014-03-14 22:13 ` Phil Regier
0 siblings, 1 reply; 11+ messages in thread
From: Fletcher Charest @ 2014-03-14 21:41 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 628 bytes --]
Dear all,
I am currently writing a practical tutorial about Org for absolute
beginners. In the end, I would like to export it in multiple formats, HTML
for sure, but maybe LaTeX too (I am, of course, writing it with org-mode).
I am not aware of a functionality, or hack, which would allow me to include
Org syntax in the document, without it being taken into account by Org
itself and the exporter as being part of the document structure. Instead,
I'd like it to be exported as it appears in my Emacs Org file, including
colors, etc. I hope I am explaining this clearly.
Is it possible?
Thank you very much for you help,
FC
[-- Attachment #2: Type: text/html, Size: 706 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Is there an environment for Org syntax?
2014-03-14 21:41 Is there an environment for Org syntax? Fletcher Charest
@ 2014-03-14 22:13 ` Phil Regier
2014-03-14 22:59 ` Fletcher Charest
2014-03-15 4:44 ` Kyle Meyer
0 siblings, 2 replies; 11+ messages in thread
From: Phil Regier @ 2014-03-14 22:13 UTC (permalink / raw)
To: Fletcher Charest; +Cc: emacs-orgmode
I had thought that '#+begin_src org :exports code' would do just this, though I believe you have to then begin each line with a comma inside the block.
For me, the following:
#+begin_src org :exports code
,#+begin_src org :exports code
,#+end_src
#+end_src
produces Org code via the HTML and Latex export backends. I think there are syntax highlighting export extensions in the wild (just search the web for something like 'org export syntax highlighting' to see a diverse collection of proposed solutions; Pygments appears to be a common theme, though I know nothing about it), but AFAIK they are not distributed with Org at this time.
Does that at least address the first part of your inquiry? Sorry I couldn't offer anything actionable for the second; maybe someone else can pick up where I left off.
Phil
----- Original Message -----
From: "Fletcher Charest" <fletcher.charest@gmail.com>
To: emacs-orgmode@gnu.org
Sent: Friday, March 14, 2014 4:41:12 PM
Subject: [O] Is there an environment for Org syntax?
Dear all,
I am currently writing a practical tutorial about Org for absolute
beginners. In the end, I would like to export it in multiple formats, HTML
for sure, but maybe LaTeX too (I am, of course, writing it with org-mode).
I am not aware of a functionality, or hack, which would allow me to include
Org syntax in the document, without it being taken into account by Org
itself and the exporter as being part of the document structure. Instead,
I'd like it to be exported as it appears in my Emacs Org file, including
colors, etc. I hope I am explaining this clearly.
Is it possible?
Thank you very much for you help,
FC
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Is there an environment for Org syntax?
2014-03-14 22:13 ` Phil Regier
@ 2014-03-14 22:59 ` Fletcher Charest
2014-03-14 23:04 ` Phil Regier
2014-03-15 4:44 ` Kyle Meyer
1 sibling, 1 reply; 11+ messages in thread
From: Fletcher Charest @ 2014-03-14 22:59 UTC (permalink / raw)
To: Phil Regier; +Cc: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 2155 bytes --]
Yes, thank you very much, that was it. I was thinking about doing this, but
I didn't know how to "escape" the syntax. This is quite embarrassing since
I just noticed that it is explained in the manual, and even more, since the
comma is added automatically when you edit the org code by hitting C-c '
anyway...
Thanks again!
Best regards,
FC
On Fri, Mar 14, 2014 at 11:13 PM, Phil Regier <pregier@ittc.ku.edu> wrote:
> I had thought that '#+begin_src org :exports code' would do just this,
> though I believe you have to then begin each line with a comma inside the
> block.
>
> For me, the following:
>
> #+begin_src org :exports code
> ,#+begin_src org :exports code
> ,#+end_src
> #+end_src
>
> produces Org code via the HTML and Latex export backends. I think there
> are syntax highlighting export extensions in the wild (just search the web
> for something like 'org export syntax highlighting' to see a diverse
> collection of proposed solutions; Pygments appears to be a common theme,
> though I know nothing about it), but AFAIK they are not distributed with
> Org at this time.
>
> Does that at least address the first part of your inquiry? Sorry I
> couldn't offer anything actionable for the second; maybe someone else can
> pick up where I left off.
>
> Phil
>
> ----- Original Message -----
> From: "Fletcher Charest" <fletcher.charest@gmail.com>
> To: emacs-orgmode@gnu.org
> Sent: Friday, March 14, 2014 4:41:12 PM
> Subject: [O] Is there an environment for Org syntax?
>
> Dear all,
>
> I am currently writing a practical tutorial about Org for absolute
> beginners. In the end, I would like to export it in multiple formats, HTML
> for sure, but maybe LaTeX too (I am, of course, writing it with org-mode).
> I am not aware of a functionality, or hack, which would allow me to include
> Org syntax in the document, without it being taken into account by Org
> itself and the exporter as being part of the document structure. Instead,
> I'd like it to be exported as it appears in my Emacs Org file, including
> colors, etc. I hope I am explaining this clearly.
>
> Is it possible?
>
> Thank you very much for you help,
>
> FC
>
>
[-- Attachment #2: Type: text/html, Size: 2897 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Is there an environment for Org syntax?
2014-03-14 22:59 ` Fletcher Charest
@ 2014-03-14 23:04 ` Phil Regier
2014-03-14 23:21 ` Fletcher Charest
0 siblings, 1 reply; 11+ messages in thread
From: Phil Regier @ 2014-03-14 23:04 UTC (permalink / raw)
To: Fletcher Charest; +Cc: emacs-orgmode
I spent hours trying to figure out recursive org syntax, and only got it working with the help of the list. :)
I realized after my last message that Worg uses some limited syntax highlighting on some of the newer pages; I'm not very good with javascript and css, but you might be able to borrow some code for highlighting by inspecting the org and html source...
Phil
----- Original Message -----
From: "Fletcher Charest" <fletcher.charest@gmail.com>
To: "Phil Regier" <pregier@ittc.ku.edu>
Cc: emacs-orgmode@gnu.org
Sent: Friday, March 14, 2014 5:59:03 PM
Subject: Re: [O] Is there an environment for Org syntax?
Yes, thank you very much, that was it. I was thinking about doing this, but
I didn't know how to "escape" the syntax. This is quite embarrassing since
I just noticed that it is explained in the manual, and even more, since the
comma is added automatically when you edit the org code by hitting C-c '
anyway...
Thanks again!
Best regards,
FC
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Is there an environment for Org syntax?
2014-03-14 23:04 ` Phil Regier
@ 2014-03-14 23:21 ` Fletcher Charest
2014-03-14 23:34 ` Phil Regier
0 siblings, 1 reply; 11+ messages in thread
From: Fletcher Charest @ 2014-03-14 23:21 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 1559 bytes --]
Thank you, this sounds interesting; I'm not very good either, but I will
have a look at this. And I actually have a related question (I hope it's
not in the manual this time): is it possible to indent the Org syntax in
the HTML export as it is indented in an Emacs buffer when
org-indent-modeis activated? The indentation in the HTML file looks
like the one you get
in Org by default, even if my org-indent-mode variable is set to t in my
Org buffer.
Thank you,
FC
On Sat, Mar 15, 2014 at 12:04 AM, Phil Regier <pregier@ittc.ku.edu> wrote:
> I spent hours trying to figure out recursive org syntax, and only got it
> working with the help of the list. :)
>
> I realized after my last message that Worg uses some limited syntax
> highlighting on some of the newer pages; I'm not very good with javascript
> and css, but you might be able to borrow some code for highlighting by
> inspecting the org and html source...
>
> Phil
>
> ----- Original Message -----
> From: "Fletcher Charest" <fletcher.charest@gmail.com>
> To: "Phil Regier" <pregier@ittc.ku.edu>
> Cc: emacs-orgmode@gnu.org
> Sent: Friday, March 14, 2014 5:59:03 PM
> Subject: Re: [O] Is there an environment for Org syntax?
>
> Yes, thank you very much, that was it. I was thinking about doing this, but
> I didn't know how to "escape" the syntax. This is quite embarrassing since
> I just noticed that it is explained in the manual, and even more, since the
> comma is added automatically when you edit the org code by hitting C-c '
> anyway...
>
> Thanks again!
>
> Best regards,
>
> FC
>
[-- Attachment #2: Type: text/html, Size: 2421 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Is there an environment for Org syntax?
2014-03-14 23:21 ` Fletcher Charest
@ 2014-03-14 23:34 ` Phil Regier
2014-03-17 13:58 ` Fletcher Charest
0 siblings, 1 reply; 11+ messages in thread
From: Phil Regier @ 2014-03-14 23:34 UTC (permalink / raw)
To: Fletcher Charest; +Cc: emacs-orgmode
I'm not sure whether I follow you here, because I'm accustomed to seeing indents passed through. If I export the following:
#+begin_src org :exports code
,#+begin_src org :exports code
indented text
,#+end_src
#+end_src
...then my HTML export adds as many spaces as there are in the block edit buffer. Is that not what you see, or are you looking for something more sophisticated?
Phil
----- Original Message -----
From: "Fletcher Charest" <fletcher.charest@gmail.com>
To: emacs-orgmode@gnu.org
Sent: Friday, March 14, 2014 6:21:35 PM
Subject: Re: [O] Is there an environment for Org syntax?
Thank you, this sounds interesting; I'm not very good either, but I will
have a look at this. And I actually have a related question (I hope it's
not in the manual this time): is it possible to indent the Org syntax in
the HTML export as it is indented in an Emacs buffer when
org-indent-modeis activated? The indentation in the HTML file looks
like the one you get
in Org by default, even if my org-indent-mode variable is set to t in my
Org buffer.
Thank you,
FC
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Is there an environment for Org syntax?
2014-03-14 22:13 ` Phil Regier
2014-03-14 22:59 ` Fletcher Charest
@ 2014-03-15 4:44 ` Kyle Meyer
1 sibling, 0 replies; 11+ messages in thread
From: Kyle Meyer @ 2014-03-15 4:44 UTC (permalink / raw)
To: Phil Regier; +Cc: Fletcher Charest, emacs-orgmode
On 03/14/14 18:13, Phil Regier wrote:
[...]
> I think there are syntax highlighting export extensions in the wild
> (just search the web for something like 'org export syntax
> highlighting' to see a diverse collection of proposed solutions;
> Pygments appears to be a common theme, though I know nothing about
> it), but AFAIK they are not distributed with Org at this time.
Another option for syntax highlighting in HTML is htmlize. After
installing htmlize, =(require 'htmlize)= should be all that's needed.
--
Kyle Meyer
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Is there an environment for Org syntax?
2014-03-14 23:34 ` Phil Regier
@ 2014-03-17 13:58 ` Fletcher Charest
2014-03-18 17:10 ` Phil Regier
2014-03-19 10:09 ` Bastien
0 siblings, 2 replies; 11+ messages in thread
From: Fletcher Charest @ 2014-03-17 13:58 UTC (permalink / raw)
To: Phil Regier; +Cc: emacs-orgmode
[-- Attachment #1.1: Type: text/plain, Size: 2104 bytes --]
Hello Phil,
When I use the edit buffer (by pressing C-c '), my Org syntax is indented
properly (in accordance with org-indent-mode, which is set to t). The code
block itself looks like this after editing:
#+BEGIN_SRC org :exports code
,* Top level headline
,** Second level
,*** Third level
some text
,*** Third level
more text
#+END_SRC
As you can see, the text ('some text' and 'more text') is not indented.
This is a little bit annoying, but not too much - I can add the spaces
myself.
The problem is with the HTML export: I can't see the HTML output as I would
see it in my Emacs buffer, that is to say, without the leading stars. In my
output (see attached), leading stars are visible, although not colored. I
would like them to be completely invisible.
Do you observe the same thing? My org-version is 8.2.5h-30-gdd810b-elpaplus
under GNU Emacs 24.3.1.
Thanks,
FC
On Sat, Mar 15, 2014 at 12:34 AM, Phil Regier <pregier@ittc.ku.edu> wrote:
> I'm not sure whether I follow you here, because I'm accustomed to seeing
> indents passed through. If I export the following:
>
> #+begin_src org :exports code
> ,#+begin_src org :exports code
> indented text
> ,#+end_src
> #+end_src
>
> ...then my HTML export adds as many spaces as there are in the block edit
> buffer. Is that not what you see, or are you looking for something more
> sophisticated?
>
> Phil
>
> ----- Original Message -----
> From: "Fletcher Charest" <fletcher.charest@gmail.com>
> To: emacs-orgmode@gnu.org
> Sent: Friday, March 14, 2014 6:21:35 PM
> Subject: Re: [O] Is there an environment for Org syntax?
>
> Thank you, this sounds interesting; I'm not very good either, but I will
> have a look at this. And I actually have a related question (I hope it's
> not in the manual this time): is it possible to indent the Org syntax in
> the HTML export as it is indented in an Emacs buffer when
> org-indent-modeis activated? The indentation in the HTML file looks
> like the one you get
> in Org by default, even if my org-indent-mode variable is set to t in my
> Org buffer.
>
> Thank you,
>
> FC
>
[-- Attachment #1.2: Type: text/html, Size: 3295 bytes --]
[-- Attachment #2: html_output.png --]
[-- Type: image/png, Size: 3363 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Is there an environment for Org syntax?
2014-03-17 13:58 ` Fletcher Charest
@ 2014-03-18 17:10 ` Phil Regier
2014-03-19 10:09 ` Bastien
1 sibling, 0 replies; 11+ messages in thread
From: Phil Regier @ 2014-03-18 17:10 UTC (permalink / raw)
To: Fletcher Charest; +Cc: emacs-orgmode
Sorry, Fletcher, but this is beyond me. If what you want is essentially a buffer-based screenshot, then it may in theory be easier, relatively speaking, to build elisp routines to copy the contents of buffers, but that would be even further beyond my abilities.
Phil
----- Original Message -----
From: "Fletcher Charest" <fletcher.charest@gmail.com>
To: "Phil Regier" <pregier@ittc.ku.edu>
Cc: emacs-orgmode@gnu.org
Sent: Monday, March 17, 2014 8:58:18 AM
Subject: Re: [O] Is there an environment for Org syntax?
Hello Phil,
When I use the edit buffer (by pressing C-c '), my Org syntax is indented
properly (in accordance with org-indent-mode, which is set to t). The code
block itself looks like this after editing:
#+BEGIN_SRC org :exports code
,* Top level headline
,** Second level
,*** Third level
some text
,*** Third level
more text
#+END_SRC
As you can see, the text ('some text' and 'more text') is not indented.
This is a little bit annoying, but not too much - I can add the spaces
myself.
The problem is with the HTML export: I can't see the HTML output as I would
see it in my Emacs buffer, that is to say, without the leading stars. In my
output (see attached), leading stars are visible, although not colored. I
would like them to be completely invisible.
Do you observe the same thing? My org-version is 8.2.5h-30-gdd810b-elpaplus
under GNU Emacs 24.3.1.
Thanks,
FC
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Is there an environment for Org syntax?
2014-03-17 13:58 ` Fletcher Charest
2014-03-18 17:10 ` Phil Regier
@ 2014-03-19 10:09 ` Bastien
2014-03-22 17:36 ` Fletcher Charest
1 sibling, 1 reply; 11+ messages in thread
From: Bastien @ 2014-03-19 10:09 UTC (permalink / raw)
To: Fletcher Charest; +Cc: emacs-orgmode, Phil Regier
Hi Fletcher,
Fletcher Charest <fletcher.charest@gmail.com> writes:
> When I use the edit buffer (by pressing C-c '), my Org syntax is
> indented properly (in accordance with org-indent-mode, which is set
> to t). The code block itself looks like this after editing:
>
> #+BEGIN_SRC org :exports code
> ,* Top level headline
> ,** Second level
> ,*** Third level
> some text
> ,*** Third level
> more text
> #+END_SRC
>
> As you can see, the text ('some text' and 'more text') is not
> indented. This is a little bit annoying, but not too much - I can add
> the spaces myself.
The indentation of the exported HTML looks correct to me:
"some text" is right below "*** Third level"
> The problem is with the HTML export: I can't see the HTML output as I
> would see it in my Emacs buffer, that is to say, without the leading
> stars. In my output (see attached), leading stars are visible,
> although not colored. I would like them to be completely invisible.
The HTML color of the leading stars is taken from the org-hide face.
When your background is black, the org-hide face is black, hence the
color you see in the HTML output.
HTH,
--
Bastien
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Is there an environment for Org syntax?
2014-03-19 10:09 ` Bastien
@ 2014-03-22 17:36 ` Fletcher Charest
0 siblings, 0 replies; 11+ messages in thread
From: Fletcher Charest @ 2014-03-22 17:36 UTC (permalink / raw)
To: Bastien; +Cc: emacs-orgmode, Phil Regier
[-- Attachment #1: Type: text/plain, Size: 1446 bytes --]
Hi Bastien,
> The indentation of the exported HTML looks correct to me:
> "some text" is right below "*** Third level"
> The HTML color of the leading stars is taken from the org-hide face.
> When your background is black, the org-hide face is black, hence the
> color you see in the HTML output.
Let me reformulate.
I'm looking for a way to tell the HTML exporter how to format Org syntax. I
was expecting it to format it according to my own preferences. For example,
I usually set org-indent-mode to t since it is cleaner. But this is not
taken into account by the HTML exporter: it produces a 'standard' Org
syntax, the one you get by default without any configuration, with visible
leading stars and no indentation. Is it possible to change that?
Two other minor observations.
1. I changed the org-hide face to other colors, like red (just for trying,
since I didn't know about that possibility). As soon as I export an Org
buffer to HTML, the org-hide face comes back to its initial value: the
leading stars are back from red to invisible. This might be anormal.
2. About the black leading stars in my previous posts, I found the problem:
when org-indent-mode is activated by setting org-startup-indented to t, it
produces black leading stars in my HTML output. This doesn't happen when it
is activated using the org-indent-mode function or when '#+STARTUP: indent'
is in the file. This might be a bug too.
Thanks for your time,
FC
[-- Attachment #2: Type: text/html, Size: 1999 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2014-03-22 17:36 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-14 21:41 Is there an environment for Org syntax? Fletcher Charest
2014-03-14 22:13 ` Phil Regier
2014-03-14 22:59 ` Fletcher Charest
2014-03-14 23:04 ` Phil Regier
2014-03-14 23:21 ` Fletcher Charest
2014-03-14 23:34 ` Phil Regier
2014-03-17 13:58 ` Fletcher Charest
2014-03-18 17:10 ` Phil Regier
2014-03-19 10:09 ` Bastien
2014-03-22 17:36 ` Fletcher Charest
2014-03-15 4:44 ` Kyle Meyer
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).