texmacs-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Texmacs-dev] fangle, indexes and such


From: Sam Liddicott
Subject: [Texmacs-dev] fangle, indexes and such
Date: Sat, 14 Apr 2012 17:55:56 +0100

I have finally made the change and am using .scm files for some of the literate programming stuff at www.fangled.org and http://git.savannah.gnu.org/cgit/fangle.git/log/?h=WIP

I've added indexing of code chunks, so that the reader may easily see the different pages where each of the chunklet appears; and also find where a chunk is referenced by another chunklet or in the narrative.

I'm currently using <the-index*|> to render these indexes, but I'd rather use my own index tag.

My init-fangle.scm does:

  (define-group automatic-section-tag list-of-chunks)

but menu "document, update, all" does not update an instances of:

<list-of-chunks|nf-chunk|...

even though the indexes entries are created in the aux section and

<the-index*|nf-chunk|... DOES get updated.

However, this works:

  (menu-extend automatic-menu
    ("List of Fangle chunks" (make-aux* "the-index*" "nf-chunk" "Code Index"))
   )

So inserting a code index is simple; but does not give me control over the rendering as my own list-of-chunks tag would.

Question: What did I miss in getting "list-of-chunks" to be updated?


Also, I want each code chunk to display below it the other chunks that use it. The "document, update, all" menu only populates tags within the tree that it knows about, this means that I literally need to enter an index tag into the code chunk so that it might get populated - this is not so convenient. It also means I will have hundreds of indexes in my auxiliary section.

I have found that I can insert index tabs in the pre-amble, like this:
<assign|code-index-info|<\the-index*|nf-chunk|Code Index>
      <index-1|./hello-world.c|<reference|code-ref-./hello-world.c-1>,
      <reference|code-ref-./hello-world.c-2>,
      <reference|code-ref-./hello-world.c-3>>

      <index-1|main|<reference|code-ref-main-1>>

      <index-2|Used by|<reference|code-ref-./hello-world.c-1>>

      <index-1|message|<reference|code-ref-message-1>>

      <index-2|Used by|<reference|code-ref-message-printf-1>,
      <reference|code-ref-message-puts-1>>

      <index-1|message-printf|<reference|code-ref-message-printf-1>>

      <index-2|Used by|<reference|code-ref-main-1>>

      <index-1|message-puts|<reference|code-ref-message-puts-1>>
    </the-index*>>
  </hide-preamble>

and then I can have macros de-construct the index which has been stored in code-index-info. The advantage here is that I could use a <with|> block to give a rendering that would be simpler to de-construct.

I could then have a macro that in each code chunk would extract the index references for it alone, avoid having hundreds of indexes and avoid the difficulties in getting my custom index tags populated.

Of course it makes one wonder why this information is stored in the aux section at all when the pre-amble would be more useful...

reply via email to

[Prev in Thread] Current Thread [Next in Thread]