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

Preserve language in code-block from markdown and rst #721

Closed
kakawait opened this issue Jan 23, 2013 · 3 comments
Closed

Preserve language in code-block from markdown and rst #721

kakawait opened this issue Jan 23, 2013 · 3 comments

Comments

@kakawait
Copy link

I have a code block using all possible pandoc syntax

~~~~JavaScript
var color = 'red';
...
~~~~

or

~~~~ {.JavaScript}
var color = 'red';
...
~~~~

the result when converting to RST is

::
    var color = 'red';

but excepted

.. code-block:: JavaScript
    var color = 'red';

May I miss something on pandoc syntax?

@jgm
Copy link
Owner

jgm commented Jan 23, 2013

I did not know about code-block. (It was added to docutils after I
originally wrote the RST writer.)

Is there any difference between code, code-block, and sourcecode?

+++ Thibaud Lepretre [Jan 23 13 05:51 ]:

I have a code block using all possible pandoc syntax

var color = 'red';
...

or

var color = 'red';
...

the result when converting to RST is
::
var color = 'red';

but excepted
.. code-block:: JavaScript
var color = 'red';

May I miss something on pandoc syntax?

--
Reply to this email directly or [1]view it on GitHub.
[xJAuenYDiIoVt3LF3y6848DAslDCyjnQ6q-QyN4VMN8Nuj70bmOdCqPvW4cnIYOW.gif]

References

  1. Preserve language in code-block from markdown and rst #721

@kakawait
Copy link
Author

Good question :) I'm new on RST but I will try to find information about these 3 directives.

@kakawait
Copy link
Author

From docutils source: http://docutils.svn.sourceforge.net/viewvc/docutils/trunk/docutils/docutils/parsers/rst/languages/en.py

I understand that code = code-block = sourcecode. It's just aliases

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

2 participants