Re: Find followed by many lines of arbitrary HTML through next but exclude the second

2021-09-15 Thread Sonic Purity
Thank you to everyone who’s replied. My issue has been solved. For anyone 
else who may be interested, i report my findings below.

On Wednesday, September 15, 2021 at 3:26:11 AM UTC-7 listmei...@gmail.com 
wrote:

> You miswrote your lookahead-assertion.
>

Oh boy i sure did. Thank you for pointing that out.
 

> Try this instead:
>
> (?s).+?(?=|\Z)
>

^ This is spectacular, and what i’ll be using. After testing it, i made 
myself sit down and re-read the Grep Help to understand what each part of 
the expression is doing. I’d entirely missed the section on the (?s) 
ability to allow . to include \r as well. This knowledge alone will help 
improve a number of my other regular expressions. I’ve not used positional 
assertions like \Z in the past, hence they don’t come to mind—something 
else learned—thanks!

The PERL filters (original and Chris’ modification both tested) failed for 
me: created the folder on the Desktop, but it was empty. The original 
document did remain intact. *But that’s OK* because i‘ve not evolved to the 
point to be doing exactly that yet. No one should spend any more time on 
this PERL filter on my behalf. This is both a learning experience and 
practical matter of getting things done activity for me, so it’s best for 
me to clunk along on training wheels with Text Factories full of Replace 
All clauses and likely AppleScript until i’m ready to learn more and get 
into something like PERL.

