Inline source code highlighting

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Inline source code highlighting

nawroth
Hi,

I'd like to use source code highlighting inline and wonder if there's a defined syntax for this already?
How about using for example: [language-cypher]`CREATE`

Is there any way to define shortcuts for the rather lenghty [language-langname] ?

/anders
Reply | Threaded
Open this post in threaded view
|

Re: Inline source code highlighting

mojavelinux
Administrator
Anders,

There's an open issue in which we've been discussing this feature. See https://github.com/asciidoctor/asciidoctor/issues/1043

My preference is actually an inline macro. I think inline macros are a lot easier to read _and_ is less typing.

source:cypher[CREATE]

Unfortunately, it's not yet possible to get passthrough behavior with inline macros, so you'd need to check for a passthrough in the content part in case it's needed.

source:cypher[+CREATE (with some characters to escape in here)+]

You can find some other proposals in the referenced issue. This is entirely possible to implement today using extensions...though I agree having it in core would be very interesting.

-Dan

On Thu, Oct 1, 2015 at 4:44 AM, nawroth [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hi,

I'd like to use source code highlighting inline and wonder if there's a defined syntax for this already?
How about using for example: [language-cypher]`CREATE`

Is there any way to define shortcuts for the rather lenghty [language-langname] ?

/anders


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Inline-source-code-highlighting-tp3783.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | http://google.com/profiles/dan.j.allen
Reply | Threaded
Open this post in threaded view
|

Re: Inline source code highlighting

mojavelinux
Administrator
In reply to this post by nawroth
You could even shorten it to:

src:cypher[CREATE]

-Dan

On Sun, Oct 4, 2015 at 4:00 PM, Dan Allen <[hidden email]> wrote:
Anders,

There's an open issue in which we've been discussing this feature. See https://github.com/asciidoctor/asciidoctor/issues/1043

My preference is actually an inline macro. I think inline macros are a lot easier to read _and_ is less typing.

source:cypher[CREATE]

Unfortunately, it's not yet possible to get passthrough behavior with inline macros, so you'd need to check for a passthrough in the content part in case it's needed.

source:cypher[+CREATE (with some characters to escape in here)+]

You can find some other proposals in the referenced issue. This is entirely possible to implement today using extensions...though I agree having it in core would be very interesting.

-Dan

On Thu, Oct 1, 2015 at 4:44 AM, nawroth [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hi,

I'd like to use source code highlighting inline and wonder if there's a defined syntax for this already?
How about using for example: [language-cypher]`CREATE`

Is there any way to define shortcuts for the rather lenghty [language-langname] ?

/anders


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Inline-source-code-highlighting-tp3783.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | http://google.com/profiles/dan.j.allen



--
Dan Allen | @mojavelinux | http://google.com/profiles/dan.j.allen