emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Tangling text files
@ 2012-01-27 18:07 dlc
  2012-01-27 18:13 ` Ian Barton
  2012-01-28  1:43 ` Eric Schulte
  0 siblings, 2 replies; 3+ messages in thread
From: dlc @ 2012-01-27 18:07 UTC (permalink / raw)
  To: Org Mode

How do I tangle txt to a txt file?

#+TITLE:  Centos 5 Apache Configuration
#+AUTHOR: David Coate

* Basic Conguration
* Php Settings
* Virtual Host
   e.g.  for apache configuration
** example.com
     Use this as main website, use drupal,  various other notes

#+BEGIN_SRC: txt :tangle vhost.conf
ServerName Example.com
DocumentRoot "/var/www/example.com"
#+END_SRC:

** companyb.com
     notes about company b.
#+BEGIN_SRC: txt :tangle vhost.conf
ServerName Companyb.com
DocumentRoot "/var/www/companyb.com"
#+END_SRC:

... and so on for 40 more web sites.

I still want to be able to export this as HTML to document to others  
what i've done and use the org file to maintain the webpage and the  
source conf files.

Same issue for documenting my configuration files for postfix,  
dovecot, drupal settings, php.ini settings.

I'm sure this is easy, but searching the org manual or googling is not  
getting me the right answer.

#+BEGIN_ASCII and #+BEGIN_EXAMPLE  seem to be for exporting only and  
not tangling.

Thanks!
David

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Tangling text files
  2012-01-27 18:07 Tangling text files dlc
@ 2012-01-27 18:13 ` Ian Barton
  2012-01-28  1:43 ` Eric Schulte
  1 sibling, 0 replies; 3+ messages in thread
From: Ian Barton @ 2012-01-27 18:13 UTC (permalink / raw)
  To: emacs-orgmode

On 27/01/12 18:07, dlc wrote:
> How do I tangle txt to a txt file?
>
> #+TITLE: Centos 5 Apache Configuration
> #+AUTHOR: David Coate
>
> * Basic Conguration
> * Php Settings
> * Virtual Host
> e.g. for apache configuration
> ** example.com
> Use this as main website, use drupal, various other notes
>
> #+BEGIN_SRC: txt :tangle vhost.conf
> ServerName Example.com
> DocumentRoot "/var/www/example.com"
> #+END_SRC:
>
> ** companyb.com
> notes about company b.
> #+BEGIN_SRC: txt :tangle vhost.conf
> ServerName Companyb.com
> DocumentRoot "/var/www/companyb.com"
> #+END_SRC:
>
> ... and so on for 40 more web sites.
>
> I still want to be able to export this as HTML to document to others
> what i've done and use the org file to maintain the webpage and the
> source conf files.
>
> Same issue for documenting my configuration files for postfix, dovecot,
> drupal settings, php.ini settings.
>
> I'm sure this is easy, but searching the org manual or googling is not
> getting me the right answer.
>
> #+BEGIN_ASCII and #+BEGIN_EXAMPLE seem to be for exporting only and not
> tangling.
>

I don't know if this is the "right" way, but I just pretend my files are 
shell scripts:

* Dovecot.
** dovecot.conf
#+BEGIN_SRC sh :tangle 
~/dropbox/configuration_files/wilkesley.org/dovecot/dovecot.conf 
:exports none :noweb yes
protocols = imap sieve
ssl = yes
ssl_cert = </etc/ssl/certs/mail2.wilkesley.net.crt
ssl_key = </etc/ssl/private/mail2.wilkesley.net.key

Ian.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Tangling text files
  2012-01-27 18:07 Tangling text files dlc
  2012-01-27 18:13 ` Ian Barton
@ 2012-01-28  1:43 ` Eric Schulte
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Schulte @ 2012-01-28  1:43 UTC (permalink / raw)
  To: dlc; +Cc: Org Mode

dlc <dlc@coateconnection.com> writes:

> How do I tangle txt to a txt file?
>
> #+TITLE:  Centos 5 Apache Configuration
> #+AUTHOR: David Coate
>
> * Basic Conguration
> * Php Settings
> * Virtual Host
>    e.g.  for apache configuration
> ** example.com
>      Use this as main website, use drupal,  various other notes
>
> #+BEGIN_SRC: txt :tangle vhost.conf
> ServerName Example.com
> DocumentRoot "/var/www/example.com"
> #+END_SRC:
>

It is actually just a syntax problem, you should delete the ":"s after
your begin and end src lines so the above becomes

#+BEGIN_SRC txt :tangle vhost.conf
ServerName Example.com
DocumentRoot "/var/www/example.com"
#+END_SRC

Then tangling should work as expected.  You'd be surprised how long it
took me to notice the colons :).  One good way to solve these sorts of
issues is using the built in templates, e.g., type "<s" at the beginning
of a line and then press TAB.

Best,

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-01-28  1:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-27 18:07 Tangling text files dlc
2012-01-27 18:13 ` Ian Barton
2012-01-28  1:43 ` Eric Schulte

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).