1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <!DOCTYPE html>
- <html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
- <head>
- <meta charset="utf-8" />
- <meta name="generator" content="pandoc" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
- <title>ORG Babel for the win!</title>
- <style>
- code{white-space: pre-wrap;}
- span.smallcaps{font-variant: small-caps;}
- span.underline{text-decoration: underline;}
- div.column{display: inline-block; vertical-align: top; width: 50%;}
- div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
- ul.task-list{list-style: none;}
- .display.math{display: block; text-align: center; margin: 0.5rem auto;}
- </style>
- <link rel="stylesheet" href="C:\SGZ_Pro\Hobbys\Writing\Org\pages\blog\styles.css" />
- <!--[if lt IE 9]>
- <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
- <![endif]-->
- <link rel="stylesheet" type="text/css" href="styles.css" />
- </head>
- <body>
- <header id="title-block-header">
- <h1 class="title">ORG Babel for the win!</h1>
- </header>
- <h1 id="why">Why?</h1>
- <p>I was watching DT's video on <a href="https://invidio.xamh.de/watch?v=pQe1ul51RM0">org babel</a>. I at first didn't really like the concept becauase when he uploaded to gitlab there was no syntax highlighting :(</p>
- <p>Well, when finally trying it out for myself. Apperently babel is built in with emacs by the way. I instinctivly put the language of what I was putting in a source code block. Since I was doing this on my init.el I put lisp. Your actually supposed to put elisp for proper syntax highlighting.</p>
- <h1 id="result">Result</h1>
- <p>A absolutely beautiful file that looks awesome on git website and is cool to edit.</p>
- <h1 id="how">HOW?</h1>
- <h1 id="section">1.</h1>
- <p>Take the contents of the file you want to convert to org. Put it in a separate file with the .org extension. If you want to have it in a GIT repository make the file README.org so when opening a folder with the file you will get a preview of it.</p>
- <h1 id="section-1">2.</h1>
- <p>Go to the top of the file and add this:</p>
- <pre class="org"><code>#+PROPERTY: header-args :tangle <file name>
- </code></pre>
- <p>Obviously replace <strong><file name></strong> with your desired exported file name.</p>
- <h1 id="section-2">3.</h1>
- <p>Start putting source code blocks using <code class="verbatim">#+BEGIN_SRC</code> elisp and <code class="verbatim">#+END_SRC</code> all over the place. It would look like this:</p>
- <p><code class="verbatim">#+BEGIN_SRC elisp</code></p>
- <p>;; Happy fun code :D</p>
- <p><code class="verbatim">#+END_SRC</code></p>
- <h1 id="section-3">4.</h1>
- <p>For the first time you have to do a <code class="verbatim">C-c C-c</code> to refresh the document. After that you can just continue pressing: <code class="verbatim">M x org babel tangle</code> or <code class="verbatim">C-c C-v t</code> when you making changes to your file in org to export it to the actual file.</p>
- <h1 id="my-init.el-written-in-org">My init.el written in org!</h1>
- <p>I did this on my <a href="https://codeberg.org/zortazert/Dots/src/branch/main/emacs.d">init.el</a> file.</p>
- <h1 id="note">NOTE:</h1>
- <p>This probably isn't limited to just coding files. Probably there are other use cases</p>
- </body>
- </html>
|