4 <link rel="stylesheet" href="https://wpitchoune.net/style.css">
5 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css">
6 <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
7 <script src="https://wpitchoune.net/nav.js"></script>
8 <title>Asciidoctor to RSS</title>
12 <h1>Asciidoctor to RSS</h1>
13 </div><div id='content'>
14 <div class='date'>2016-11-07</div><div id="preamble">
15 <div class="sectionbody">
16 <div class="paragraph">
17 <p>In order to ease the edition of this website and
18 the management of the server, I want it to be purely
19 static and generated from <a href="http://asciidoctor.org">Asciidoctor</a> documents.</p>
21 <div class="paragraph">
22 <p>The <em>news</em> part of the website is also written as Asciidoctor
23 documents, <code>asciidoctor_to_rss</code> is converting them into static
24 HTML pages and generates a RSS 2.0 file.</p>
29 <h2 id="_installation_of_asciidoctor_to_rss">Installation of asciidoctor_to_rss</h2>
30 <div class="sectionbody">
31 <div class="paragraph">
32 <p>It is required to install:</p>
37 <p><a href="http://maven.apache.org/download.cgi">Apache Maven</a> (3.3.9)</p>
40 <p><a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html">Java</a> (Sun JDK >=1.8)</p>
44 <div class="paragraph">
45 <p>The sources can be retrieved from GIT:</p>
47 <div class="listingblock">
49 <pre>git clone git clone https://git.wpitchoune.net/asciidoctor_to_rss.git</pre>
52 <div class="paragraph">
55 <div class="listingblock">
57 <pre>cd asciidoctor_to_rss
58 mvn clean install</pre>
64 <h2 id="_howto_write_news">Howto write news</h2>
65 <div class="sectionbody">
66 <div class="paragraph">
67 <p>Each <em>news</em> must be written in an <a href="http://asciidoctor.org">Asciidoctor</a> document
68 and all documents must be dropped into a directory.</p>
70 <div class="paragraph">
71 <p>There is not any restriction concerning the syntax because
72 the utility is based on the Java bridge of Asciidoctor.
73 I have added an attribute <code>date</code> which allows the utility
74 to know the publication date of the news.</p>
76 <div class="paragraph">
77 <p>Here is an example of <em>news</em>:</p>
79 <div class="listingblock">
81 <pre class="highlight"><code class="language-asciidoc" data-lang="asciidoc">= Asciidoctor to RSS
82 Jean-Philippe Orsini <jeanfi@gmail.com>
86 In order to ease the edition of this website and
87 the management of the server, I want it to be purely
88 static and generated from http://asciidoctor.org[Asciidoctor] documents.
90 The _news_ part of the website is also written as Asciidoctor
91 documents, `asciidoctor_to_rss` is converting them into static
92 HTML pages and generates a RSS 2.0 file.
94 == Installation of asciidoctor_to_rss
96 It is required to install:
98 * http://maven.apache.org/download.cgi[Apache Maven] (3.3.9)
100 * http://www.oracle.com/technetwork/java/javase/downloads/index.html[Java] (Sun JDK >=1.8)</code></pre>
103 <div class="paragraph">
104 <p>You can see few examples at
105 <a href="https://wpitchoune.net/gitweb/?p=www.git;a=tree;f=src/news;hb=HEAD" class="bare">https://wpitchoune.net/gitweb/?p=www.git;a=tree;f=src/news;hb=HEAD</a>.
106 The source document of this <em>news</em> is at
107 <a href="https://wpitchoune.net/gitweb/?p=www.git;a=blob;f=src/news/asciidoctor_to_rss.adoc;hb=HEAD" class="bare">https://wpitchoune.net/gitweb/?p=www.git;a=blob;f=src/news/asciidoctor_to_rss.adoc;hb=HEAD</a>.</p>
112 <h2 id="_configuration">Configuration</h2>
113 <div class="sectionbody">
114 <div class="paragraph">
115 <p>The configuration file of <code>asciidoctor_to_rss</code> is text file containing key/value pairs.</p>
117 <div class="paragraph">
119 <a href="https://wpitchoune.net/gitweb/?p=www.git;a=blob;f=src/asciidoctorrss.props;hb=HEAD" class="bare">https://wpitchoune.net/gitweb/?p=www.git;a=blob;f=src/asciidoctorrss.props;hb=HEAD</a> .</p>
121 <div class="listingblock">
122 <div class="content">
123 <pre class="highlight"><code class="language-text" data-lang="text">feed.title=News
124 feed.description=News of the wpitchoune.net website.
125 feed.link=https://wpitchoune.net/news/feed.xml
126 feed.baseurl=https://wpitchoune.net/news
128 html.header.file=src/header.html</code></pre>
131 <div class="paragraph">
132 <p><code>feed.title</code>: the title used for the feed, in the RSS 2.0 and <code>news.html</code> files.</p>
134 <div class="paragraph">
135 <p><code>feed.description</code>: the description used in the RSS 2.0 file.</p>
137 <div class="paragraph">
138 <p><code>feed.link</code>: URI of the RSS 2.0 file.</p>
140 <div class="paragraph">
141 <p><code>feed.baseurl</code>: base URI where the HTML news files will be located.</p>
143 <div class="paragraph">
144 <p><code>html.header.file</code>: the content of the denoted file will be added in the <code>head</code> block of
145 the generated HTML documents.</p>
150 <h2 id="_run_the_utility">Run the utility</h2>
151 <div class="sectionbody">
152 <div class="paragraph">
153 <p>The command line usage is:</p>
155 <div class="listingblock">
156 <div class="content">
157 <pre>asciidoctor_to_rss.sh <IN_DIR> <OUT_DIR> <CFG_FILE></pre>
160 <div class="paragraph">
161 <p><code>IN_DIR</code>: the directory containing the news as Asciidoctor documents.</p>
163 <div class="paragraph">
164 <p><code>OUT_DIR</code>: the output directory which contains all generated files.</p>
166 <div class="paragraph">
167 <p><code>CFG_FILE</code>: the path to the configuration file.</p>
169 <div class="paragraph">
170 <p>The <code>OUT_DIR</code> will contain:</p>
175 <p>one HTML file for each Asciidoctor document,</p>
178 <p>the <a href="https://wpitchoune.net/news/news.html"><code>news.html</code></a> file,</p>
181 <p>and the <a href="https://wpitchoune.net/news/news.html"><code>feed.xml</code></a> file which is a feed
182 compatible with RSS v2.0.</p>