write syntax highlighting block content to file

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

write syntax highlighting block content to file

ttmetro
I'd like to output the code (raw, not formatted) to a file. E.g.

```python
def abc():
    pass
```

should get rendered in the output as usual with syntax highlighting, but the code also should be passed to an extension so it can be written to a file.

Alternatively, I know how to create an extension that gets the code, but then I do not know how to also have it appear formatted in the asciidoctor output.

Thanks,
Bernhard