]> git.mdlowis.com Git - projs/tide.git/commitdiff
updated docs and generation
authorMichael D. Lowis <mike@mdlowis.com>
Fri, 21 Feb 2020 03:50:53 +0000 (22:50 -0500)
committerMichael D. Lowis <mike@mdlowis.com>
Fri, 21 Feb 2020 03:50:53 +0000 (22:50 -0500)
14 files changed:
README.adoc
src/edit.1.adoc [new file with mode: 0644]
src/edit.adoc [deleted file]
src/fetch.1.adoc [new file with mode: 0644]
src/fetch.adoc [deleted file]
src/fetchsel.1.adoc [new file with mode: 0644]
src/fetchsel.adoc [deleted file]
src/pick.1.adoc [new file with mode: 0644]
src/pick.adoc [deleted file]
src/registrar.1.adoc [new file with mode: 0644]
src/registrar.adoc [deleted file]
src/tide.1.adoc
src/tide.adoc [deleted file]
tools/docgen

index 17e3ca81b1b699741e898e48e5c81805b290ba69..735064b587e11191f4953a369a41870de4836150 100644 (file)
@@ -31,7 +31,7 @@ make install
 
 [source,shell]
 ----
-edit file1 file 2 file3
+edit file1 file2 file3
 ----
 
 == System Overview
@@ -84,17 +84,17 @@ link:src/lib/libedit.html[libedit]
 |===
 | *Executable* | *Description*
 
-| link:src/edit.html[edit]
+| link:src/edit.1.html[edit]
     | Main executable used to open files for editing
-| link:src/fetch.html[fetch]
+| link:src/fetch.1.html[fetch]
     | Executes pattern matching rules on input text
-| link:src/fetch.html[fetchsel]
+| link:src/fetchsel.1.html[fetchsel]
     | Executes pattern matching rules on selected text
-| link:src/pick.html[pick]
+| link:src/pick.1.html[pick]
     | Performs fuzzy search on a set of strings
-| link:src/registrar.html[registrar]
+| link:src/registrar.1.html[registrar]
     | Tracks open windows and the files they contain
-| link:src/tide.html[tide]
+| link:src/tide.1.html[tide]
     | The main tide editor executable
 |===
 
diff --git a/src/edit.1.adoc b/src/edit.1.adoc
new file mode 100644 (file)
index 0000000..eedd942
--- /dev/null
@@ -0,0 +1,23 @@
+= edit(1)
+:doctype: manpage
+
+== NAME
+
+registrar - registry service for tracking open tide(1) windows
+
+== SYNOPSIS
+
+*registrar*
+
+== DESCRIPTION
+
+
+== OPTIONS
+
+
+== ENVIRONMENT
+
+
+== SEE ALSO
+
+registrar(1), tide(1), pick(1), fetch(1), fetchsel(1)
diff --git a/src/edit.adoc b/src/edit.adoc
deleted file mode 100644 (file)
index 3c63c70..0000000
+++ /dev/null
@@ -1 +0,0 @@
-@defgroup edit
diff --git a/src/fetch.1.adoc b/src/fetch.1.adoc
new file mode 100644 (file)
index 0000000..527e549
--- /dev/null
@@ -0,0 +1,23 @@
+= fetch(1)
+:doctype: manpage
+
+== NAME
+
+registrar - registry service for tracking open tide(1) windows
+
+== SYNOPSIS
+
+*registrar*
+
+== DESCRIPTION
+
+
+== OPTIONS
+
+
+== ENVIRONMENT
+
+
+== SEE ALSO
+
+registrar(1), tide(1), edit(1), pick(1), fetchsel(1)
\ No newline at end of file
diff --git a/src/fetch.adoc b/src/fetch.adoc
deleted file mode 100644 (file)
index fcc5664..0000000
+++ /dev/null
@@ -1 +0,0 @@
-@defgroup fetch
diff --git a/src/fetchsel.1.adoc b/src/fetchsel.1.adoc
new file mode 100644 (file)
index 0000000..71d6d9f
--- /dev/null
@@ -0,0 +1,23 @@
+= fetchsel(1)
+:doctype: manpage
+
+== NAME
+
+registrar - registry service for tracking open tide(1) windows
+
+== SYNOPSIS
+
+*registrar*
+
+== DESCRIPTION
+
+
+== OPTIONS
+
+
+== ENVIRONMENT
+
+
+== SEE ALSO
+
+registrar(1), tide(1), edit(1), pick(1), fetch(1)
\ No newline at end of file
diff --git a/src/fetchsel.adoc b/src/fetchsel.adoc
deleted file mode 100644 (file)
index bb77c33..0000000
+++ /dev/null
@@ -1 +0,0 @@
-@addtogroup fetch
diff --git a/src/pick.1.adoc b/src/pick.1.adoc
new file mode 100644 (file)
index 0000000..5532298
--- /dev/null
@@ -0,0 +1,23 @@
+= pick(1)
+:doctype: manpage
+
+== NAME
+
+registrar - registry service for tracking open tide(1) windows
+
+== SYNOPSIS
+
+*registrar*
+
+== DESCRIPTION
+
+
+== OPTIONS
+
+
+== ENVIRONMENT
+
+
+== SEE ALSO
+
+registrar(1), tide(1), edit(1), fetch(1), fetchsel(1)
\ No newline at end of file
diff --git a/src/pick.adoc b/src/pick.adoc
deleted file mode 100644 (file)
index dd065ba..0000000
+++ /dev/null
@@ -1 +0,0 @@
-= PICK COMMAND
\ No newline at end of file
diff --git a/src/registrar.1.adoc b/src/registrar.1.adoc
new file mode 100644 (file)
index 0000000..5b9b777
--- /dev/null
@@ -0,0 +1,17 @@
+= registrar(1)
+:doctype: manpage
+
+== NAME
+
+registrar - registry service for tracking open tide(1) windows
+
+== SYNOPSIS
+
+*registrar*
+
+== DESCRIPTION
+
+
+== SEE ALSO
+
+tide(1), edit(1), pick(1), fetch(1), fetchsel(1)
\ No newline at end of file
diff --git a/src/registrar.adoc b/src/registrar.adoc
deleted file mode 100644 (file)
index 3c769bd..0000000
+++ /dev/null
@@ -1 +0,0 @@
-@defgroup registrar
index 793493ce1286fa3bd2a0289100182080f0c58a9b..ed52ae8f64f2016f367d7959e60df82bb1441816 100644 (file)
@@ -369,4 +369,4 @@ search operation to be applied in the opposite direction of the previous.
 
 == SEE ALSO
 
