summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorStephen Dolan <mu@netsoc.tcd.ie>2013-05-11 15:21:23 +0100
committerStephen Dolan <mu@netsoc.tcd.ie>2013-05-11 15:21:23 +0100
commit7ca5127fcc74ec2c58c1ad01de57d1c5ec00b827 (patch)
tree07985ebf2a44abb7dd0193e7a48e5c141f8004c4 /docs
parent7813f363a20817c8b0429f53e4740d6ed852e527 (diff)
parent4b1b9c219a37488e4b113e87216da121671b2297 (diff)
Merge branch 'autotools'
Diffstat (limited to 'docs')
-rw-r--r--docs/README.md25
-rw-r--r--docs/Rakefile35
-rw-r--r--docs/content/3.manual/manual.yml4
-rw-r--r--docs/default_manpage.md22
-rw-r--r--docs/site.yml6
5 files changed, 89 insertions, 3 deletions
diff --git a/docs/README.md b/docs/README.md
new file mode 100644
index 00000000..58e7dca7
--- /dev/null
+++ b/docs/README.md
@@ -0,0 +1,25 @@
+Documentation
+=============
+
+The jq website, manpages and some of the tests are generated from this
+directory. The directory holds a [Bonsai](http://tinytree.info)
+website, and the manual is a YAML file in `content/3.manual`.
+
+To build the documentation (including building the jq manpage), you'll
+need a working Ruby setup. The easiest way to get one is to install
+RVM and Ruby 1.9.3 like so:
+
+ \curl -L https://get.rvm.io | bash -s stable --ruby=1.9.3
+
+After that finishes installing, you'll need to make sure RVM is on
+your path by doing `source $HOME/.rvm/scripts/rvm`, or just opening a
+new shell. See <http://rvm.io> for more info on RVM.
+
+Once RVM is installed, you can install all the dependencies for jq's
+documentation build by running this from the `docs` directory:
+
+ bundle install
+
+When bundle manages to install the dependencies, rerun `./configure`
+in the jq root directory and then the Makefile will be able to
+generate the jq manpage.
diff --git a/docs/Rakefile b/docs/Rakefile
index 2d7b2fe8..4ca5752f 100644
--- a/docs/Rakefile
+++ b/docs/Rakefile
@@ -1,3 +1,4 @@
+require 'yaml'
require 'bonsai'
require 'liquid'
require 'maruku'
@@ -63,6 +64,28 @@ task :build do
Bonsai::Exporter.publish!
end
+$BINARIES = {
+ :osx32 => "--host=i686-apple-darwin10 CFLAGS='-m32 -g -O'",
+ :osx64 => "--host=i686-apple-darwin10 CFLAGS='-m64 -g -O'",
+ :win32 => "--host=i686-w64-mingw32 CFLAGS='-g -O'",
+ :win64 => "--host=x86_64-w64-mingw32 CFLAGS='-g -O'",
+ :linux32 => "--host=x86_64-linux-gnu CFLAGS='-m32 -g -O'",
+ :linux64 => "--host=x86_64-linux-gnu CFLAGS='-m64 -g -O'"
+}
+
+$BINARIES.each do |name, args|
+ file "../build/#{name}" do |t|
+ sh "MAKEFLAGS=-j4 ../scripts/crosscompile #{name} #{args}"
+ end
+ task :binaries => ["../build/#{name}"]
+end
+
+task :binaries => ["output/download"] do
+ $BINARIES.each do |name, args|
+ FileUtils.cp_r "../build/#{name}", "output/download/"
+ end
+end
+
def load_manual
YAML::ENGINE.yamler = 'syck'
YAML::load(File.open("content/3.manual/manual.yml"))
@@ -97,6 +120,10 @@ task :manpage do
end
end
+task :manpage_default => ["default_manpage.md"] do
+ puts Ronn::Document.new("default_manpage.md").convert('roff').gsub(/<\/?code>/,"")
+end
+
task :mantests do
load_manual['sections'].each do |section|
(section['entries'] || []).each do |entry|
@@ -109,3 +136,11 @@ task :mantests do
end
end
end
+
+directory "output/download/source"
+task :tarball => ["output/download/source"] do
+ sh "cd ..; ./configure && make dist && make distclean"
+ sh "cp ../jq-*.tar.gz output/download/source"
+end
+
+task :dist => [:build, :binaries, :tarball]
diff --git a/docs/content/3.manual/manual.yml b/docs/content/3.manual/manual.yml
index 01defbd8..2f36392c 100644
--- a/docs/content/3.manual/manual.yml
+++ b/docs/content/3.manual/manual.yml
@@ -166,7 +166,7 @@ sections:
You can also look up fields of an object using syntax like
`.["foo"]` (.foo above is a shorthand version of this). This
one works for arrays as well, if the key is an
- integer. Arrays are zero-based (like javascript), so .[2]
+ integer. Arrays are zero-based (like javascript), so `.[2]`
returns the third element of the array.
examples:
@@ -271,7 +271,7 @@ sections:
filter into an array (as in `[.items[].name]`)
Once you understand the "," operator, you can look at jq's array
- syntax in a different light: the expression [1,2,3] is not using a
+ syntax in a different light: the expression `[1,2,3]` is not using a
built-in syntax for comma-separated arrays, but is instead applying
the `[]` operator (collect results) to the expression 1,2,3 (which
produces three different results).
diff --git a/docs/default_manpage.md b/docs/default_manpage.md
new file mode 100644
index 00000000..f1a29a72
--- /dev/null
+++ b/docs/default_manpage.md
@@ -0,0 +1,22 @@
+jq(1) -- Command-line JSON processor
+====================================
+
+## DESCRIPTION
+
+`jq` can transform JSON in various ways, by selecting, iterating,
+reducing and otherwise mangling JSON documents.
+
+This version of `jq` was built without a manual, so this manpage is a
+stub. For full documentation of the `jq` language, see:
+
+ http://stedolan.github.com/jq
+
+## BUGS
+
+Presumably. Report them or discuss them at:
+
+ https://github.com/stedolan/jq/issues
+
+## AUTHOR
+
+Stephen Dolan `<mu@netsoc.tcd.ie>`
diff --git a/docs/site.yml b/docs/site.yml
index 863d578d..37f82cf3 100644
--- a/docs/site.yml
+++ b/docs/site.yml
@@ -1,7 +1,11 @@
# The key value pairs found below are available within the templates.
+:url: http://stedolan.github.io/jq
+# This line is modified by the Makefile. To change the version number,
+# edit the Autoconf version number at the top of configure.ac
jq_version: 1.2
+
root: '/jq'
footer: |
@@ -11,4 +15,4 @@ footer: |
jq is licensed under the MIT license (code) and the
[CC-BY-3.0](http://creativecommons.org/licenses/by/3.0/) license
- (docs). \ No newline at end of file
+ (docs).