No XML highlighted - What am I doing wrong?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

No XML highlighted - What am I doing wrong?

sonicaaaa
Hi guys, I've just started with Asciidoctor and I'm already hitting first issues.

I'm not sure what I've been doing wrong with so little code but still.

I cannot get any code highlighting in my xml snippets.

My sample doc is:


== simple test

[source,xml]
----
<a>
	<b attr="whatever"/>
	<c>value</c>
</a>
----



And the output I get is here.

https://paste.fedoraproject.org/254373/14393919/

When I open it in either Firefox or Chromium I get not colors for the xml portion of the document.

Any idea on what I could be doing wrong?


$ asciidoctor --version
Asciidoctor 1.5.2 [http://asciidoctor.org]
Runtime Environment (ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]) (lc:UTF-8 fs:UTF-8 in:- ex:UTF-8)

Reply | Threaded
Open this post in threaded view
|

Re: No XML highlighted - What am I doing wrong?

LightGuardjp
Looks like you haven't specified a highlighter to use. http://asciidoctor.org/docs/user-manual/#source-code-blocks talks all about it. If you're using the browser I suggest using hightlightjs. 

On Wednesday, August 12, 2015, sonicaaaa [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hi guys, I've just started with Asciidoctor and I'm already hitting first issues.

I'm not sure what I've been doing wrong with so little code but still.

I cannot get any code highlighting in my xml snippets.

My sample doc is:

== simple test

[source,xml]
----

       
        <c>value</c>

----


And the output I get is here.

https://paste.fedoraproject.org/254373/14393919/

When I open it in either Firefox or Chromium I get not colors for the xml portion of the document.

Any idea on what I could be doing wrong?


$ asciidoctor --version
Asciidoctor 1.5.2 [http://asciidoctor.org]
Runtime Environment (ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]) (lc:UTF-8 fs:UTF-8 in:- ex:UTF-8)





If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/No-XML-highlighted-What-am-I-doing-wrong-tp3659.html
To start a new topic under Asciidoctor :: Discussion, email <a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;ml-node%2Bs49171n1h37@n6.nabble.com&#39;);" target="_blank">ml-node+s49171n1h37@...
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Sent from Gmail Mobile
Reply | Threaded
Open this post in threaded view
|

Re: No XML highlighted - What am I doing wrong?

rwinch
In reply to this post by sonicaaaa
Did you ensure to "Enabling the syntax highlighter" as mentioned in the reference [1].

In short, you must specify the source-highlighter attribute in the document header or passed as an argument. The valid options are coderay, highlightjs, prettify, and pygments.

For example, your code can be specified as:

:source-highlighter: highlightjs

== simple test

[source,xml]
----
<c>value</c>
----

[1] http://asciidoctor.org/docs/asciidoc-syntax-quick-reference/#source-code

HTH,
Rob
Reply | Threaded
Open this post in threaded view
|

Re: No XML highlighted - What am I doing wrong? - SOLVED

sonicaaaa
Thank you guys, not having a syntax highlighter enabled was my problem.


thanks again

paolo