Я пытаюсь преобразовать некоторые документы из формата asciidoc в Markdown. Поскольку pandoc
не может сделать это сам по себе, я также использую asciidoctor
для преобразования в промежуточный файл docbook:
asciidoctor -v -a leveloffset=+1 -d book -b docbook -s test.adoc -o test.xml
pandoc --highlight-style=pygments -f docbook --atx-headers -t markdown_strict test.xml -o test.Md
Кажется, что блоки кода не преобразованы должным образом. Они в порядке в docbook, но при преобразовании в Md у меня просто есть общий блок в блочных кавычках без подсветки синтаксиса. Вот пример.
Оригинальный блок asciidoc:
[source,c++]
....
#include <stdio.h>
int main(void)
{
// Declaring one integer variable named a
int a;
// Declaring two at once: b and c
int b, c;
a = 1;
b = 2;
c = 3;
// print out the values of our variables
printf("a is %d, b is %d, and c is %d.\n", a, b, c);
return a + b + c;
}
....
Блок докбука:
<programlisting language="c++" linenumbering="unnumbered">#include <stdio.h>
int main(void)
{
// Declaring one integer variable named a
int a;
// Declaring two at once: b and c
int b, c;
a = 1;
b = 2;
c = 3;
// print out the values of our variables
printf("a is %d, b is %d, and c is %d.\n", a, b, c);
return a + b + c;
}</programlisting>
Markdown у меня есть (просто с отступом)
#include <stdio.h>
int main(void)
{
// Declaring one integer variable named a
int a;
// Declaring two at once: b and c
int b, c;
a = 1;
b = 2;
c = 3;
// print out the values of our variables
printf("a is %d, b is %d, and c is %d.\n", a, b, c);
return a + b + c;
}
Ожидаемая уценка:
```c++
#include <stdio.h>
int main(void)
{
// Declaring one integer variable named a
int a;
// Declaring two at once: b and c
int b, c;
a = 1;
b = 2;
c = 3;
// print out the values of our variables
printf("a is %d, b is %d, and c is %d.\n", a, b, c);
return a + b + c;
}
```
Я использую пандок 2.9.2.1
Есть ли какие-то опции или настройки, которые я могу использовать для настройки вывода?