--- /dev/null
+feed.title=The feed title
+feed.description=The description of the feed
+feed.link=http://wpitchoune.net/news/rss_2.0.xml
\ No newline at end of file
--- /dev/null
+#!/bin/bash
+
+java -classpath target/classes:lib/asciidoctorj-1.5.4.jar:lib/jruby-complete-1.7.21.jar:target/net.wpitchoune.asciidoctor-1.0.jar:lib/rome-1.6.0.jar:lib/slf4j-api-1.7.6.jar:lib/slf4j-nop-1.7.6.jar:lib/jdom2-2.0.6.jar:lib/rome-utils-1.6.0.jar Main $*
--- /dev/null
+<project>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>net.wpitchoune.asciidoctor</artifactId>
+ <groupId>net.wpitchoune.net</groupId>
+ <packaging>jar</packaging>
+ <name>asciidoctor</name>
+ <version>1.0</version>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.asciidoctor</groupId>
+ <artifactId>asciidoctorj</artifactId>
+ <version>1.5.4</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.rometools</groupId>
+ <artifactId>rome</artifactId>
+ <version>1.6.0</version>
+ </dependency>
+
+ </dependencies>
+</project>
--- /dev/null
+import java.io.*;
+import java.util.*;
+
+import org.asciidoctor.Asciidoctor;
+import org.asciidoctor.Asciidoctor.Factory;
+import org.asciidoctor.Options;
+import org.asciidoctor.ast.DocumentHeader;
+
+import com.rometools.rome.feed.synd.*;
+import com.rometools.rome.io.FeedException;
+import com.rometools.rome.io.SyndFeedOutput;
+
+public class Main {
+ private static File toHTMLFile(File dir, File adoc) {
+ int idx;
+ String name;
+
+ name = adoc.getName();
+
+ idx = name.lastIndexOf('.');
+
+ if (idx >= 0)
+ name = name.substring(0, idx);
+
+ return new File(dir, name + ".html");
+ }
+
+ public static void main(String[] args) throws FileNotFoundException, IOException, FeedException {
+ File inDir, html, outDir;
+ File[] adocs;
+ StringWriter sw;
+ Asciidoctor asciidoctor;
+ Options opts;
+ SyndFeed feed;
+ Properties props;
+ ArrayList<SyndEntry> entries;
+ SyndEntryImpl e;
+ InputStream in;
+ DocumentHeader h;
+ SyndContentImpl c;
+
+ inDir = new File(args[0]);
+ outDir = new File(args[1]);
+
+ props = new Properties();
+ in = new FileInputStream(args[2]);
+ props.load(in);
+ in.close();
+
+ adocs = inDir.listFiles();
+
+ asciidoctor = Factory.create();
+
+ feed = new SyndFeedImpl();
+ feed.setTitle(props.getProperty("feed.title"));
+ feed.setDescription(props.getProperty("feed.description"));
+ feed.setLink(props.getProperty("feed.link"));
+
+ entries = new ArrayList<SyndEntry>();
+
+ for (File adoc: adocs) {
+ if (!adoc.getName().endsWith(".adoc"))
+ continue;
+
+ sw = new StringWriter();
+
+ html = toHTMLFile(outDir, adoc);
+ System.out.println(adoc + " => " + html);
+
+ opts = new Options();
+ opts.setToFile(html.getAbsolutePath());
+
+ asciidoctor.renderFile(adoc, opts);
+
+ h = asciidoctor.readDocumentHeader(adoc);
+
+ asciidoctor.convert(new FileReader(adoc), sw, Collections.emptyMap());
+
+ e = new SyndEntryImpl();
+ e.setTitle(h.getDocumentTitle().getMain());
+
+ c = new SyndContentImpl();
+ c.setType("text/html");
+ c.setValue(sw.toString());
+
+ e.setDescription(c);
+
+ entries.add(e);
+ }
+
+ feed.setEntries(entries);
+
+ feed.setFeedType("rss_2.0");
+ SyndFeedOutput output = new SyndFeedOutput();
+ System.out.println("" + output.outputString(feed));
+ }
+}
\ No newline at end of file
--- /dev/null
+= 2016/06/14 - Call for contributions for the translation of psensor
+:docinfo2:
+
+The version 1.2.0 of psensor is going to be released in the coming
+weeks. This release will include many changes which impact the
+translations. If you want to contribute to the translation of psensor
+it is now the good timeframe. See the
+link:/psensor/contribute.html[instructions].
--- /dev/null
+<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
+<script src="../nav.js"></script>
--- /dev/null
+= 2016/06/14 - New website
+
+After being bored with Wordpress for years, the link:http://wpitchoune.net[wpitchoune.net]
+website is changing. It is now based on link:http://asciidoctor.org[Asciidoctor] and
+a simple shell script to generate it.
+
+With the help of link:http://atom.io[Atom] and a couple of addons dedicated to
+Asciidoctor, it is easy and quick to write content. I am happy to no
+more have to worry about the painful admistration of Wordpress,
+upgrading it, taking care of security, spamming of comments and bot
+account creation, and backup of databases.
+
+If you want to know how the website is built, everything is on
+a GIT repository: http://git.wpitchoune.net/gitweb/?p=www.git.
+It is simple, really simple... but enough for my needs.
--- /dev/null
+../style.css
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="UTF-8">
+<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]-->
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
+<meta name="generator" content="Asciidoctor 1.5.4">
+<title>2016/06/14 - Call for contributions for the translation of psensor</title>
+<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700">
+<link rel="stylesheet" href="./asciidoctor.css">
+</head>
+<body class="article">
+<div id="header">
+<h1>2016/06/14 - Call for contributions for the translation of psensor</h1>
+</div>
+<div id="content">
+<div class="paragraph">
+<p>The version 1.2.0 of psensor is going to be released in the coming
+weeks. This release will include many changes which impact the
+translations. If you want to contribute to the translation of psensor
+it is now the good timeframe. See the
+<a href="/psensor/contribute.html">instructions</a>.</p>
+</div>
+</div>
+<div id="footer">
+<div id="footer-text">
+Last updated 2016-06-29 13:24:57 +02:00
+</div>
+</div>
+</body>
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="UTF-8">
+<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]-->
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
+<meta name="generator" content="Asciidoctor 1.5.4">
+<title>2016/06/14 - New website</title>
+<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700">
+<link rel="stylesheet" href="./asciidoctor.css">
+</head>
+<body class="article">
+<div id="header">
+<h1>2016/06/14 - New website</h1>
+</div>
+<div id="content">
+<div class="paragraph">
+<p>After being bored with Wordpress for years, the <a href="http://wpitchoune.net">wpitchoune.net</a>
+website is changing. It is now based on <a href="http://asciidoctor.org">Asciidoctor</a> and
+a simple shell script to generate it.</p>
+</div>
+<div class="paragraph">
+<p>With the help of <a href="http://atom.io">Atom</a> and a couple of addons dedicated to
+Asciidoctor, it is easy and quick to write content. I am happy to no
+more have to worry about the painful admistration of Wordpress,
+upgrading it, taking care of security, spamming of comments and bot
+account creation, and backup of databases.</p>
+</div>
+<div class="paragraph">
+<p>If you want to know how the website is built, everything is on
+a GIT repository: <a href="http://git.wpitchoune.net/gitweb/?p=www.git" class="bare">http://git.wpitchoune.net/gitweb/?p=www.git</a>.
+It is simple, really simple…​ but enough for my needs.</p>
+</div>
+</div>
+<div id="footer">
+<div id="footer-text">
+Last updated 2016-06-29 13:03:11 +02:00
+</div>
+</div>
+</body>
+</html>
\ No newline at end of file