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

External listings #2116

Closed
KOLANICH opened this issue Apr 26, 2015 · 5 comments
Closed

External listings #2116

KOLANICH opened this issue Apr 26, 2015 · 5 comments

Comments

@KOLANICH
Copy link

Allow external listings in latex, for example

\lstinputlisting{"file.js"}

pandoc should open the files and read their contents, if the target format doesn't support linking or if external listings are not enabled and then process as usual listing. If it supports, it should link existing files, if corresponding CLI argument is set.
In the case of HTML it is possible to highlight using JS.

@bpj
Copy link

bpj commented Apr 27, 2015

If you are only targeting LaTeX you can simply use the LaTeX command in
your markdown document.

If you are targeting multiple formats it shouldn't be too difficult to
write a filter which takes a codeblock with a 'flag' class and the path to
a file as text and replaces the text with the contents of the file at that
path:

````{.include}
path/to/some.JSON
Den 26 apr 2015 21:34 skrev "KOLANICH" <notifications@github.com>:

> Allow external listings in latex, for example
> latex
> \lstinputlisting{"file.js"}
>
> pandoc should open the files and read their contents, if the target format
> doesn't support linking and then process as usual listing. If it supports,
> it should link existing files, if corresponding CLI argument is set.
> In the case of HTML it is possible to highlight using JS.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/jgm/pandoc/issues/2116>.
>

@bbolker
Copy link

bbolker commented Sep 30, 2015

+1 ... but for output other than LaTeX/PDF

@Qinka
Copy link

Qinka commented Aug 16, 2016

+1

@jgm
Copy link
Owner

jgm commented Dec 8, 2016

We'll be able to handle this kind of thing better with architectural changes now under way in the typeclass branch (pandoc 2.0).

@Paladnix
Copy link

Paladnix commented Aug 8, 2022

6949d74

Sorry about this. But how to use this feature in my markdown syntax if I want pandoc to render code from file.

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

No branches or pull requests

6 participants