How to include a text file in emacs org-mode

I am using emacs org-mode with taskjuggler export. I like to include several org files in one main org file and export all the content in one taskjuggler file, so I can separate, for example. sources from projects.

I thought about using the macro # + INCLUDE :, but it includes additional header information, such as the original file name. I managed to remove the author and timestamp by setting up the export, but I can not get rid of the file name.

Question: what would be a good solution to include org files so that I can use them with taskjuggler export?

+4
source share
2 answers

The name of your question is slightly contrary to the text of the question.

If you want to include plain text, you can try something like this:

#+begin_src sh :exports results :results output cat your_file.txt #+end_src 

I have used this in the past to add file contents to a web page through HTML export. The results of the src block, in this case, are set in the block in HTML. Not sure what TaskJuggler does.

You can also do this with the macro #+include : http://orgmode.org/manual/Include-files.html If you want to include certain parts of #+include 'd, use the :lines parameter, as indicated in the link above.

+3
source

This does not answer your question directly, but is suitable under the heading for everyone who gets here.

I changed @ cm2's answer to using pygmentize vs cat , then used display-ansi-colors to remove the ANSI color codes. eg:

 #+BEGIN_SRC shell :results raw pygmentize Test.java #+END_SRC #+RESULTS: public class Test { public static void main(String[] args) { String result = "hello"; System.out.print(result); } } 
0
source

Source: https://habr.com/ru/post/1396268/


All Articles