Neil,

In looking at your code, I'm a bit confused.

First, why not just specify the included includes as comments?

Second, why does your include change the doctype from invocation to 
invocation?

On Friday, March 23, 2018 at 5:17:16 AM UTC-7, Neil Faiman wrote:
>
> On Mar 23, 2018, at 12:13 AM, Neil Faiman <[email protected] 
> <javascript:>> wrote:
>
>
> For years, I’ve been using persistent includes (<!— #bbinclude …. >) that 
> contain plain includes (#bbinclude …). This always works just as I want: 
> The persistent include body is inserted in the document, and then the 
> #bbincludes in the inserted text are recursively substituted.
>
> In other places I’ve used included scripts (persistent includes that 
> include an AppleScript, Perl, or Swift script that generates he included 
> text. This also works perfectly.
>
> But I just tried replacing a persistent include whose body text contains 
> #bbinclude’s with an included script that generates exactly the same body 
> text, AND THE NESTED #BBINCLUDE’s AREN’T SUBSTITUTED.
>
>
> In case that was incomprehensible, here’s my old persistent include file, 
> “Minutes Header":
>
> <!DOCTYPE html>
> <html lang="en-US">
> <head>
> <title>Wilton ZBA Minutes - #MEETING_DATE#</title>
> <meta name="description" content="Wilton, NH ZBA Minutes, #MEETING_DATE#" 
> />
> #bbinclude "Common Head Elements"
> </head>
> <body class="minutes">
> #bbinclude "ZBA Letterhead"
> #bbinclude "Navigation Bar"
> <p class="breadcrumbs">
> <a href="#RELATIVE#index.html">Wilton ZBA</a> &gt;
> <a href="./index.html">Minutes</a> &gt;
> #MEETING_DATE#
> </p>
> #bbinclude "Minutes disclaimer"
> <h1>#MEETING_DATE#</h1>
>
> When I include this in a document with
>
> <!-- #bbinclude "Minutes Header" #MEETING_DATE#="December 11, 1996" -->
> <!-- end bbinclude -->
>
> and update the document, I end up with
>
> <!-- #bbinclude "Minutes Header" #MEETING_DATE#="December 11, 1996" -->
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
> <html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en-US">
> <head>
> <title>Wilton ZBA Minutes - December 11, 1996</title>
> <meta name="description" content="Wilton, NH ZBA Minutes, December 11, 
> 1996" />
> .
> .
> .
> ><li><a href="../search.html" title="Advanced search and search 
> tips">Search</a></li></ul></div>
> <div id="content">
>
> <p class="breadcrumbs">
> <a href="../index.html">Wilton ZBA</a> &gt;
> <a href="./index.html">Minutes</a> &gt;
> December 11, 1996
> </p>
> <p class="disclaimer">
> Minutes posted at this web site have not been checked for consistency with 
> the printed minutes that are available in the Wilton Town Offices.  Also, 
> the minutes posted here are the original, draft minutes, without any 
> corrections or amendments which may have been adopted at a subsequent ZBA 
> meeting. If you need the definitive minutes of a ZBA meeting, please obtain 
> the printed minutes from the <a href="../town_office.html">town offices</a>.
> </p>
> <h1>December 11, 1996</h1>
> <!-- end bbinclude —>
>
> Now I write a script, "Minutes Header.swift”, and change the persistent 
> include to
>
> <!-- #bbinclude "Minutes Header.swift" #SCANNED#="1" -->
> <!-- end bbinclude -->
>
> When I run this script standalone, it writes this to standard output:
>
> <!DOCTYPE html>
>  <html lang="en-US">
>  <head>
>      <title>Wilton ZBA Minutes — December 11, 1996</title>
>      <meta name="description" content="Wilton, NH ZBA Minutes, December 
> 11, 1996" />
>  #bbinclude "Common Head Elements"
>  </head>
>  <body class="minutes">
>  #bbinclude "ZBA Letterhead"
>  #bbinclude "Navigation Bar"
>  <p class="breadcrumbs">
>  <a href="#RELATIVE#index.html">Wilton ZBA</a> &gt;
>  <a href="./index.html">Minutes</a> &gt;
>  December 11, 1996 </p>
>  #bbinclude "Minutes disclaimer with scanned PDF"
>  <h1>December 11, 1996</h1>
>
> But when I update the document, I get
>
> <!-- #bbinclude "Minutes Header.swift" #SCANNED#="1" -->
> <!DOCTYPE html>
>  <html lang="en-US">
>  <head>
>      <title>Wilton ZBA Minutes — December 11, 1996</title>
>      <meta name="description" content="Wilton, NH ZBA Minutes, December 
> 11, 1996" />
>  #bbinclude "Common Head Elements"
>  </head>
>  <body class="minutes">
>  #bbinclude "ZBA Letterhead"
>  #bbinclude "Navigation Bar"
>  <p class="breadcrumbs">
>  <a href="../index.html">Wilton ZBA</a> &gt;
>  <a href="./index.html">Minutes</a> &gt;
>  December 11, 1996 </p>
>  #bbinclude "Minutes disclaimer with scanned PDF"
>  <h1>December 11, 1996</h1>
> <!-- end bbinclude -->
>
> I.e., unlike the first example, the nested #bbincludes are not expanded.
>
>
>

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/bbedit.

Reply via email to