vim-literate-markdown

A Vim plugin to replicate a subset of Org mode's literate programming, for Markdown files.
git clone git://git.alex.balgavy.eu/vim-literate-markdown.git
Log | Files | Refs | README

example_3.md (493B)


      1 # Example 3
      2 Example 3 from the Vim documentation.
      3 
      4 <!-- :Tangle(python) <^> DIRNAME/FILENAME.py -->
      5 ```python
      6 <<function definitions>>
      7 
      8 def main():
      9     <<main code>>
     10 
     11 if __name__ == '__main__':
     12     main()
     13 ```
     14 
     15 <!-- :Tangle(python) <function definitions> -->
     16 ```python
     17 def double(n):
     18     x = 2*n
     19     return x
     20 ```
     21 
     22 <!-- :Tangle(python) <> <main code> -->
     23 ```python
     24 <<n definition>>
     25 print("Double of %d is %d" % (n, double(n)))
     26 ```
     27 
     28 <!-- :Tangle(python) <n definition> -->
     29 ```python
     30 n = 34.5
     31 ```