чување 254ad89242f9c74a313d02a3d582eddc37919682
родитељ 393048404d0ac87cd460ff11ebace0cf803e8c1c
Аутор: Страхиња Радић <contact@strahinja.org>
Датум: Tue, 24 Nov 2020 13:00:38 +0100
Makefile: make view now opens index.html; slweb.in: New directive: {git-log}; index.css: tabs -> 4 spaces
Signed-off-by: Страхиња Радић <contact@strahinja.org>
Diffstat:
измењених датотека: 5, додавања: 48(+), брисања: 24(-)
diff --git a/Makefile b/Makefile
@@ -34,8 +34,8 @@ slweb: slweb.in
examples: ${EXAMPLE_PAGES_HTML}
-view: examples
- $(BROWSER) examples/basic/index.html
+view: index.html
+ $(BROWSER) index.html
doc: slweb.pdf slweb.1.gz
diff --git a/index.css b/index.css
@@ -1,62 +1,69 @@
html,
body
{
- font-family: "Noto Serif", "Times New Roman", serif;
- font-size: 12pt;
+ font-family: "Noto Serif", "Times New Roman", serif;
+ font-size: 12pt;
}
pre,
code
{
- font-family: "Noto Mono", "Courier New", "Courier", monospace;
- background-color: #eef;
+ font-family: "Noto Mono", "Courier New", "Courier", monospace;
+ background-color: #eef;
}
code
{
- padding: .5em 1em;
+ padding: .5em 1em;
}
pre
{
- padding: 1em;
- line-height: 1.2em;
- overflow-x: scroll;
+ padding: 1em;
+ line-height: 1.2em;
+ overflow-x: scroll;
}
main
{
- margin: 0 auto;
- max-width: 1024px;
+ margin: 0 auto;
+ max-width: 1024px;
}
h1
{
- font-size: 300%;
- font-style: oblique;
- color: #005;
+ font-size: 300%;
+ font-style: oblique;
+ color: #005;
}
p
{
- line-height: 1.7em;
- margin: 0;
- margin-bottom: 1em;
- padding: 0;
+ line-height: 1.7em;
+ margin: 0;
+ margin-bottom: 1em;
+ padding: 0;
+}
+
+#git-log
+{
+ font-family: "Noto Mono", "Courier New", "Courier", monospace;
+ font-size: 90%;
+ text-align: center;
}
#made-by
{
- font-size: 90%;
- padding: .5em 2em;
- text-align: center;
- background-color: #eef;
+ font-size: 90%;
+ padding: .5em 2em;
+ text-align: center;
+ background-color: #eef;
}
@media (max-width: 920px)
{
main
{
- max-width: auto;
+ max-width: auto;
}
}
diff --git a/index.html b/index.html
@@ -95,6 +95,11 @@ PARTICULAR PURPOSE. See the GNU General Public License for more details. </p>
<p>You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>. </p>
+<div id="git-log">
+index.slw b7bea71 2020-11-23 20:46:46 +0100 (Страхиња Радић) (tag: v0.2.2-beta)
+</div><!--git-log-->
+
+
<div id="made-by">
Generated by <a href="https://github.com/Strahinja/slweb">slweb</a>
© 2020 Strahinya Radich.
diff --git a/index.slw b/index.slw
@@ -79,6 +79,8 @@ PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>.
+{git-log}
+
{made-by}
{/main}
diff --git a/slweb.in b/slweb.in
@@ -120,6 +120,9 @@ function body()
-e "s/^{made-by}/$MADEBY/g" \
-e "s/\([^\\]\){made-by}/\1$MADEBY/g" \
-e 's/\\\({made-by}\)/\1/g' \
+ -e "s/^{git-log}/$GITLOG/g" \
+ -e "s/\([^\\]\){git-log}/\1$GITLOG/g" \
+ -e 's/\\\({git-log}\)/\1/g' \
-e 's/^{\([a-z-]\+\)}/<\1>/g' \
-e 's/\([^\\]\){\([a-z-]\+\)}/\1<\2>/g' \
-e 's/\\\({[a-z-]\+}\)/\1/g' \
@@ -165,6 +168,13 @@ Generated by <a href="https://github.com/Strahinja/slweb">slweb</a>
</div><!--made-by-->
EOT
)
+GITLOG=$(cat <<EOT | sed -e's/\//\\\//g' -e"s/\"/\\\\\"/g" | sed -z -e's/\n/\\n/g'
+<div id="git-log">
+$(git log --pretty=format:"$(basename $INFILE) %h %ci (%cn) %d" \
+ $INFILE 2>/dev/null || echo "(Not in a Git repository)")
+</div><!--git-log-->
+EOT
+)
while [ $# -gt 0 ]; do
case "$1" in