Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add source code block interpretation #29

Open
nicorikken opened this issue Oct 1, 2016 · 0 comments
Open

Add source code block interpretation #29

nicorikken opened this issue Oct 1, 2016 · 0 comments

Comments

@nicorikken
Copy link

The Asciidoc(tor) syntax enables the use of source code blocks.

Currently the content is treated as a literal block, with faulty font-style rendering, and without syntax highlighting or more advanced code re-use options. More advanced features could include the evaluation of a code block.

Example from the Asciidoc manual (ref):

[source,python]
-------------------------------------------
\include::test.py[]
-------------------------------------------

Example from the Asciidoctor manual (ref). Notice the shorter block separators.

[[app-listing]] 
[source,ruby]  
.app.rb 
---- 
require 'sinatra'

get '/hi' do
  "Hello World!"
end
----

In the atom-language-asciidoc package the vastness of language support has been tackled by using a generator script combined with a language definition to automatically generate the needed syntax parsing. This then generates the needed static grammar for the different code languages.

As the parsing in ELisp is done differently, I would assume the implementation itself could be more straightforward. Maybe some hints can be derived from org-mode options, maybe regarding the babel literal programming extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant