Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8 convert to jekyl #73

Open
wants to merge 9 commits into
base: gh-pages
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Bundle generated folders
.bundle
vendor/bundle

# Jekyll generated folders
_site
.sass-cache/
.jekyll-cache/
.jekyll-metadata
9 changes: 9 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

source "https://rubygems.org"

# gem "rails"

gem "jekyll", "~> 4.3"

gem "minima", "~> 2.5"
79 changes: 79 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.4)
public_suffix (>= 2.0.2, < 6.0)
colorator (1.1.0)
concurrent-ruby (1.2.2)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
eventmachine (1.2.7)
ffi (1.15.5)
forwardable-extended (2.6.0)
google-protobuf (3.23.2-x86_64-darwin)
http_parser.rb (0.8.0)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
jekyll (4.3.2)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (~> 1.0)
jekyll-sass-converter (>= 2.0, < 4.0)
jekyll-watch (~> 2.0)
kramdown (~> 2.3, >= 2.3.1)
kramdown-parser-gfm (~> 1.0)
liquid (~> 4.0)
mercenary (>= 0.3.6, < 0.5)
pathutil (~> 0.9)
rouge (>= 3.0, < 5.0)
safe_yaml (~> 1.0)
terminal-table (>= 1.8, < 4.0)
webrick (~> 1.7)
jekyll-feed (0.17.0)
jekyll (>= 3.7, < 5.0)
jekyll-sass-converter (3.0.0)
sass-embedded (~> 1.54)
jekyll-seo-tag (2.8.0)
jekyll (>= 3.8, < 5.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
kramdown (2.4.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.4)
listen (3.8.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0)
minima (2.5.1)
jekyll (>= 3.5, < 5.0)
jekyll-feed (~> 0.9)
jekyll-seo-tag (~> 2.1)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (5.0.1)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
rexml (3.2.5)
rouge (4.1.2)
safe_yaml (1.0.5)
sass-embedded (1.63.3-x86_64-darwin)
google-protobuf (~> 3.23)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
unicode-display_width (2.4.2)
webrick (1.8.1)

PLATFORMS
x86_64-darwin-22

DEPENDENCIES
jekyll (~> 4.3)
minima (~> 2.5)

BUNDLED WITH
2.3.26
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,28 @@
Documentation for the JSON Lines text file format

Visit https://jsonlines.org

## Development

### Jekyll installation

Follow steps:
- https://jekyllrb.com/docs/installation/
- https://jekyllrb.com/docs

### Bundle installation

```shell
bundle config set --local path 'vendor/bundle'
bundle install
```

### Build and serve the site

```shell
# just build the website
bundle exec jekyll build

# build and serve the website on default port
bundle exec jekyll serve
```
43 changes: 43 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Site settings
# These are used to personalize your new site. If you look in the HTML files,
# you will see them accessed via {{ site.title }}, {{ site.description }}, and so on.
#
# You can create any custom variable you would like, and they will be accessible
# in the templates via {{ site.myvariable }}.

title: JSON Lines
description: >-
This page describes the JSON Lines text format, also called newline-delimited JSON.
JSON Lines is a convenient format for storing structured data that may be processed
one record at a time. It works well with unix-style text processing tools and shell
pipelines. It's a great format for log files. It's also a flexible format for passing
messages between cooperating processes.
baseurl: "" # the subpath of your site, e.g. /blog
url: "https://jsonlines.org" # the base hostname & protocol for your site, e.g. http://example.com

# Build settings
theme: minima

# Disable warning related to https://sass-lang.com/d/slash-div
sass:
quiet_deps: true

# Exclude from processing.
# The following items will not be processed, by default.
# Any item listed under the `exclude:` key here will be automatically added to
# the internal "default list".
#
# Excluded items can be processed by explicitly listing the directories or
# their entries' file path in the `include:` list.
#
# exclude:
# - .sass-cache/
# - .jekyll-cache/
# - gemfiles/
# - Gemfile
# - Gemfile.lock
# - node_modules/
# - vendor/bundle/
# - vendor/cache/
# - vendor/gems/
# - vendor/ruby/
11 changes: 11 additions & 0 deletions _data/menu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
items:
- label: Home
url: '/'
- label: Examples
url: '/examples/'
- label: 'Validator'
url: '/validator/'
- label: 'On the web'
url: '/on_the_web/'
- label: 'json.org'
url: 'https://json.org'
5 changes: 5 additions & 0 deletions _includes/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<footer>
<a href="https://github.com/wardi/jsonlines/issues">Report a bug or make a suggestion</a> •
Tactile theme by <a href="https://twitter.com/jasonlong">Jason Long</a> •
This page is maintained by <a href="https://excess.org">Ian Ward</a> and <a href="https://www.linkedin.com/in/baptistepm/">Baptiste Pernet-Mugnier</a>.
</footer>
18 changes: 18 additions & 0 deletions _includes/head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Chivo:900">
<link rel="stylesheet" type="text/css" href="/stylesheets/stylesheet.css" media="screen">
<link rel="stylesheet" type="text/css" href="/stylesheets/pygment_trac.css" media="screen">
<link rel="stylesheet" type="text/css" href="/stylesheets/print.css" media="print">
{% for css in page.custom-css-list %}
<link rel="stylesheet" type="text/css" href="{{ css }}" >
{% endfor %}
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
{% for javascript in page.custom-javascript-list %}
<script src="{{ javascript }}"></script>
{% endfor %}
<title>{%if page.title != 'JSON Lines'%}JSON Lines | {% endif %}{{ page.title }}</title>
</head>
13 changes: 13 additions & 0 deletions _includes/menu.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<nav>
<ul>
{% for item in site.data.menu.items %}
<li>
{% if item.url == page.url %}
{{ item.label }}
{% else %}
<a href="{{ item.url }}">{{ item.label }}</a>
{% endif %}
</li>
{% endfor %}
</ul>
</nav>
19 changes: 19 additions & 0 deletions _layouts/default.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!doctype html>
<html lang="en">
{% include head.html %}
<body>
<div id="container">
<div class="inner">
<header>
<h1>JSON Lines</h1>
<h2>{% if page.subtitle %}{{ page.subtitle }}{% else %}{{ page.title }}{% endif %}</h2>
</header>
{% include menu.html %}
<hr>
<section id="main_content">
{{ content }}
</section>
{% include footer.html %}
</div>
</body>
</html>
66 changes: 11 additions & 55 deletions examples/index.html
Original file line number Diff line number Diff line change
@@ -1,39 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<link href='https://fonts.googleapis.com/css?family=Chivo:900' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="/stylesheets/stylesheet.css" media="screen" />
<link rel="stylesheet" type="text/css" href="/stylesheets/pygment_trac.css" media="screen" />
<link rel="stylesheet" type="text/css" href="/stylesheets/print.css" media="print" />
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<title>JSON Lines Examples</title>
</head>
---
layout: default
title: Examples
---
sp4ce marked this conversation as resolved.
Show resolved Hide resolved

<body>
<div id="container">
<div class="inner">

<header>
<h1>JSON Lines</h1>
<h2>Examples</h2>
</header>

<nav><ul>
<li><a href="/">Home</a></li>
<li>Examples</li>
<li><a href="/validator/">Validator</a></li>
<li><a href="/on_the_web/">On the web</a></li>
<li><a href="https://json.org/">json.org</a></li>
</ul></nav>

<hr>

<section id="main_content">
<h3>
<h3>
<a name="better-than-csv" class="anchor" href="#better-than-csv"><span class="octicon octicon-link"></span></a>Better than CSV</h3>

<div class="highlight"><pre><span class="p">[</span><span class="s2">"Name"</span><span class="p">,</span> <span class="s2">"Session"</span><span class="p">,</span> <span class="s2">"Score"</span><span class="p">,</span> <span class="s2">"Completed"</span><span class="p">]</span>
Expand All @@ -43,13 +13,13 @@ <h3>
<span class="p">[</span><span class="s2">"Deloise"</span><span class="p">,</span> <span class="s2">"2012A"</span><span class="p">,</span> <span class="mi">19</span><span class="p">,</span> <span class="kc">true</span><span class="p">]</span>
</pre></div>

<p>CSV seems so easy that many programmers have written code to generate it themselves, and almost every implementation is different. Handling broken CSV files is a common and frustrating task. CSV has no standard encoding, no standard column separator and multiple character escaping standards. String is the only type supported for cell values, so some programs attempt to guess the correct types.</p>
<p>CSV seems so easy that many programmers have written code to generate it themselves, and almost every implementation is different. Handling broken CSV files is a common and frustrating task. CSV has no standard encoding, no standard column separator and multiple character escaping standards. String is the only type supported for cell values, so some programs attempt to guess the correct types.</p>

<p>JSON Lines handles tabular data cleanly and without ambiguity. Cells may use the standard JSON types.</p>
<p>JSON Lines handles tabular data cleanly and without ambiguity. Cells may use the standard JSON types.</p>

<p>The biggest missing piece is an import/export filter for popular spreadsheet programs so that non-programmers can use this format.</p>
<p>The biggest missing piece is an import/export filter for popular spreadsheet programs so that non-programmers can use this format.</p>

<h3>
<h3>
<a name="easy-nested-data" class="anchor" href="#easy-nested-data"><span class="octicon octicon-link"></span></a>Easy Nested Data</h3>

<div class="highlight"><pre><span class="p">{</span><span class="nt">"name"</span><span class="p">:</span> <span class="s2">"Gilbert"</span><span class="p">,</span> <span class="nt">"wins"</span><span class="p">:</span> <span class="p">[[</span><span class="s2">"straight"</span><span class="p">,</span> <span class="s2">"7♣"</span><span class="p">],</span> <span class="p">[</span><span class="s2">"one pair"</span><span class="p">,</span> <span class="s2">"10♥"</span><span class="p">]]}</span>
Expand All @@ -58,11 +28,10 @@ <h3>
<span class="p">{</span><span class="nt">"name"</span><span class="p">:</span> <span class="s2">"Deloise"</span><span class="p">,</span> <span class="nt">"wins"</span><span class="p">:</span> <span class="p">[[</span><span class="s2">"three of a kind"</span><span class="p">,</span> <span class="s2">"5♣"</span><span class="p">]]}</span>
</pre></div>

</section>

<p>JSON Lines' biggest strength is in handling lots of similar nested data structures. One <code>.jsonl</code> file is easier to work with than a directory full of XML files.</p>
<p>JSON Lines' biggest strength is in handling lots of similar nested data structures. One <code>.jsonl</code> file is easier to work with than a directory full of XML files.</p>

<p>If you have large nested structures then reading the JSON Lines text directly isn't recommended. Use the "jq" tool to make viewing large structures easier:</p>
<p>If you have large nested structures then reading the JSON Lines text directly isn't recommended. Use the "jq" tool to make viewing large structures easier:</p>

<div class="highlight"><pre>grep pair winning_hands.jsonl | jq .
</pre></div>
Expand Down Expand Up @@ -95,16 +64,3 @@ <h3>
<span class="p">}</span>
</pre></div>
<hr>


<footer>
<a href="https://github.com/wardi/jsonlines/issues">Report a bug or make a suggestion</a> &bull;
Tactile theme by <a href="https://twitter.com/jasonlong">Jason Long</a> &bull;
This page is maintained by <a href="https://excess.org">Ian Ward</a>.
</footer>


</div>
</div>
</body>
</html>
Loading