Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
s17t committed Nov 12, 2013
2 parents 054f8ec + 328acce commit 6052407
Show file tree
Hide file tree
Showing 12 changed files with 108 additions and 212 deletions.
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
language: java

jdk:
- openjdk6
- openjdk7
- oraclejdk7
- oraclejdk7

after_success:
- mvn jacoco:report coveralls:jacoco
67 changes: 67 additions & 0 deletions README.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
= JBake
Jonathan Bullock
2013-10-20
:idprefix:

http://jbake.org[JBake] is a Java based open source static site/blog generator for developers.

image::https://travis-ci.org/jonbullock/JBake.png?branch=master[Build Status, link="https://travis-ci.org/jonbullock/JBake"]

== Documentation

Full documentation is available on http://jbake.org/docs/[jbake.org].

== Maven

You can run directly from the source code using the Maven exec plugin:

----
mvn exec:java -Dexec.mainClass=org.jbake.launcher.Main -Dexec.args="/fromFolder /tmp/toFolder/"
----

== Contributing

Coming soon...

== Versioning

The project has adopted the http://semver.org[Semantic Versioning] spec from v2.2.0 onwards to maintain an
understandable backwards compatibility strategy.

The version format is as follows:

----
<major>.<minor>.<patch>-<label>
----

* An increment of the major version represents incompatible API changes.
* An increment of the minor version represents additional functionality in a backwards-compatible manner.
* An increment of the patch version represents backwards-compatible bug fixes.
* Existence of a label represents a pre-release or build metadata.

== Community

Talk to the developers behind JBake:

* http://groups.google.com/group/jbake-dev[Mailing list]
* link:irc://irc.freenode.net/#jbake[IRC - #jbake on Freenode]

Talk to other users of JBake on the forum:

* http://groups.google.com/group/jbake-user[Forum]

== Tools & Libraries Used

* http://commons.apache.org/[Apache Commons IO, Configuration, Lang & Logging]
* http://maven.apache.org/[Apache Maven]
* http://args4j.kohsuke.org/[Args4j]
* http://asciidoctor.org/[Asciidoctor]
* http://www.eclipse.org/[Eclipse IDE]
* http://freemarker.org/[Freemarker]
* http://junit.org/[JUnit]
* http://markdownj.org/[MarkdownJ]
* http://www.eclipse.org/jetty/[Jetty Server]

== Copyright & License

Licensed under the MIT License, see the LICENSE file.
193 changes: 0 additions & 193 deletions README.md

This file was deleted.

28 changes: 24 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
Expand All @@ -11,7 +10,7 @@

<groupId>org.jbake</groupId>
<artifactId>jbake-core</artifactId>
<version>2.2-SNAPSHOT</version>
<version>2.2.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>jbake</name>
Expand Down Expand Up @@ -139,7 +138,7 @@
<version>2.4</version>
<configuration>
<outputDirectory>dist</outputDirectory>
<finalName>${project.artifactId}-${project.version}</finalName>
<finalName>jbake-${project.version}</finalName>
<descriptors>
<descriptor>src/main/assembly/assembly.xml</descriptor>
</descriptors>
Expand All @@ -155,6 +154,27 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.6.3.201306030806</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eluder.coveralls</groupId>
<artifactId>coveralls-maven-plugin</artifactId>
<version>2.0.1</version>
<!-- <configuration>
<repoToken>yourcoverallsprojectrepositorytoken</repoToken>
</configuration> -->
</plugin>
</plugins>
<resources>
<resource>
Expand Down
2 changes: 1 addition & 1 deletion src/main/assembly/assembly.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<directory>${project.build.directory}</directory>
<outputDirectory></outputDirectory>
<includes>
<include>*.jar</include>
<include>jbake-core.jar</include>
</includes>
</fileSet>
<fileSet>
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/jbake/app/Crawler.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class Crawler {

private File source;
private CompositeConfiguration config;
private Parser parser;

private List<Map<String, Object>> pages = new ArrayList<Map<String, Object>>();
private List<Map<String, Object>> posts = new ArrayList<Map<String, Object>>();
Expand All @@ -37,6 +38,7 @@ public class Crawler {
public Crawler(File source, CompositeConfiguration config) {
this.source = source;
this.config = config;
this.parser = new Parser(config);
}

/**
Expand All @@ -45,7 +47,6 @@ public Crawler(File source, CompositeConfiguration config) {
* @param path Folder to start from
*/
public void crawl(File path) {
Parser parser = new Parser(config);
File[] contents = path.listFiles(FileUtil.getFileFilter());
if (contents != null) {
Arrays.sort(contents);
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/jbake/app/FileUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ public boolean accept(File pathname) {
|| pathname.getPath().endsWith(".html")
|| pathname.getPath().endsWith(".md")
|| pathname.getPath().endsWith(".asciidoc")
|| pathname.getPath().endsWith(".ad");
|| pathname.getPath().endsWith(".ad")
|| pathname.getPath().endsWith(".adoc");
}
};
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/jbake/app/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public Map<String, Object> processFile(File file) {
System.err.println("Error parsing meta data from header!");
return null;
}
} else if (file.getPath().endsWith(".asciidoc") || file.getPath().endsWith(".ad")) {
} else if (file.getPath().endsWith(".asciidoc") || file.getPath().endsWith(".ad") || file.getPath().endsWith(".adoc")) {
if (hasHeader) {
// process jbake header
processHeader(fileContents);
Expand Down Expand Up @@ -229,7 +229,7 @@ private void processAsciiDocHeader(File file) {
if (attributes.get(key) != null) {
content.put("type", attributes.get(key));
}
} else if (key.equals("docdate")) {
} else if (key.equals("revdate")) {
if (attributes.get(key) != null && attributes.get(key) instanceof String) {

DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
Expand Down Expand Up @@ -278,7 +278,7 @@ private void processBody(List<String> contents, File file) {
if (file.getPath().endsWith(".md")) {
MarkdownProcessor markdown = new MarkdownProcessor();
content.put("body", markdown.markdown(body.toString()));
} else if (file.getPath().endsWith(".ad") || file.getPath().endsWith(".asciidoc")) {
} else if (file.getPath().endsWith(".ad") || file.getPath().endsWith(".asciidoc") || file.getPath().endsWith(".adoc")) {
processAsciiDoc(body);
} else {
content.put("body", body.toString());
Expand Down
Loading

0 comments on commit 6052407

Please sign in to comment.