~repositioning of documentation around code blocks
Similar to my previous refactoring, I am just repositioning some documentation around the code blocks to be at the start rather than the end. This is for the literate system particularly
This commit is contained in:
@@ -28,14 +28,14 @@ expanded file names.
|
|||||||
* Destination for parser
|
* Destination for parser
|
||||||
Generate the destination for a literate config org file to parse to, in this
|
Generate the destination for a literate config org file to parse to, in this
|
||||||
case the bin folder in the private directory
|
case the bin folder in the private directory
|
||||||
|
This is not fitted onto the parser because the parser could be fitted to
|
||||||
|
multiple /differing/ outputs easily if it isn't specified a destination.
|
||||||
#+BEGIN_SRC elisp
|
#+BEGIN_SRC elisp
|
||||||
(defun oreodave/literate/destination(SRC)
|
(defun oreodave/literate/destination(SRC)
|
||||||
"Parse a src.org file to a bin/src.el file"
|
"Parse a src.org file to a bin/src.el file"
|
||||||
(replace-regexp-in-string ".*/\\(\\w+\\).org"
|
(replace-regexp-in-string ".*/\\(\\w+\\).org"
|
||||||
(expand-file-name (concat oreodave/literate/bin-dir "\\1.el")) SRC))
|
(expand-file-name (concat oreodave/literate/bin-dir "\\1.el")) SRC))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
This is not fitted onto the parser because the parser could be fitted to
|
|
||||||
multiple /differing/ outputs easily if it isn't specified a destination.
|
|
||||||
* Parser
|
* Parser
|
||||||
First we need to get some sort of parser which can, given a source org file and
|
First we need to get some sort of parser which can, given a source org file and
|
||||||
a destination, parse and produce an Emacs lisp file. We'll copy this from the
|
a destination, parse and produce an Emacs lisp file. We'll copy this from the
|
||||||
@@ -80,6 +80,9 @@ literate contents.
|
|||||||
A procedure that parses all the org files in a given directory into Emacs lisp
|
A procedure that parses all the org files in a given directory into Emacs lisp
|
||||||
files, using the parser function made. Assume all org files in the "location"
|
files, using the parser function made. Assume all org files in the "location"
|
||||||
directory contribute to the config.
|
directory contribute to the config.
|
||||||
|
The location is not set because this function could be easily programmed to use
|
||||||
|
multiple /differing/ sources to produce the config. The tangle function is set
|
||||||
|
because this is the function we'll be using for tangling all org files to ELisp files.
|
||||||
#+BEGIN_SRC elisp
|
#+BEGIN_SRC elisp
|
||||||
(defun oreodave/literate/tangle-all (&optional location)
|
(defun oreodave/literate/tangle-all (&optional location)
|
||||||
"Tangle all org files in `location' to el files in the `destination'"
|
"Tangle all org files in `location' to el files in the `destination'"
|
||||||
@@ -91,15 +94,14 @@ directory contribute to the config.
|
|||||||
(message "Compiling and parsing %s" file)
|
(message "Compiling and parsing %s" file)
|
||||||
(oreodave/literate/tangle file (oreodave/literate/destination file)))))
|
(oreodave/literate/tangle file (oreodave/literate/destination file)))))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
The location is not set because this function could be easily programmed to use
|
|
||||||
multiple /differing/ sources to produce the config.
|
|
||||||
* Load configuration
|
* Load configuration
|
||||||
Final step of the literate cycle: load the config for the first time.
|
Final step of the literate cycle: load the config for the first time.
|
||||||
|
Remove the config.el and literate.el files from the load list because:
|
||||||
|
1) config.org is preloaded by doom
|
||||||
|
2) literate.org is loaded by config.org, thus no need to reload it
|
||||||
|
|
||||||
#+BEGIN_SRC elisp
|
#+BEGIN_SRC elisp
|
||||||
(let ((files (directory-files-recursively "~/.doom.d/" ".org"))) ; Load
|
(let ((files (directory-files-recursively "~/.doom.d/" ".org"))) ; Load
|
||||||
(dolist (file (oreodave/literate/remove-mult oreodave/literate/preloaded-files files))
|
(dolist (file (oreodave/literate/remove-mult oreodave/literate/preloaded-files files))
|
||||||
(load (oreodave/literate/destination file))))
|
(load (oreodave/literate/destination file))))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
Remove the config.el and literate.el files from the load list because:
|
|
||||||
1) config.org is preloaded by doom
|
|
||||||
2) literate.org is loaded by config.org, thus no need to reload it
|
|
||||||
|
|||||||
Reference in New Issue
Block a user