# Using org-mode babel, how do I quickly export some html soure block to a separate file?

I am taking notes on a course in org-mode. I am using HTML source-blocks to write down examples of html code. This serves me because I have text and code in one file and it will be easier to export it to a blog for example.

#+begin_src html
#some html code
#+end_src


However, sometimes I want to test the code in a source block and would want to export it to a separate html file. Any tipps on how to achieve this quickly? Exporting via C-c C-e h o always exports the whole buffer or the subtree. But I want to export only the code in the source block.

Any tipps on how to do this?

• Search for Tangling in the Org mode manual: do C-h i g (org)Extracting Source Code RET. – NickD Feb 28 at 13:09

C-c C-v C-t runs org-babel-tangle and exports all code blocks to the current buffer name plus the correct code extension (e.g. html blocks get .html, python blocks get .py). You can specify the tangled filename with the :tangle property at the header, section, or file level.
Run C-u C-c C-v C-t to only tangle the current code block containing the point.
hit C-c ' for org-edit-special and then save the buffer to a new file.
• Faster: C-v C-v C-t runs org-babel-tangle. Add the prefix arg C-u to only tangle the current babel block – mankoff Feb 28 at 15:10