Ferret: a Lisp implementation for real time embedded control systems
github.com
github.com
With pandoc you get a system that can export to any format under the sun. The highlight so far was exporting a problematic code portion with the literate explanation around it and a pretty basic asymptotic analysis in latex to docx, code highlighting, math formulas, tables all worked without human intervention. It ended up in a power point that I'm told was very well received.
If you want to extract it run M-x org-babel-tangle and you will end up with the usual source files and directories installed relative to the location of the org file.
I doubt there's a dozen people in the world that do it. But it is surprisingly useful and powerful when you get used to it. If anyone in Melbourne is interested in learning about this I have been toying with the idea of running a workshop on it.
I'm in the process of getting the detangle working for noweb mode. The current implementation fakes it with regex which force you to write code linearly instead of literately. But even if you can't detangle arbitrarily nested code it's magic to see changes in a source file appear in the right source code block.
Just don’t tell me “you can see the context” as any proper codebase would probably not be linear in code flow anyway.
Some people use several Emacs windows (or frames or whatever) but all of them peeking into the same file, but in to different locations of it.
For instance, I group all include or equivalent statements in an appendix, rather than within the primary code discussion. If a block of code can't be directly reused, but for some reason needs to be in every (or several) source files (think standard boilerplate), I'll write it once in a place that makes sense, and reference it from all the places where it actually gets tangled into the output.
Additionally, I include the Makefile (or whatever equivalent) and other scripts within this same document. Learning docker? Make a dockerfile in here, fully annotated, along with the shell commands to actually deploy it.
Mine will only mirror the original source tree if it's:
Very simple.
I've imported a bunch of code into it and don't, yet, know how to break it down.
An example C project may look like:
* Purpose Statement
* README
* Usage
This program can be executed from the command line by calling:
#+BEGIN_EXAMPLE
$ ./foo
#+END_EXAMPLE
It accepts the following command line parameters:
- =-c= :: something
- =-d= :: something else
** Implementation
To process the command line flags we use <some library>.
it has the following API calls...
Here's the code for processing our commands...
* Business Logic
We communicate with the server via some REST API described in <location>
and <library> to make the calls.
-- Here I'd intermingle the REST API I'm using and the C API I'm producing
-- for my own consumption, or something similar.
* Code that's not fully organized yet
** Main Function
This is the entry point, blah, blah, blah:
#+BEGIN_SRC c :noweb yes :tangle src/main.c
#+END_SRC
* Appendix: IncludesI'm on the opposite side of the planet but I'd be interested, if you did an article or video on whatever you would teach in the workshop.
Though I have met a few people who use org mode as an organizer/planner.
[0] Mostly, the current implementation works only with source blocks that are linearly added one after the other and don't use the <<noweb reference>> in code blocks.
;; Tangle Org files when we save them
(defun toggle-org-tangle-on-save()
(interactive)
(if (bound-and-true-p org-tangle-on-save)
(setq-local org-tangle-on-save nil)
(setq-local org-tangle-on-save t))
(message (if org-tangle-on-save "Enabled tangling on save" "Disabled tangling on save")))At this point, I'm convinced Atlassian hates happiness, or there is some shameful architectural reason why they cannot support more than Markdown for their READMEs. Given the number of vociferous responses to that feature request, there would appear to demand.
Pandoc has a pretty decent Org Mode parser and writer.
Update: It needs to be extracted from an org file, and by default Github renders the org file so that the source is not visible.
https://raw.githubusercontent.com/nakkaya/ferret/master/ferr...
What feature of C++ does this need that is so compelling as to cut it off from use on straight C?