Emmanuel Godard | 4 Feb 2009 08:36
Picon

[t2t] Customizing headers

Hi everybody,

is there an easy way to customize headers (actually, headers and top of
the body). There is the --no-headers option so it is possible to
concatenate with a customized header afterwards. But doing so, txt2tags
cannot conveniently set the content for the title tag (eg <title> in
(x)html).

Any idea? trick?

Emmanuel

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
txt2tags-list mailing list
https://lists.sourceforge.net/lists/listinfo/txt2tags-list

Barrie Stott | 5 Feb 2009 14:18
Picon
Favicon

[t2t] Layout problem for html output

I have a simple layout problem in a .t2t file but it beats me. I'd be
grateful if someone with more txt2tags experience than I have could
have a look at it.

Below is the bare essentials of a file. (between the ---- lines).
I.e., all the `p' are paragraphs or sequences of such and list items
a1..b2 are similar.

------------
p0
-  p1

   p2
   -  a1
   -  b1

   p3
   -  a2
   -  b2

   p4
------------

Thus what I have is a block of text followed by a list with a single
item that consists of 4 blocks, all at the same level:

paragraphs,
paragraphs followed by a list,
paragraphs followed by a list,
paragraphs.
(Continue reading)

paul+t2t | 5 Feb 2009 19:21
Picon

Re: [t2t] Customizing headers


On 4 Feb 2009 at 8:36, Emmanuel Godard wrote:

> Hi everybody,
> 
> is there an easy way to customize headers (actually, headers and top of
> the body). There is the --no-headers option so it is possible to
> concatenate with a customized header afterwards. But doing so, txt2tags
> cannot conveniently set the content for the title tag (eg <title> in
> (x)html).

I use postproc lines to change the headers where necessary:

add text to the title:
%!postproc(xhtml): '</title>' ' - friendly matches, Sunday cricket, 
Surrey &amp; Hants</title>'

add meta tags:
%!postproc(xhtml): '<meta' '<meta name="description" content="Cricket 
friendlies" />\n<meta'

I think something similar is used in the t2t website too.

paul

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
(Continue reading)

Emmanuel Godard | 6 Feb 2009 12:30
Picon

Re: [t2t] Customizing headers

paul+t2t@... a écrit :
> I use postproc lines to change the headers where necessary:
> 
> add text to the title:
> %!postproc(xhtml): '</title>' ' - friendly matches, Sunday cricket, 
> Surrey &amp; Hants</title>'
> 
That means that you are using something like
%!include(html):header.html, no? As I said, I use --no-headers *and*
(automatic, ie Makefile) concatenation of the header.html and the file
obtained from txt2tags. This way, I don't have to remember to add a 
%!include at the beginning of *all* of my file, or to put, as you 
suggest, the real title in the config part of my t2t files.

Your answer is interesting and achieves what I was asking for but I do
not find it really easy. Maybe it's personnal? :)

> add meta tags:
> %!postproc(xhtml): '<meta' '<meta name="description" content="Cricket 
> friendlies" />\n<meta'
> 
This trick is really interesting. Thanks.

> I think something similar is used in the t2t website too.
> 
You are right. I should have a look at this very example...

Cheers,
Emmanuel

(Continue reading)

Aurélio Jargas | 6 Feb 2009 14:33
Favicon
Gravatar

Re: [t2t] Customizing headers

Hello Emmanuel,

The filter tricks Paul told you will work when not using --no-headers,
so you've got the default txt2tags generated headers. Then smart
filters (postproc) can change the code to your needs.

But as you're using your customized headers, txt2tags leaves to you
the task to fill them.

Since you're already automating things with make, there's a solution I
can think of now. Do use something similar to templates. Put a special
string in your header.html file, like _DOC_TITLE:

--------------------------------
<html>
<head><title>_DOC_TITLE</title></head>
<body>
--------------------------------

Then create a simple table of "filename.t2t - Document Title" in your
Makefile, using sed to insert the correct title on header.html
(substituting _DOC_TITLE), depending on the filename.

Tell us if that worked!
Bye

On Wed, Feb 4, 2009 at 05:36, Emmanuel Godard
<emmanuel.godard@...> wrote:
> Hi everybody,
>
(Continue reading)

Aurélio Jargas | 6 Feb 2009 14:43
Favicon
Gravatar

Re: [t2t] Layout problem for html output

Hello Barrie,

The solution here is simple: just close the nested list with the empty item:

p0
-  p1

  p2
  -  a1
  -  b1
  -
  p3
  -  a2
  -  b2
  -
  p4

This "empty item closes current list" mark was created just to be used
in this specific situation, where nested list couldn't be closed
without closing everything (with the two blanks).

And of course, who doesn't like to use the two blanks can always close
lists with the empty item. It's a personal choice :)

Note: numbered lists and definition lists can also be closed by empty items.

Bye

On Thu, Feb 5, 2009 at 11:18, Barrie Stott <zen146410@...> wrote:
> I have a simple layout problem in a .t2t file but it beats me. I'd be
(Continue reading)

Barrie Stott | 6 Feb 2009 15:29
Picon
Favicon

Re: [t2t] Layout problem for html output

On Fri, Feb 06, 2009 at 11:43:05AM -0200, Aur?lio Jargas wrote:
> The solution here is simple: just close the nested list with the empty item:
> 
> p0
> -  p1
> 
>   p2
>   -  a1
>   -  b1
>   -
>   p3
>   -  a2
>   -  b2
>   -
>   p4
> 
> This "empty item closes current list" mark was created just to be used
> in this specific situation, where nested list couldn't be closed
> without closing everything (with the two blanks).

I'm most grateful for the reply and solution. Wonderful! And now I
don't need it I've found it documented in userguide.t2t.

Barrie.

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
(Continue reading)

Emmanuel Godard | 6 Feb 2009 15:54
Picon

Re: [t2t] Customizing headers

Hello Aurelio,

Aurélio Jargas a écrit :
> Hello Emmanuel,
> 
> The filter tricks Paul told you will work when not using --no-headers,
> so you've got the default txt2tags generated headers. Then smart
> filters (postproc) can change the code to your needs.
> 
> But as you're using your customized headers, txt2tags leaves to you
> the task to fill them.
> 
Yes that is exactly the problem. And the HEADER1,HEADER2 macros are not 
supposed to be used within t2t files I guess...
> Since you're already automating things with make, there's a solution I
> can think of now. Do use something similar to templates. Put a special
> string in your header.html file, like _DOC_TITLE:
> 
> --------------------------------
> <html>
> <head><title>_DOC_TITLE</title></head>
> <body>
> --------------------------------
> 
> Then create a simple table of "filename.t2t - Document Title" in your
> Makefile, using sed to insert the correct title on header.html
> (substituting _DOC_TITLE), depending on the filename.
> 
 > Tell us if that worked!

(Continue reading)

Aurélio Jargas | 6 Feb 2009 16:21
Favicon
Gravatar

Re: [t2t] Customizing headers

Hello Emmanuel,

On Fri, Feb 6, 2009 at 12:54, Emmanuel Godard
<emmanuel.godard@...> wrote:

> I appreciate your suggestion, but I am really looking for something
> *simple*. Actually, I already have my own homemade (sed m4 perl) scripts
> and I want to migrate everything to txt2tags (because it is multi
> targets and it rocks. really).

I guess you're on the right way :)

The txt2tags site and my personal site (aurelio.net) are two examples
of large sites managed 100% by txt2tags. No make/sed/shell/python
scripts involved. There's some "magic" you can learn by reading the
sources:

http://txt2tags.sourceforge.net/index.t2t
http://aurelio.net/include/kiwi/config.t2t

> I realize that I maybe need a longer post to explain exactly what I am
> looking for...

Please, fell free to write it!

Bye

--

-- 
Aurélio Marinho Jargas
www.aurelio.net
(Continue reading)

paul+t2t | 7 Feb 2009 09:26
Picon

Re: [t2t] Customizing headers


On 6 Feb 2009 at 12:30, Emmanuel Godard wrote:

> Your answer is interesting and achieves what I was asking for but I do
> not find it really easy. Maybe it's personnal? :)

:)

t2t is a very flexible tool, and you can use it in many different 
ways.  Originally I just used it to generate tables, but now it does 
the whole site.

My advice would be to start with what you feel happy with and see how 
it goes.

paul

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
txt2tags-list mailing list
https://lists.sourceforge.net/lists/listinfo/txt2tags-list


Gmane