* Incomplete syntax highlight for C++ code
@ 2012-02-15 6:59 Zhiqiu Kong
2012-02-18 15:21 ` Eric Schulte
0 siblings, 1 reply; 3+ messages in thread
From: Zhiqiu Kong @ 2012-02-15 6:59 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 1963 bytes --]
Hi,
I am a new org-mode user and am trying to take notes with it. As I put
source code into my codes a lot, I love the integration with htmlize pretty
much. However, I found the syntax highlight on exported html file is not
as what I see in Emacs. To be more specific, only comments and string
literals are colored, which is shown in http://img.ly/dXTK. And here is
what is looks like in Emacs: http://img.ly/dXU6.
Actually, what I expected is the keywords such as int, return should at
least be colored, which is as introduced by emacs-fu (
http://emacs-fu.blogspot.com/2009/05/writing-and-blogging-with-org-mode.html
).
I checked out the latest org-mode (Org-mode version 7.8.03
(release_7.8.03.336.gdf0a9) ) and htmlize (for git repository), but the
problem remains. Moreover, here is my project setting:
(setq org-publish-project-alist
'(("note-org"
:base-directory "~/Docs/notes/org/"
:publishing-directory "~/Docs/notes/html/"
:htmlized-source t
:base-extension "org"
:sub-superscript nil
:recursive t
:publishing-function org-publish-org-to-html
;; :org-export-htmlize-output-type "css"
:html-extension "html"
:auto-index t
:index-filename "index.org"
:index-title "My Notes"
:link-home "index.html"
;; :section-numbers nil
:style "<link rel=\"stylesheet\"
href=\"css/worg.css\"
type=\"text/css\"/>")
("note-static"
:base-directory "~/Docs/notes/org/"
:publishing-directory "~/Docs/notes/html/"
:recursive t
:base-extension
"css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|swf\\|zip\\|gz\\|txt\\|el"
:publishing-function org-publish-attachment)
("My Notes"
:components ("note-org" "note-static")
:auto-sitemap t
:auto-index t
)))
Any suggestion on how to debug and fix this problem? Or this is normal?
Thanks a lot!!
Thanks,
-Zhiqiu
[-- Attachment #2: Type: text/html, Size: 3374 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Incomplete syntax highlight for C++ code
2012-02-15 6:59 Incomplete syntax highlight for C++ code Zhiqiu Kong
@ 2012-02-18 15:21 ` Eric Schulte
2012-02-19 1:47 ` Zhiqiu Kong
0 siblings, 1 reply; 3+ messages in thread
From: Eric Schulte @ 2012-02-18 15:21 UTC (permalink / raw)
To: Zhiqiu Kong; +Cc: emacs-orgmode
Hi Zhiqiu,
First, I would look at the actual text of the exported html code
example. It likely contains css code specifying how to fontify many
elements of the code block (e.g., on my system your example exports to
the following html [1]). You can then add css to your org-mode file
specifying what colors to use for each code class.
Also, see the `org-export-htmlize-output-type' variable.
Best,
Zhiqiu Kong <breaddawson@gmail.com> writes:
> Hi,
>
> I am a new org-mode user and am trying to take notes with it. As I put
> source code into my codes a lot, I love the integration with htmlize pretty
> much. However, I found the syntax highlight on exported html file is not
> as what I see in Emacs. To be more specific, only comments and string
> literals are colored, which is shown in http://img.ly/dXTK. And here is
> what is looks like in Emacs: http://img.ly/dXU6.
>
> Actually, what I expected is the keywords such as int, return should at
> least be colored, which is as introduced by emacs-fu (
> http://emacs-fu.blogspot.com/2009/05/writing-and-blogging-with-org-mode.html
> ).
>
> I checked out the latest org-mode (Org-mode version 7.8.03
> (release_7.8.03.336.gdf0a9) ) and htmlize (for git repository), but the
> problem remains. Moreover, here is my project setting:
>
> (setq org-publish-project-alist
> '(("note-org"
> :base-directory "~/Docs/notes/org/"
> :publishing-directory "~/Docs/notes/html/"
> :htmlized-source t
> :base-extension "org"
> :sub-superscript nil
> :recursive t
> :publishing-function org-publish-org-to-html
> ;; :org-export-htmlize-output-type "css"
> :html-extension "html"
> :auto-index t
> :index-filename "index.org"
> :index-title "My Notes"
> :link-home "index.html"
> ;; :section-numbers nil
> :style "<link rel=\"stylesheet\"
> href=\"css/worg.css\"
> type=\"text/css\"/>")
> ("note-static"
> :base-directory "~/Docs/notes/org/"
> :publishing-directory "~/Docs/notes/html/"
> :recursive t
> :base-extension
> "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|swf\\|zip\\|gz\\|txt\\|el"
> :publishing-function org-publish-attachment)
> ("My Notes"
> :components ("note-org" "note-static")
> :auto-sitemap t
> :auto-index t
> )))
>
> Any suggestion on how to debug and fix this problem? Or this is normal?
> Thanks a lot!!
>
>
> Thanks,
> -Zhiqiu
Footnotes:
[1] <pre class="src src-c++"><span style="color: #ffffff;">int</span> <span style="color: #ffc66d;">main</span>(){
<span style="color: #6d9cbe;">std</span>::cout << <span style="color: #a5c261;">"hello"</span> << <span style="color: #6d9cbe;">std</span>::endl;
}
</pre>
--
Eric Schulte
http://cs.unm.edu/~eschulte/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Incomplete syntax highlight for C++ code
2012-02-18 15:21 ` Eric Schulte
@ 2012-02-19 1:47 ` Zhiqiu Kong
0 siblings, 0 replies; 3+ messages in thread
From: Zhiqiu Kong @ 2012-02-19 1:47 UTC (permalink / raw)
To: Eric Schulte; +Cc: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 3771 bytes --]
Hi Eric,
Thank you so much for your reply and helpful suggestions. I looked into the
source of org-mode but as I am not familiar with elisp, I failed to get it.
Then I tried to not load my customized settings and tried org-mode export
again. And finally I found out it was due to another .el I loaded, which is
called highlight-80+ (http://nschum.de/src/emacs/highlight-80+/).
Although I do not know why they conflict, org-mode export function works
perfectly after I disabled highlight-80+. :D But it will be great if
someone is able to and would like to look into this and get a fix to it. As
someone else may encounter the same problem as me.
Thanks,
-Zhiqiu
On Sat, Feb 18, 2012 at 7:21 AM, Eric Schulte <eric.schulte@gmx.com> wrote:
> Hi Zhiqiu,
>
> First, I would look at the actual text of the exported html code
> example. It likely contains css code specifying how to fontify many
> elements of the code block (e.g., on my system your example exports to
> the following html [1]). You can then add css to your org-mode file
> specifying what colors to use for each code class.
>
> Also, see the `org-export-htmlize-output-type' variable.
>
> Best,
>
> Zhiqiu Kong <breaddawson@gmail.com> writes:
>
> > Hi,
> >
> > I am a new org-mode user and am trying to take notes with it. As I put
> > source code into my codes a lot, I love the integration with htmlize
> pretty
> > much. However, I found the syntax highlight on exported html file is not
> > as what I see in Emacs. To be more specific, only comments and string
> > literals are colored, which is shown in http://img.ly/dXTK. And here is
> > what is looks like in Emacs: http://img.ly/dXU6.
> >
> > Actually, what I expected is the keywords such as int, return should at
> > least be colored, which is as introduced by emacs-fu (
> >
> http://emacs-fu.blogspot.com/2009/05/writing-and-blogging-with-org-mode.html
> > ).
> >
> > I checked out the latest org-mode (Org-mode version 7.8.03
> > (release_7.8.03.336.gdf0a9) ) and htmlize (for git repository), but the
> > problem remains. Moreover, here is my project setting:
> >
> > (setq org-publish-project-alist
> > '(("note-org"
> > :base-directory "~/Docs/notes/org/"
> > :publishing-directory "~/Docs/notes/html/"
> > :htmlized-source t
> > :base-extension "org"
> > :sub-superscript nil
> > :recursive t
> > :publishing-function org-publish-org-to-html
> > ;; :org-export-htmlize-output-type "css"
> > :html-extension "html"
> > :auto-index t
> > :index-filename "index.org"
> > :index-title "My Notes"
> > :link-home "index.html"
> > ;; :section-numbers nil
> > :style "<link rel=\"stylesheet\"
> > href=\"css/worg.css\"
> > type=\"text/css\"/>")
> > ("note-static"
> > :base-directory "~/Docs/notes/org/"
> > :publishing-directory "~/Docs/notes/html/"
> > :recursive t
> > :base-extension
> > "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|swf\\|zip\\|gz\\|txt\\|el"
> > :publishing-function org-publish-attachment)
> > ("My Notes"
> > :components ("note-org" "note-static")
> > :auto-sitemap t
> > :auto-index t
> > )))
> >
> > Any suggestion on how to debug and fix this problem? Or this is normal?
> > Thanks a lot!!
> >
> >
> > Thanks,
> > -Zhiqiu
>
>
> Footnotes:
> [1] <pre class="src src-c++"><span style="color: #ffffff;">int</span>
> <span style="color: #ffc66d;">main</span>(){
> <span style="color: #6d9cbe;">std</span>::cout << <span
> style="color: #a5c261;">"hello"</span> << <span style="color:
> #6d9cbe;">std</span>::endl;
> }
> </pre>
>
>
> --
> Eric Schulte
> http://cs.unm.edu/~eschulte/
>
[-- Attachment #2: Type: text/html, Size: 5514 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-02-19 1:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-15 6:59 Incomplete syntax highlight for C++ code Zhiqiu Kong
2012-02-18 15:21 ` Eric Schulte
2012-02-19 1:47 ` Zhiqiu Kong
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).