Re: excluding noweb references completely from exports

2020-01-07 Thread Samuel Wales
On 1/6/20, Fraga, Eric  wrote:
> Tangling is for extracting code(s) from a document; exporting is for
> presentation or dissemination of that document.

actually i wasn't intending to ask for the difference.  :)  instead, i
was intending to say that i thuoght it was reasonable for a beginner
to be confused.

i think a beginner can reasonably think tangling is like exporting,
just a bit different.  not orthogonal.  so it's like "um, why both?"
i use both btw.

that probably soudns crazy so let me elaborate.  if extracting uses
subsetting, that can be done by the :noexport: tag and perhaps similar
things in babel.  if extracting is putting stuff in source code files,
that can be done by exporting to files.

so i think a newcomer can reasonably get confused.  maybe just me and
idk if i have derailed the thread.  in which case, never mind!

-- 
The Kafka Pandemic

What is misopathy?
https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html

The disease DOES progress. MANY people have died from it. And ANYBODY
can get it at any time.



Re: excluding noweb references completely from exports

2020-01-07 Thread Tim Cross


Fraga, Eric  writes:

> On Monday,  6 Jan 2020 at 14:35, Samuel Wales wrote:
>> fyi i dimly recall that in babel's infancy, as a user new to lp and
>> using babel infrequently, i got confused about the difference while
>> reading the manual.  in fact, i wondered if the two features could be
>> the same thing but refactored.
>
> Tangling is for extracting code(s) from a document; exporting is for
> presentation or dissemination of that document.

Yes, that is how I have always thought of it. Exporting is about
exporting the document into a new format (PDF, HTML, Markdown etc). This
isn't really related to LP (it could be seen as a bit like 'weave' in LP
jargon I guess). Even without Babel, you would still want export in
order to publish your org documents in different formats.

Tangle on the other hand is the guts of LP. It is what extracts the code
in the source blocks into 'raw' code files i.e. *.c, *.java, *.py etc
and adds things like noweb references to enable you to build complete
source files from multiple separate source blocks (with references
etc). In addition, it provides the powerful feature of being able to
generate 'new' (results) content from your source blocks and insert
them back into the document which can then be exported, providing a
mechanism to create more dynamic documents, which I find very useful for
documenting a workflow process where the document becomes a log of the
process as well as documentation on exactly what the process is/does.

A good example of this is https://www.youtube.com/watch?v=dljNabciEGg

-- 
Tim Cross



Re: excluding noweb references completely from exports

2020-01-06 Thread Fraga, Eric
On Monday,  6 Jan 2020 at 14:35, Samuel Wales wrote:
> fyi i dimly recall that in babel's infancy, as a user new to lp and
> using babel infrequently, i got confused about the difference while
> reading the manual.  in fact, i wondered if the two features could be
> the same thing but refactored.

Tangling is for extracting code(s) from a document; exporting is for
presentation or dissemination of that document.

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.3-34-g2eee3c



Re: excluding noweb references completely from exports

2020-01-06 Thread Samuel Wales
On 1/5/20, Fraga, Eric  wrote:
> Export and tangling are orthogonal to each other and are controlled
> independently by their respectively keywords in the src header
> lines.  In other words, I am not sure I understand what one has to do
> with the other.

[fyi my computer broke some time ago and i am only partly back so i
might have missed stuff.]

fyi i dimly recall that in babel's infancy, as a user new to lp and
using babel infrequently, i got confused about the difference while
reading the manual.  in fact, i wondered if the two features could be
the same thing but refactored.

so even if david is not confused, i imagine some are.



Re: excluding noweb references completely from exports

2020-01-05 Thread Fraga, Eric
On Sunday,  5 Jan 2020 at 06:27, David Bremner wrote:
> The attached exports with a blank line after the comment, which I don't
> want. The comment is just added to highlight the problem, so normally
> the blank line is at the beginning of the exported code block.

Oh, I see.

One approach would be to have a src block that uses noweb to bring in
*all* the various code snippets and have each snippet not include
anything else.  The former would be tangled but the others not.  This is
what I do generally: the noweb code block has no actual code but just
includes all the various bits.

HTH,
eric

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.3-34-g2eee3c



Re: excluding noweb references completely from exports

2020-01-05 Thread David Bremner
"Fraga, Eric"  writes:

> On Saturday,  4 Jan 2020 at 14:15, David Bremner wrote:
>> Any better ideas for how to do this? In case it's not clear, I want
>> include files in my tangled output that don't show in the beamer
>> export.
>
> Export and tangling are orthogonal to each other and are controlled
> independently by their respectively keywords in the src header
> lines.  In other words, I am not sure I understand what one has to do
> with the other.
>
> Would you please give an example that does not work the way you want it?

The attached exports with a blank line after the comment, which I don't
want. The comment is just added to highlight the problem, so normally
the blank line is at the beginning of the exported code block.

#+STARTUP: beamer
#+OPTIONS: toc:nil
#+PROPERTY: header-args :noweb strip-export :shebang "#lang plait" :tangle-mode (identity #o644)
#+LATEX_HEADER: \usepackage{listings}

* A frame
#+BEGIN_SRC scheme :tangle tangled.rkt
; there is a blank line after this comment
<>
(Snake? (Snake 'Slimey 10 'rats)) ; => #t
(Snake? (Tiger 'Tony 12)) ; => #t
#+END_SRC

#+NAME: include/animal-type.rkt
#+BEGIN_SRC scheme :export none
(define-type Animal
  [Snake   (name : Symbol) (weight : Number) (food : Symbol)]
  [Tiger   (name : Symbol) (weight : Number)])

#+END_SRC


Re: excluding noweb references completely from exports

2020-01-05 Thread Fraga, Eric
On Saturday,  4 Jan 2020 at 14:15, David Bremner wrote:
> Any better ideas for how to do this? In case it's not clear, I want
> include files in my tangled output that don't show in the beamer
> export.

Export and tangling are orthogonal to each other and are controlled
independently by their respectively keywords in the src header
lines.  In other words, I am not sure I understand what one has to do
with the other.

Would you please give an example that does not work the way you want it?

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.3-34-g2eee3c