-acme(1), tide(1), pick(1), pickfile(1), picktag(1)
+acme(1), edit(1), pick(1), pickfile(1), picktag(1)
diff --git a/src/tide.adoc b/src/tide.adoc
deleted file mode 100644 (file)
index 7b15c10..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-@defgroup tide
-HI2!
index fb422988bde161386c5c8e1231f55b31bf377b18..1b65a5f2014a8ab9ff8707ac83b149188594c015 100755 (executable)
@@ -2,10 +2,29 @@
 require "asciidoctor"
 require "asciidoctor-diagram"
 
+Attrs = {
+  "linkcss" => false,
+#  "imagesoutdir" => outdir,
+  "icons" => "font",
+  "stylesheet" => "docs/style.css",
+#    "toc" => "left",
+#    "toclevels" => 3,
+  "source-highlighter" => "rouge",
+  "rouge-style" => "thankful_eyes",
+}
+
+def render_string(contents, outfile)
+  puts outfile
+  FileUtils.mkdir_p(File.dirname(outfile))
+  Asciidoctor.convert(
+    contents,
+    attributes: Attrs.merge({"imagesoutdir" => File.dirname(outfile)}),
+    to_file: outfile,
+    safe: 0)
+end
+
 def render_file(infile, outfile)
   return if FileUtils.uptodate?(outfile, [infile])
-  puts "#{infile} -> #{outfile}"
-  outdir = File.dirname(outfile)
   basename = File.basename(infile).sub(%r{(?:\.design)?\.adoc$}, "")
   image_index = 0
   contents = File.read(infile).each_line.map do |line|
@@ -19,23 +38,19 @@ def render_file(infile, outfile)
       line
     end
   end
-  attributes = {
-    "linkcss" => false,
-    "imagesoutdir" => outdir,
-    "icons" => "font",
-    "stylesheet" => "docs/style.css",
-#    "toc" => "left",
-#    "toclevels" => 3,
-    "source-highlighter" => "rouge",
-    "rouge-style" => "thankful_eyes",
-  }
-  FileUtils.mkdir_p(outdir)
-  Asciidoctor.convert(contents.join,
-                      attributes: attributes,
-                      to_file: outfile,
-                      safe: 0)
+  render_string(contents.join, outfile)
+end
+
+def render_source(infile, outfile)
+  return if FileUtils.uptodate?(outfile, [infile])
+  data = "= #{File.basename(infile)}\n\n[source,c,linenums]\n----\n" + File.read(infile) + "\n----\n"
+  render_string(data, outfile)
 end
 
 Dir.glob("**/*.adoc").each do |f|
   render_file(f, "build/html/#{f.sub(/\.[^.]*$/,'.html')}")
 end
+
+Dir.glob("{src,inc}/**/*.{c,h}").each do |f|
+  render_source(f, "build/html/#{f}.html")
+end