Appreciatively,
))Sonic((

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "supp...@barebones.com" rather than 
posting here. Follow @bbedit on Twitter: 
--- 
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 bbedit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/d11dfe55-f72c-41d0-bfc6-da74def5a02en%40googlegroups.com.


Re: Code Modules — A BBEdit-based Approach to Advanced Includes for Websites

2021-09-15 Thread Jan Erik Moström
On 15 Sep 2021, at 18:24, Christopher Werby wrote:

> The Sample Website for Code Modules demonstrates a simple "proto" blog with a 
> single Blog module serving the content in a variety of ways. There's a list 
> of recent blog posts (right sidebar), an index list of posts,  and a single 
> page with a single post.  These all come from the Blog module serving the 
> content in a variety of ways.

I missed that part, I need to take a closer look at this.

>  David's right - the main consideration is whether the features you wish need 
> to be served by a database or whether a static site created at build time 
> would work.

There is no need for a database, support for tags/categories can be handled by 
most static generators

> Features like user comments and "likes" need a database backend. But other 
> features could probably be created using Code Modules. Not very much comes 
> out of the box -- you'd need to write them.

I don't care about comments/likes etc.

>  Categories would probably involve adding Items to List files for each 
> category when adding a new Blog post.  I did something similar using Code 
> Modules to create this page — ICC Forum Guidelines.  The exemplars at the 
> bottom of the page have a categorization feature that allows each exemplar to 
> be placed in the exemplar sets (they look like domino pieces) scattered 
> higher up on the page.  Each exemplar demonstrates multiple features for the 
> guidelines, so the same exemplar is featured in multiple exemplar sets.  
> That's analogous to a tags/categories feature on a blog site.

Thanks, I check this out.

= jem

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "supp...@barebones.com" rather than 
posting here. Follow @bbedit on Twitter: 
--- 
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 bbedit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/70D980E2-4953-436D-9B16-D1DA9659862C%40mostrom.pp.se.


Re: Code Modules — A BBEdit-based Approach to Advanced Includes for Websites

2021-09-15 Thread Christopher Werby
Hi David,

A static pre-built site -- just a bunch of files -- on a properly 
configured server has to be far *more* secure than a production server 
hosting a real-time db and building pages on the fly.  Code Modules creates 
HTML pages at build time. The pages are completely static when they hit the 
server.  It's like comparing some Netlify site to WordPress.

Are you imagining a different approach where the text files are included at 
call time on the server? That could certainly be problematic.

On Wednesday, September 15, 2021 at 6:23:42 AM UTC-7 stra...@teuton.org 
wrote:

>
> > On 15 Sep 2021, at 06:29, Jan Erik Moström  wrote:
> > 
> > On 7 Sep 2021, at 23:56, Christopher Werby wrote:
> > 
> >> Announcing the release of Code Modules
> > 
> > I'm quite impressed with what you have done here. Just to make sure I've 
> understood things correctly: this is a tool for creating web sites but not 
> for web sites with a blog?
> > 
> > = jem
>
> That probably depends how committed you are to a static/DB-less site. Long 
> ago, before DBs were available, I had a blog that stored entries as text 
> files, but I wouldn’t advise it now, the security risks are scary! :)
>
> David

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "supp...@barebones.com" rather than 
posting here. Follow @bbedit on Twitter: 
--- 
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 bbedit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/581a2a37-b867-4ae9-9d1a-80ccb91bde4dn%40googlegroups.com.


Re: Code Modules — A BBEdit-based Approach to Advanced Includes for Websites

2021-09-15 Thread Christopher Werby
Hi Jan,

The Sample Website for Code Modules demonstrates a simple "proto" blog 
 with a single Blog module 
serving the content in a variety of ways. There's a list of recent blog 
posts (right sidebar), an index list of posts,  and a single page with a 
single post.  These all come from the Blog module serving the content in a 
variety of ways.

David's right - the main consideration is whether the features you wish 
need to be served by a database or whether a static site created at build 
time would work.  Features like user comments and "likes" need a database 
backend. But other features could probably be created using Code Modules. 
Not very much comes out of the box -- you'd need to write them.

Categories would probably involve adding Items to List files for each 
category when adding a new Blog post.  I did something similar using Code 
Modules to create this page — ICC Forum Guidelines 
.  The exemplars at the bottom of the page 
have a categorization feature that allows each exemplar to be placed in the 
exemplar sets (they look like domino pieces) scattered higher up on the 
page.  Each exemplar demonstrates multiple features for the guidelines, so 
the same exemplar is featured in multiple exemplar sets.  That's analogous 
to a tags/categories feature on a blog site. 

Thanks for checking out the project.

On Wednesday, September 15, 2021 at 7:06:34 AM UTC-7 Jan Erik Moström wrote:

> On 15 Sep 2021, at 9:38, David Donachie wrote:
>
> >> On 15 Sep 2021, at 06:29, Jan Erik Moström  wrote:
> >>
> >> On 7 Sep 2021, at 23:56, Christopher Werby wrote:
> >>
> >>> Announcing the release of Code Modules
> >>
> >> I'm quite impressed with what you have done here. Just to make sure 
> I've understood things correctly: this is a tool for creating web sites but 
> not for web sites with a blog?
> >>
> >> = jem
> >
> > That probably depends how committed you are to a static/DB-less site. 
> Long ago, before DBs were available, I had a blog that stored entries as 
> text files, but I wouldn’t advise it now, the security risks are scary! :)
>
> I'm mostly thinking of the extra work creating a blog, generating index 
> pages etc. I mean that there are a several static site generators (usually 
> with some kind of blogging support) like Pelican, Hugo, Nicola, Jekyll, 
> etc, that handles that automatically. Manually maintaining a site with a 
> fairly large number of blog entries quickly become cumbersome (if you want 
> support for categories, tags, etc), while it's easier to maintain a site 
> with a smaller number of pages (think documentation or a smaller info site).
>
> Since BBEdit doesn't have support for generating various kind of indexes 
> (that I know of), I was wondering if Code Modules have support for this. I 
> might have missed it but I didn't see any indication of this.
>
> = jem
>

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "supp...@barebones.com" rather than 
posting here. Follow @bbedit on Twitter: 
--- 
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 bbedit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/2b5e2ff7-2883-42ef-9225-ab18b7d66a8cn%40googlegroups.com.


Re: Code Modules — A BBEdit-based Approach to Advanced Includes for Websites

2021-09-15 Thread Jan Erik Moström
On 15 Sep 2021, at 9:38, David Donachie wrote:

