f



is there a free blog site like live journal done in tcl?

curious?
0
9/13/2012 1:28:35 AM
comp.lang.tcl 23428 articles. 2 followers. Post Follow

5 Replies
9834 Views

Similar Articles

[PageSpeed] 50

On Wednesday, September 12, 2012 8:28:35 PM UTC-5, gavino_himself wrote:
> curious?

I have seen something called Maja-Maja on www.scarpaz.com, but it is a processor that generates static content from a file structure. Including blog notes.
0
9/19/2012 3:04:39 AM
On Wednesday, September 12, 2012 9:28:35 PM UTC-4, gavino_himself wrote:
> curious?

I have a blog engine I wrote but never released, which I really should put =
online. =20

It allows you to specify your entire blog layout (theme) in a single short =
file, instead of writing two dozen PHP files.  Here, for example, is sample=
 code from a basic theme without comments:

templates: {
        main:           [header] [sidebar] [content]
        page:           [header] [articleview -id [GET id]]

        header:         <h1 [class title]> [blog title] </h1>
                        <h3 [class subtitle]> [blog subtitle] </h3>
                        [menubar]

        menubar{ul}:    {
                foreach a {about code links} {
                        append out "[menuentry -id $a]\n"
                }
                set out
        }
        menuentry{li}:  <a [link page -id @id]>Article @id</a>

        content{ul}:    [db articles]

        start{}:        <h2><a [link page -id @id]>@title</a></h2>
                        <p>@head</p>
        small{li}:      [start]
                        <p>(Comments disabled)</p>

        large{li}:      [start]
                        <p>@body</p>

        articleview{ul}: [db articles -where "id=3D@id" -format large]
}

When the engine is run, it evaluates the text labeled "main" (unless your b=
rowser points to blog.tcl?v=3Dsomethingelse,) ultimately expanding into a w=
hole HTML file.  This way I don't need a MAIN.PHP, ARTICLEVIEW.PHP, SIDEBAR=
..PHP, etc:  it's all put in one file and factored insanely small.

The templates: command simply parses its one argument with regexp into labe=
ls and text, does a [set labels($label) $text], and aliases each label so i=
t can be called as a command.  By default, if a label is assigned to some t=
ext, then [$label] expands to=20

<DIV class=3D"$label"> [subst $text] </DIV>

....although as you can see, you can set the outer markup to something else =
like a UL or LI or P by putting that in braces.  Capitalizing the label mak=
es it use an ID instead of a class.

A separate [db] command uses SQLite to form a query, with a few common defa=
ults defined.  Again, the goal is to leave out all the stuff I shouldn't ha=
ve to write.  At the top of my theme, I have:

set dbDefaults(articles) { -table article -sort "DATE DESC" -perpage 10 -fo=
rmat small }
set dbDefaults(comments) { -table comment -sort "DATE ASC" -perpage 10 -for=
mat comment }

Then in the theme I can just define my content to be [db articles], and the=
 engine knows what I mean.

Finally, I write a separate CSS file with a style for every class, and afte=
r that I can tweak the whole blog layout with two terminal windows without =
ever leaving vi.

--S
[Why yes, this was borne out of frustration with Wordpress.]
0
9/20/2012 7:55:39 PM
On Thu, 20 Sep 2012, Prof Craver wrote:

