I'm building a web application using the literate programming style. At least trying to.
I wanted to "hit the ground running", so I decided "make a copy" of one of the many "starter apps"
https://github.com/RailsApps/rails-bootstrap
So before I have written a single line of code, I have a directory structure for the application (app/ public/ tmp/ etc), and tons of boilerplate code.
The first piece of code I wrote in my org file is this
#+begin_src ruby
after_create :create_braintree_customer
def create_braintree_customer
Braintree.api_key = "bk-54cfa45"
self.id = Braintree::Customer.create.id
self.save
end
#+end_src
Now when "tangling", this method should go here:
$ cat ~/project/app/models/user.rb
class User < ApplicationRecord
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
<<<<<<<< my code block should come here >>>>>>>>>>>>
end
Is this possible with the literate programming tools available with emacs?
What I tried: Read some examples at https://github.com/limist/literate-programming-examples but the tangling there generates whole files. I want to "embed" my stuff in to "template generated" stuff of the MVC application.