You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.org
+62-26Lines changed: 62 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,17 +33,26 @@ provide /almost/ the same tangling functionality at a much higher
33
33
speed.
34
34
35
35
You do *not* need Emacs or Org mode installed to use ~ntangle~.
36
+
* Download binary (64-bit GNU/Linux)
37
+
If you are using a 64-bit GNU/Linux type OS, head over to the [[https://github.com/OrgTangle/ntangle/releases][Releases]]
38
+
section of this repo to download the release archive
39
+
~ntangle-VERSION.Linux_64bit_musl.tar.xz~. Then simply extract it to
40
+
get the statically linked binary ~ntangle~ and run it.
41
+
42
+
If you are using any other type of OS, see [[#installation][Installation]].
36
43
* Installation
37
-
** Download binary
38
-
- 64-bit GNU/Linux type OS :: Head over to the [[https://github.com/OrgTangle/ntangle/releases][Releases]] section of this
39
-
repo to download the release archive
40
-
~ntangle-VERSION.Linux_64bit_musl.tar.xz~. Then simply extract it
41
-
to get the statically linked binary ~ntangle~ and run it.
42
-
- Other OSes :: The statically linked binary is available only for
43
-
64-bit GNU/Linux type OS. Follow the [[#development][Development]]
44
-
section below to build the binary locally for your OS.
45
-
** Build locally
46
-
See [[#development][Development]].
44
+
45
+
[[https://github.com/nim-lang/nimble][~nimble~]] can be used to install ~ntangle~. This utility ships with Nim
46
+
installations. Think of it as the equivalent of the Python ~pip~.
47
+
48
+
/See [[https://github.com/dom96/choosenim#installation][*choosenim* installation]] to install *nim* and *nimble*./
49
+
50
+
To install ~ntangle~:
51
+
#+begin_example
52
+
nimble install ntangle
53
+
#+end_example
54
+
55
+
Above installs the binary in the *~/.nimble/bin/* directory.
47
56
* Features
48
57
** Tangling /minus Noweb/ [7/8]
49
58
- [X] Understands global tangle header-args in ~#+property~ keywords
@@ -117,33 +126,60 @@ file.
117
126
* Org mode file samples for tangling
118
127
You can find samples of the supported Org mode tangling in the [[https://github.com/OrgTangle/ntangle/tree/master/tests][*test*
119
128
directory]] of this project.
129
+
* Org Tangle Syntax
130
+
~ntangle~ expects the Org files to use the ~header-args~ property
131
+
syntax used in Org mode 9.0 and newer. There was a minor syntax change
132
+
with *header-args* property in Org 9.0 ([[https://code.orgmode.org/bzg/org-mode/src/a85ba9fb9bc7518bc0b654c79812f5606be84c58/etc/ORG-NEWS#L1042][see ORG-NEWS]]).
133
+
134
+
So if you used the below in Org 8.x and older:
135
+
#+begin_src org
136
+
# Deprecated syntax
137
+
,#+property: tangle yes
138
+
#+end_src
139
+
140
+
Refactor that to:
141
+
#+begin_src org
142
+
# Org 9.0 syntax
143
+
,#+property: header-args :tangle yes
144
+
#+end_src
145
+
146
+
Similarly, refactor a property drawer from:
147
+
#+begin_src org
148
+
# Deprecated syntax
149
+
,* Some heading
150
+
:PROPERTIES:
151
+
:tangle: yes
152
+
:END:
153
+
#+end_src
154
+
155
+
To:
156
+
#+begin_src org
157
+
# Org 9.0 syntax
158
+
,* Some heading
159
+
:PROPERTIES:
160
+
:header-args: :tangle yes
161
+
:END:
162
+
#+end_src
120
163
* Development
164
+
Below assumes that you have ~nim~ and ~nimble~ installed.
121
165
** Building
122
-
[[https://github.com/nim-lang/nimble][~nimble~]] is used to build this project. This utility ships with Nim
123
-
installation. Think of it as the equivalent of ~pip~ in Python.
124
-
125
-
With Nim and ~nimble~ installed, do:
126
166
#+begin_example
127
167
git clone https://github.com/OrgTangle/ntangle
128
168
cd ntangle
129
-
nimble build -d:release # creates the ntangle binary in the same directory
169
+
nimble build # creates the ntangle binary in the same directory
170
+
# nimble build -d:release # same as above but creates an optimized binary
130
171
#+end_example
131
-
** Installing
132
-
If you want to install it (i.e. build the binary and copy it to
133
-
=~/.nimble/bin/=), do:
134
-
#+begin_example
135
-
# cd to the git repo dir
136
-
nimble install
137
-
#+end_example
138
-
139
-
You need to add *~/.nimble/bin/* to your ~PATH~ environment variable.
140
172
** Testing
141
173
#+begin_src shell :results output verbatim
142
174
# cd to the git repo dir
143
175
./tests/test.sh
144
176
#+end_src
145
177
* History
146
-
The ~ntangle.nim~ file was written as an exercise to roughly translate the
147
-
Python script [[https://github.com/thblt/org-babel-tangle.py][~org-babel-tangle.py~]] (by @thblt) to Nim.
178
+
I was [[https://www.reddit.com/r/emacs/comments/8m5wuf/a_python_version_of_orgbabeltangle_for_literate/dzl3ooo/][motivated]] to start this project after reading about the
179
+
[[https://github.com/OrgTangle/org-babel-tangle.py\][~org-babel-tangle.py~]] Python project by @thblt.
180
+
181
+
I wanted to just see how easy it was to translate a Python script to
182
+
Nim (it was very easy!), and from there, this project started
0 commit comments