> Date: Thu, 20 Sep 2012 12:55:39 -0700 (PDT)
> From: Prof Craver <xcottcraver@gmail.com>
> Newsgroups: comp.lang.tcl
> Subject: Re: is there a free blog site like live journal done in tcl?
> 
> On Wednesday, September 12, 2012 9:28:35 PM UTC-4, gavino_himself wrote:
>> curious?
>
> I have a blog engine I wrote but never released, which I really should put online.
>
> It allows you to specify your entire blog layout (theme) in a single short file, instead of writing two dozen PHP files.  Here, for example, is sample code from a basic theme without comments:
>
> templates: {
>        main:           [header] [sidebar] [content]
>        page:           [header] [articleview -id [GET id]]
>
>        header:         <h1 [class title]> [blog title] </h1>
>                        <h3 [class subtitle]> [blog subtitle] </h3>
>                        [menubar]
>
>        menubar{ul}:    {
>                foreach a {about code links} {
>                        append out "[menuentry -id $a]\n"
>                }
>                set out
>        }
>        menuentry{li}:  <a [link page -id @id]>Article @id</a>
>
>        content{ul}:    [db articles]
>
>        start{}:        <h2><a [link page -id @id]>@title</a></h2>
>                        <p>@head</p>
>        small{li}:      [start]
>                        <p>(Comments disabled)</p>
>
>        large{li}:      [start]
>                        <p>@body</p>
>
>        articleview{ul}: [db articles -where "id=@id" -format large]
> }
>
> When the engine is run, it evaluates the text labeled "main" (unless your browser points to blog.tcl?v=somethingelse,) ultimately expanding into a whole HTML file.  This way I don't need a MAIN.PHP, ARTICLEVIEW.PHP, SIDEBAR.PHP, etc:  it's all put in one file and factored insanely small.
>
> The templates: command simply parses its one argument with regexp into labels and text, does a [set labels($label) $text], and aliases each label so it can be called as a command.  By default, if a label is assigned to some text, then [$label] expands to
>
> <DIV class="$label"> [subst $text] </DIV>
>
> ...although as you can see, you can set the outer markup to something else like a UL or LI or P by putting that in braces.  Capitalizing the label makes it use an ID instead of a class.
>
> A separate [db] command uses SQLite to form a query, with a few common defaults defined.  Again, the goal is to leave out all the stuff I shouldn't have to write.  At the top of my theme, I have:
>
> set dbDefaults(articles) { -table article -sort "DATE DESC" -perpage 10 -format small }
> set dbDefaults(comments) { -table comment -sort "DATE ASC" -perpage 10 -format comment }
>
> Then in the theme I can just define my content to be [db articles], and the engine knows what I mean.
>
> Finally, I write a separate CSS file with a style for every class, and after that I can tweak the whole blog layout with two terminal windows without ever leaving vi.
>
> --S
> [Why yes, this was borne out of frustration with Wordpress.]
>

Caution:  this same question was asked on comp.lang.forth by Gavino.  He's 
not paying attention to the response, and he keeps on asking inane 
questions with no thought toward the response.  He is a troll in the guise 
of a tcl/forth/smalltalk/OpenBSD/etc novice, and can be seen in various 
news groups busily wasting people's time and energy.  He will not use any 
suggestions proffered, and unless someone else is following the thread, 
your response is wasted.

sorry,
Rob.

0
Spam159 (460)
9/20/2012 10:05:40 PM
Spam@ControlQ.com writes:

> On Thu, 20 Sep 2012, Prof Craver wrote:
>
>> Date: Thu, 20 Sep 2012 12:55:39 -0700 (PDT)
>> From: Prof Craver <xcottcraver@gmail.com>
>> Newsgroups: comp.lang.tcl
>> Subject: Re: is there a free blog site like live journal done in tcl?
>>
>> On Wednesday, September 12, 2012 9:28:35 PM UTC-4, gavino_himself wrote:
>>> curious?
>>
>> I have a blog engine I wrote but never released, which I really should put online.

[inspiring description snipped]
>
> Caution:  this same question was asked on comp.lang.forth by Gavino.
> He's not paying attention to the response, and he keeps on asking

[...]

yes, unfortunately.

> [...] unless someone else is
> following the thread, your response is wasted.

Fortunately not: I enjoyed it thotoughly, thanks Prof. Craver :-)

regards
-- tomás
0
tomas2949 (126)
9/21/2012 6:50:58 PM
On Fri, 21 Sep 2012, tom?s zerolo wrote:

> Date: Fri, 21 Sep 2012 20:51:47 +0200
> From: tom?s zerolo <tomas@tuxteam.de>
> Newsgroups: comp.lang.tcl
> Subject: Re: is there a free blog site like live journal done in tcl?
> 
> Spam@ControlQ.com writes:
>
>> On Thu, 20 Sep 2012, Prof Craver wrote:
>>
>>> Date: Thu, 20 Sep 2012 12:55:39 -0700 (PDT)
>>> From: Prof Craver <xcottcraver@gmail.com>
>>> Newsgroups: comp.lang.tcl
>>> Subject: Re: is there a free blog site like live journal done in tcl?
>>>
>>> On Wednesday, September 12, 2012 9:28:35 PM UTC-4, gavino_himself wrote:
>>>> curious?
>>>
>>> I have a blog engine I wrote but never released, which I really should put online.
>
> [inspiring description snipped]
>>
>> Caution:  this same question was asked on comp.lang.forth by Gavino.
>> He's not paying attention to the response, and he keeps on asking
>
> [...]
>
> yes, unfortunately.
>
>> [...] unless someone else is
>> following the thread, your response is wasted.
>
> Fortunately not: I enjoyed it thotoughly, thanks Prof. Craver :-)
>
> regards
> -- tom?s

Serendipity!
0
Spam159 (460)
9/21/2012 7:04:50 PM
Reply: