This repository has been archived by the owner on Jun 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmkpongo.html
119 lines (93 loc) · 3.63 KB
/
mkpongo.html
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<!DOCTYPE html>
<html>
<head>
<title>Caltech Library's Digital Library Development Sandbox</title>
<link rel="stylesheet" href="/css/site.css">
</head>
<body>
<header>
<a href="http://library.caltech.edu"><img src="/assets/liblogo.gif" alt="Caltech Library logo"></a>
</header>
<nav>
<ul>
<li><a href="/">Home</a></li>
<li><a href="../">Up</a></li>
<li><a href="./mkrss.html">mkrss</a></li>
<li><a href="./mkpage.html">mkpage</a></li>
<li><a href="./urlencode.html">urlencode</a></li>
<li><a href="./go-template-recipes.html">Go text/template recipes</a></li>
<li><a href="./titleline.html">titleline</a></li>
<li><a href="./mkslides.html">mkslides</a></li>
<li><a href="./slides/three-slides.html">Title Page</a></li>
<li><a href="./slides/presentation.html">What is mkslides?</a></li>
<li><a href="./byline.html">byline</a></li>
<li><a href="./ws.html">ws</a></li>
<li><a href="./frontmatter.html">frontmatter</a></li>
<li><a href="./mkpongo.html">mkpongo</a></li>
<li><a href="./urldecode.html">urldecode</a></li>
<li><a href="./sitemapper.html">sitemapper</a></li>
<li><a href="./reldocpath.html">reldocpath</a></li>
</ul>
</nav>
<section>
<h1>USAGE</h1>
<pre><code>mkpongo [OPTIONS] [KEY/VALUE DATA PAIRS] TEMPLATE_FILENAME
</code></pre>
<h2>DESCRIPTION</h2>
<p>SYNOPSIS</p>
<p>Using the key/value pairs populate the template(s) and render to stdout.</p>
<h2>OPTIONS</h2>
<p>Below are a set of options available.</p>
<pre><code> -code outout just code blocks for language, e.g. shell or json
-codesnip output just the code bocks
-examples display example(s)
-generate-manpage generate man page
-generate-markdown generate markdown documentation
-h, -help display help
-i, -input input filename
-l, -license display license
-o, -output output filename
-quiet suppress error messages
-v, -version display version
</code></pre>
<h2>EXAMPLES</h2>
<p>EXAMPLE</p>
<p>Template (named “examples/pongo/weather.tmpl”)</p>
<pre><code>Date: {{ now }}
Hello {{ name }},
The current weather is
{{ weatherForecast.data.weather.0 }}
Thank you
{{ signature }}
</code></pre>
<p>Render the template above (i.e. examples/pongo/weather.tmpl)
would be accomplished from the following data sources–</p>
<ul>
<li>“now” and “name” are strings</li>
<li>“weatherForecast.data.weather.0” is a data path inside the
JSON document retrieved from a URL, “.0” references the
“0”-th element of the array</li>
<li>“signature” comes from a file in our local disc
(i.e. examples/signature.txt)</li>
</ul>
<p>That would be expressed on the command line as follows</p>
<pre><code>mkpongo "now=text:$(date)" "name=text:Little Frieda" \
"weatherForecast=http://forecast.weather.gov/MapClick.php?lat=13.47190933300044&lon=144.74977715100056&FcstType=json" \
signature=examples/signature.txt \
examples/pongo/weather.tmpl
</code></pre>
<p>Pongo2 is a Django/Jinga2 inspired template langauge
implemeted in Go.</p>
<pre><code> https://github.com/flosch/pongo2
</code></pre>
</section>
<footer>
<span><h1><A href="http://caltech.edu">Caltech</a></h1></span>
<span>© 2020 <a href="https://www.library.caltech.edu/copyright">Caltech library</a></span>
<address>1200 E California Blvd, Mail Code 1-32, Pasadena, CA 91125-3200</address>
<span>Phone: <a href="tel:+1-626-395-3405">(626)395-3405</a></span>
<span><a href="mailto:[email protected]">Email Us</a></span>
<a class="cl-hide" href="sitemap.xml">Site Map</a>
</footer>
</body>
</html>