>> On 15 Sep 2021, at 06:29, Jan Erik Moström  wrote:
>>
>> On 7 Sep 2021, at 23:56, Christopher Werby wrote:
>>
>>> Announcing the release of Code Modules
>>
>> I'm quite impressed with what you have done here. Just to make sure I've 
>> understood things correctly: this is a tool for creating web sites but not 
>> for web sites with a blog?
>>
>> = jem
>
>  That probably depends how committed you are to a static/DB-less site. Long 
> ago, before DBs were available, I had a blog that stored entries as text 
> files, but I wouldn’t advise it now, the security risks are scary! :)

I'm mostly thinking of the extra work creating a blog, generating index pages 
etc. I mean that there are a several static site generators (usually with some 
kind of blogging support) like Pelican, Hugo, Nicola, Jekyll, etc, that handles 
that automatically. Manually maintaining a site with a fairly large number of 
blog entries quickly become cumbersome (if you want support for categories, 
tags, etc), while it's easier to maintain a site with a smaller number of pages 
(think documentation or a smaller info site).

Since BBEdit doesn't have support for generating various kind of indexes (that 
I know of), I was wondering if Code Modules have support for this. I might have 
missed it but I didn't see any indication of this.

= jem

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "supp...@barebones.com" rather than 
posting here. Follow @bbedit on Twitter: 
--- 
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 bbedit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/DD28D93F-AC08-42DA-919E-80DD6C47F2D9%40mostrom.pp.se.


Re: Code Modules — A BBEdit-based Approach to Advanced Includes for Websites

2021-09-15 Thread David Donachie


> On 15 Sep 2021, at 06:29, Jan Erik Moström  wrote:
> 
> On 7 Sep 2021, at 23:56, Christopher Werby wrote:
> 
>> Announcing the release of Code Modules
> 
> I'm quite impressed with what you have done here. Just to make sure I've 
> understood things correctly: this is a tool for creating web sites but not 
> for web sites with a blog?
> 
> = jem

That probably depends how committed you are to a static/DB-less site. Long ago, 
before DBs were available, I had a blog that stored entries as text files, but 
I wouldn’t advise it now, the security risks are scary! :)

David

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "supp...@barebones.com" rather than 
posting here. Follow @bbedit on Twitter: 
--- 
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 bbedit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/0100017be864a408-918c9e01-3dde-467a-af1c-948080899def-00%40email.amazonses.com.


Re: Find followed by many lines of arbitrary HTML through next but exclude the second

2021-09-15 Thread Christopher Stone
> On Sep 15, 2021, at 00:51, ctfishman  wrote:
> 
> I tried doing this with just a regular expression but couldn't figure out how.

Hey There,

Yeah, you couldn't automate the whole process with regex alone.

> I was however able to do it quite easily with a text filter...
> 
> --
> 
> #!/usr/bin/perl
> 
> # Read each line into a scaler, then print it back
> 
> my $fullstring;
> 
> while (<>) {
> $fullstring .= $_;
> print;
> }

Looks good, although I'd shortcut the above with:


#!/usr/bin/env perl -0777 -nsw

print;


Now the entire string is in $_ and ready to process.


--
Best Regards,
Chris

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "supp...@barebones.com" rather than 
posting here. Follow @bbedit on Twitter: 
--- 
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 bbedit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/D625E3D2-F473-4FA1-8A2B-F404DC2FA76F%40gmail.com.


Re: Find followed by many lines of arbitrary HTML through next but exclude the second

2021-09-15 Thread Christopher Stone
> On Sep 14, 2021, at 16:57, Sonic Purity  wrote:
> Re-reading the Grep help file with BBEdit, i thought lookahead might help. I 
> tried:
> 
> ([\s\S]+?)(?)
> 

Hey There,

You miswrote your lookahead-assertion.

This:
> ([\s\S]+?)(?)
> 


Should look like this:


([\s\S]+?)(?=)


This is fine, except it will exclude your last chapter.


Try this instead:

(?s).+?(?=|\Z)


--
Best Regards,
Chris

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "supp...@barebones.com" rather than 
posting here. Follow @bbedit on Twitter: 
--- 
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 bbedit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/44B8E425-64DA-4A2F-B315-2E0E26E019BC%40gmail.com.