From 773d8aefc6a0fde90271d159c151cb3c60e9b317 Mon Sep 17 00:00:00 2001 From: David Budzynski Date: Mon, 15 Apr 2024 07:57:26 +0100 Subject: [PATCH] add org mode code block --- _drafts/org-mode.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/_drafts/org-mode.md b/_drafts/org-mode.md index 2fe6ae7..2dcd347 100644 --- a/_drafts/org-mode.md +++ b/_drafts/org-mode.md @@ -27,6 +27,19 @@ mode, how to set it up, and how to use it. Instead, I will focus on how to use org mode to write C++ code blocks and export them to HTML or PDF. For a beginner friendly setup, try [Doom Emacs][3]. It is a pre-configured version of Emacs. +Org mode, similiar to Jupyter notebooks, allows you to write code blocks in the +file and execute them. The source block looks like this: + +```org +#+BEGIN_SRC cpp +#include + +int main() { + std::cout << "Hello, World!" << std::endl; + return 0; +} +``` + [1]: https://orgmode.org/ [2]: https://www.gnu.org/software/emacs/ [3]: https://github.com/doomemacs/doomemacs