Skip to content

Commit

Permalink
Change markdown processor to Kramdown
Browse files Browse the repository at this point in the history
Change markdown processor from Redcarpet to Kramdown due to
https://github.com/blog/2100-github-pages-now-faster-and-simpler-with-jekyll-3-0

> Starting May 1st, 2016, GitHub Pages will only support kramdown, Jekyll's default Markdown engine.
  • Loading branch information
kshchepanovskyi committed Feb 13, 2016
1 parent 022e24d commit aa5e4c2
Show file tree
Hide file tree
Showing 32 changed files with 337 additions and 312 deletions.
10 changes: 7 additions & 3 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,13 @@ permalink: /:title
#paginate: 3

highlighter: rouge
markdown: redcarpet
redcarpet:
extensions: ["no_intra_emphasis", "fenced_code_blocks", "autolink", "tables", "with_toc_data"]
markdown: kramdown

kramdown:
input: GFM

#redcarpet:
# extensions: ["no_intra_emphasis", "fenced_code_blocks", "autolink", "tables", "with_toc_data"]

exclude: ['README.md', 'LICENSE']

Expand Down
1 change: 1 addition & 0 deletions _includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<meta charset="UTF-8">
<title>{{ site.name }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script>
<script src="{{ site.baseurl }}/js/jquery.min.js"></script>
<script src="{{ site.baseurl }}/js/bootstrap.min.js"></script>
<link href="{{ site.baseurl }}/css/bootstrap.min.css" rel="stylesheet">
Expand Down
2 changes: 1 addition & 1 deletion _posts/2015-04-20-Release-1.3.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ date: 2015-04-20 00:00:00
categories: release
---

https://github.com/protostuff/protostuff/releases/tag/protostuff-1.3.5
Release notes: <https://github.com/protostuff/protostuff/releases/tag/protostuff-1.3.5>
2 changes: 1 addition & 1 deletion _posts/2015-08-07-Release-1.3.6.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ date: 2015-08-07 00:00:00
categories: release
---

https://github.com/protostuff/protostuff/releases/tag/protostuff-1.3.6
Release notes: <https://github.com/protostuff/protostuff/releases/tag/protostuff-1.3.6>
2 changes: 1 addition & 1 deletion _posts/2015-10-06-Release-1.3.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ date: 2015-10-06 00:00:00
categories: release
---

https://github.com/protostuff/protostuff/releases/tag/protostuff-1.3.7
Release notes: <https://github.com/protostuff/protostuff/releases/tag/protostuff-1.3.7>
2 changes: 1 addition & 1 deletion _posts/2015-11-20-Release-1.3.8.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ date: 2015-11-20 00:00:00
categories: release
---

https://github.com/protostuff/protostuff/releases/tag/protostuff-1.3.8
Release notes: <https://github.com/protostuff/protostuff/releases/tag/protostuff-1.3.8>
12 changes: 6 additions & 6 deletions documentation/compiler-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ does not disable the option - remove the entry instead to disable.

In maven, you would declare the key:value as:

```xml
~~~xml
<property>
<name>Foo.implements_declaration</name> <!-- key -->
<value>implements com.example.Bar</value> <!-- value -->
</property>
```
~~~

# All generators

Expand All @@ -40,10 +40,10 @@ to json output with its field names.
`generate_field_map` - generates a mapping between the field number and field name.
If on, you can serialize json encoded messages writing either its field name or field number.

```java
~~~java
boolean numeric = false;
JsonIOUtil.writeTo(out, message, numeric);
```
~~~

`generate_pipe_schema` - generates a pipe schema for transcoding an input to a different output.

Expand Down Expand Up @@ -92,10 +92,10 @@ implement the given interface. Note that gwt overlays can implement interfaces i
`generate_field_map` - generates a mapping between the field number and field name.
If on, you can serialize json encoded messages writing either its field name or field number.

```java
~~~java
boolean numeric = false;
JsonIOUtil.writeTo(out, message, numeric);
```
~~~

`enums_by_name` - serialize enums using their name instead of their number.

Expand Down
22 changes: 21 additions & 1 deletion documentation/compiler/java-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,24 @@ title: Java Generated Code
permalink: /documentation/compiler/java/generated-code
---

TBD
1. TOC
{:toc}

## Compiler Invocation


## Packages

## Messages

## Fields

## Oneof

## Enumerations

## Extensions

Extensions are not supported.

## Services
8 changes: 4 additions & 4 deletions documentation/maven-bom.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ To overcome such problems Maven supports [the concept of a "bill of materials" (
You can import the `protostuff-bom` in your `<dependencyManagement>` section to
ensure that all protostuff dependencies (both direct and **transitive**) are at the same version:

```xml
~~~xml
<dependencyManagement>
<dependencies>
<dependency>
Expand All @@ -26,12 +26,12 @@ ensure that all protostuff dependencies (both direct and **transitive**) are at
</dependency>
</dependencies>
</dependencyManagement>
```
~~~

An added benefit of using the BOM is that you no longer need to specify the `<version>` attribute
when depending on protostuff artifacts:

```xml
~~~xml
<dependencies>
<dependency>
<groupId>io.protostuff</groupId>
Expand All @@ -42,5 +42,5 @@ when depending on protostuff artifacts:
<artifactId>protostuff-core</artifactId>
</dependency>
<dependencies>
```
~~~

20 changes: 10 additions & 10 deletions documentation/maven-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ of the plugin.

The following default directory structure of the project is assumed:

```
~~~
<project root>
├───pom.xml
└───src
└───main
└───proto
└───foo.proto
```
~~~

Protocol buffer definitions location is configurable, but we recommend to use `src/main/proto/` directory.
Any subdirectories under `src/main/proto/` are treated as package structure for protobuf definition imports.
Expand All @@ -29,7 +29,7 @@ Any subdirectories under `src/main/proto/` are treated as package structure for

Minimal configuration:

```xml
~~~xml
<?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"
Expand Down Expand Up @@ -77,25 +77,25 @@ Minimal configuration:
</build>

</project>
```
~~~

### Code Generation

If you configured `protostuff-maven-plugin` as described above, then sources are generated automatically each time
when you build project.

```
~~~
$ mvn clean install
```
~~~

You can explicitly invoke the plugin via:

```
~~~
$ mvn protostuff:compile
```
~~~

You can skip the compilation by specifying the property:

```
~~~
-Dprotostuff.compiler.skip=true
```
~~~
20 changes: 10 additions & 10 deletions documentation/object-graphs.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Limitations:

Example:

```proto
~~~proto
message ClubFounder {
optional string name = 1;
optional Club club = 2;
Expand All @@ -33,21 +33,21 @@ message Student {
optional string name = 1;
repeated Club club = 2;
}
```
~~~

You cannot directly serialize Club since it can potentially have a reference to itself.

The solution is to wrap the target message.

```proto
~~~proto
message ClubWrapper {
optional Club club = 1;
}
```
~~~

On the other hand, you can serialize ClubFounder.

```java
~~~java
Schema<ClubFounder> schema = RuntimeSchema.getSchema(ClubFounder.class);
ClubFounder founder = new ClubFounder();

Expand All @@ -59,26 +59,26 @@ ClubFounder cf = new ClubFounder();
GraphIOUtil.mergeFrom(data, cf, schema);

// check if cf retains the graph
```
~~~

For a more complex example, take a look at [PolymorphicRuntimeGraphTest.java](http://code.google.com/p/protostuff/source/browse/trunk/protostuff-runtime/src/test/java/com/dyuproject/protostuff/runtime/PolymorphicRuntimeGraphTest.java)

Note that if you have collection fields that can potentially be cyclic, you need to enable the system property below:

```
~~~
-Dprotostuff.runtime.collection_schema_on_repeated_fields=true
```
~~~

E.g

```java
~~~java
class Foo
{
List<Bar> barList;
List<Baz> anotherBarList; // if this points to barList, it will be cyclic.

}
```
~~~

Doing so treats the collection field as a standalone message (which is handled on cyclic graph serialization).

Expand Down
12 changes: 6 additions & 6 deletions documentation/pipes.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ encoding to another.

Here's the normal approach:

```java
~~~java
InputStream protobufInputStream;

// deserialize
Expand All @@ -25,18 +25,18 @@ ProtobufIOUtil.mergeFrom(protobufInputStream, foo, Foo.getSchema(), inBuf);
// write to json
LinkedBuffer buffer = ...;
JsonIOUtil.writeTo(outputStream, foo, Foo.getSchema(), false, buffer);
```
~~~

Here's the code using pipes:

```java
~~~java
InputStream protobufInputStream;

// transcode the protobuf encoding to json encoding
LinkedBuffer buffer = ...;
Pipe pipe = ProtobufIOUtil.newPipe(protobufInputStream);
JsonIOUtil.writeTo(outputStream, pipe, Foo.getPipeSchema(), false, buffer);
```
~~~

Note that for generated message, you need to enable the `generate_pipe_schema` option
(see [compiler options](/documentation/compiler-options#java_bean)). A static method
Expand All @@ -45,7 +45,7 @@ Note that for generated message, you need to enable the `generate_pipe_schema` o
For runtime objects, pipes are also supported. The schema of a runtime object is an instance of
`MappedSchema<T>`, which has a `getPipeSchema()` method.

```java
~~~java
// protostuff byte array from cache or datastore
byte[] protostuffData = ...;
MappedSchema<Foo> schema = (MappedSchema<Foo>)RuntimeSchema.getSchema(Foo.class);
Expand All @@ -54,4 +54,4 @@ MappedSchema<Foo> schema = (MappedSchema<Foo>)RuntimeSchema.getSchema(Foo.class)
LinkedBuffer buffer = ...;
Pipe pipe = ProtostuffIOUtil.newPipe(protostuffData, 0, protostuffData.length);
JsonIOUtil.writeTo(outputStream, pipe, schema.getPipeSchema(), true, buffer);
```
~~~
12 changes: 6 additions & 6 deletions documentation/runtime-schema-delegate.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ If you use different `IdStrategy`, then use one of:

Here's an example for 1 or 2.

```java
~~~java
public static final class Singleton
{
public static final Singleton INSTANCE = new Singleton();
Expand Down Expand Up @@ -76,11 +76,11 @@ public static final Delegate<Singleton> SINGLETON_DELEGATE =
output.writeUInt32(number, input.readUInt32(), repeated);
}
};
```
~~~

Here's an example for 3 or 4.

```java
~~~java
public static final Delegate<UUID> UUID_DELEGATE = new Delegate<UUID>()
{

Expand Down Expand Up @@ -153,11 +153,11 @@ static void writeInt64(final long value, final byte[] buffer, int offset)
buffer[offset++] = (byte)(value >>> 8);
buffer[offset] = (byte)(value >>> 0);
}
```
~~~

Here's an example for 5.

```java
~~~java
public static final Delegate<short[]> SHORT_ARRAY_DELEGATE = new Delegate<short[]>()
{
public Class<?> typeClass()
Expand Down Expand Up @@ -202,4 +202,4 @@ public static final Delegate<short[]> SHORT_ARRAY_DELEGATE = new Delegate<short[
input.transferByteRangeTo(output, false, number, repeated);
}
};
```
~~~
Loading

0 comments on commit aa5e4c2

Please sign in to comment.