two_different_languages.md (536B)
1 # Two different languages tangled to two different files 2 Here we have two different languages, which should be tangled to two different files. 3 <!-- :Tangle(python) DIRNAME/FILENAME.py --> 4 <!-- :Tangle(ruby) DIRNAME/FILENAME.rb --> 5 6 Define the Ruby method: 7 8 ```ruby 9 def add(a,b) 10 a+b 11 end 12 ``` 13 14 Define the Python method 15 16 ```python 17 def add(a,b): 18 return a+b 19 ``` 20 21 Call the Ruby method: 22 23 ```ruby 24 puts add(1,2) 25 ``` 26 27 Call the Python method: 28 29 ```python 30 print(add(1,2)) 31 ``` 32 33 And some shell that will be ignored: 34 35 ```sh 36 echo "We're done!" 37 ```