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 have a website based only on Asciidoctor
18 documents, I have written a small utility which
19 converts a set of Asciidoctor documents to HTML pages and
20 generates a RSS 2.0 feed.</p>
25 <h2 id="_installation_of_asciidoctor_to_rss">Installation of asciidoctor_to_rss</h2>
26 <div class="sectionbody">
27 <div class="paragraph">
28 <p>It is required to install:</p>
40 <div class="paragraph">
41 <p>The sources can be retrieved from GIT:</p>
43 <div class="listingblock">
45 <pre>git clone git clone https://git.wpitchoune.net/asciidoctor_to_rss.git</pre>
48 <div class="paragraph">
51 <div class="listingblock">
53 <pre>cd asciidoctor_to_rss
54 mvn clean install</pre>
60 <h2 id="_howto_write_news">Howto write news</h2>
61 <div class="sectionbody">
62 <div class="paragraph">
63 <p>Each news has to be written in a separate Asciidoctor document
64 and all documents must be dropped into a directory.</p>
66 <div class="paragraph">
67 <p>There is not any restriction concerning the syntax because
68 the utility is based on the java bridge of Asciidoctor.
69 I have added an attribute 'date' which allows the utility
70 to know the publication date of the news.</p>
72 <div class="paragraph">
73 <p>You can see some examples at <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> .
74 The source document of this news is at <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>
79 <h2 id="_configuration">Configuration</h2>
80 <div class="sectionbody">
81 <div class="paragraph">
82 <p>The configuration of the utility can be done in text file.</p>
84 <div class="paragraph">
85 <p>See an example at <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>
90 <h2 id="_run_the_utility">Run the utility</h2>
91 <div class="sectionbody">
92 <div class="paragraph">
93 <p>The command line usage is:</p>
95 <div class="listingblock">
97 <pre>asciidoctor_to_rss.sh <IN_DIR> <OUT_DIR> <CFG_FILE></pre>
100 <div class="paragraph">
101 <p><code>IN_DIR</code>: the directory containing the news as Asciidoctor documents.</p>
103 <div class="paragraph">
104 <p><code>OUT_DIR</code>: the output directory which contains all generated files</p>
106 <div class="paragraph">
107 <p><code>CFG_FILE</code>: the path to the configuration file</p>
109 <div class="paragraph">
110 <p>The <code>OUT_DIR</code> will contain:</p>
115 <p>one HTML file for each Asciidoctor document</p>
118 <p>the <code>news.html</code> file</p>
121 <p>the <code>feed.xml</code> file which is a feed compatible with RSS v2.0.</p>