-
Notifications
You must be signed in to change notification settings - Fork 27
/
guide-templatize
executable file
·45 lines (31 loc) · 1.07 KB
/
guide-templatize
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
#!/usr/bin/env python3
import io
import sys
# read utf-8 content
content = io.TextIOWrapper(sys.stdin.buffer, encoding='utf-8').read()
# cut header
_, content = content.split('<div class="toc">', 1)
# cut end
content, _ = content.split('</body>')
# format output
out = '''
{% extends "section_docs_guide.html" %}}
{% block title %}Packaging Guide{% endblock %}
{% block content %}
<ol class="breadcrumb">
<li><a href="/en/">Home</a></li>
<li><a href="/en/docs/">Docs & Guides</a></li>
<li class="active">Packaging Guide</li>
</ol>
<h1>Packaging Guide</h1>
<div class="para">
The Packaging Guide provides an explanation of Software Collections and
details how to build and package them. Developers and system administrators
who have a basic understanding of software packaging with RPM packages, but
who are new to the concept of Software Collections, can use this Guide to
get started with Software Collections.
</div>
<div class="toc">''' + content + '''
{% endblock %}'''
# print output
io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8').write(out)