-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.t2t
74 lines (59 loc) · 3.3 KB
/
config.t2t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
% This is the txt2tags site main configuration file.
% All the pages use these configs.
% Some self-explanatory options (I guess)
%!target: html
%!encoding: UTF-8
% The style is on a nice CSS file. The SITEROOT here is a wildcard
% that will be expanded later (with %!postproc), so I can always
% refer to this file, no matter how deep the HTML is under folders.
%!style: site.css
% The --css-sugar is a nice option when you use CSS for formatting.
% It adds <div> tags on the HTML code: header, toc and body,
% making it easy to format each document area. It also removes some
% little formatting information that txt2tags adds, leaving the code
% clear for all your CSS trips.
%!options: --css-sugar
% New option in SVN version of txt2tags to fix path of CSS files,
% images and local links. Needed because the same source files are
% used by both the english and portuguese versions of the site.
%!options: --fix-path
% Remember the SITEROOT wildcard? Here it is expanded to the current
% folder (dot). Other files may redefine it to .. or ../.. depending
% how deep they are.
%!postproc: SITEROOT .
% Trick to add the author meta tag right after the <head> tag.
%!postproc: '(?i)(<head>)' '\1\n<meta name="author" content="Aurelio Jargas www.aurelio.net">'
% Trick to add the favicon meta tag right before the </head> tag.
%!postproc: '(?i)(</head>)' '<link rel="icon" type="image/png" href="/favicon.png">\n\1'
% Trick to add the TITLE/ALT attribute to an image
%!postproc: '(?i)(src="[^"]*t2tpowered.png")' '\1 title="O>OOOO"'
%!postproc: '(?i)(src="[^"]*donate.png".*?) ALT=""' '\1 alt="DONATE"'
% Trick to add an automatic link to the page top title
%!postproc: '^<H1>WIKINAME</H1>$' '<h1><a href="/">Bash Shell 中文版简明教程</a></h1>'
% Real nice trick to transform a link into a SPAN with TITLE.
% Used when you want a tooltip to appear when the mouse hovers some words.
%
% On the .t2t file, create a fake link like [CSS #tooltip1]
% Then make a filter like %!postproc: {tooltip1} Cascading Style Sheets
% If you need more tooltips, just increase the number: tooltip2, tooltip3...
% Also, make a span.tooltip rule on the CSS to highlight the words.
%
%!postproc: '(?i)<a href="#(tooltip[0-9]*)">(.*?)</a>' '<span class="tooltip" title="{\1}">\2</span>'
% A nice database of links. I just refer to them like {URLT2T} on the
% sources and the link is inserted when converting. Very handy to
% unpollute the sources and makes it easier when a link changes.
%
% Think of filters as a search & replace feature.
% preproc: replaces the text before the conversion (changes sources)
% postproc: replaces after the conversion (changes generated code)
%!preproc: {URLT2T} http://txt2tags.org
%!preproc: {URLT2TPT} http://txt2tags.org/pt/
%!preproc: {URLONLINE} http://txt2tags.org/online.php
%!preproc: {URLONLINEPT} http://txt2tags.org/pt/online.php
%!preproc: {URLT2TSVN} http://svn.txt2tags.org
%!preproc: {URLT2TGCODE} http://code.google.com/p/txt2tags/
%!preproc: {URLBLOG} http://txt2tags.wordpress.com
% Shortcuts for remote images (Note: postproc, no {})
%!postproc: URLIMGVALIDXHTML http://www.w3.org/Icons/valid-xhtml10.png
%!postproc: URLIMGVALIDHTML http://www.w3.org/Icons/valid-html40.png
%!postproc: URLIMGVALIDCSS http://www.w3.org/Icons/valid-css.png