aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/se_file_op.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2016-02-24 23:21:06 -0500
committerRalph Amissah <ralph@amissah.com>2016-02-24 23:54:58 -0500
commitee91e6282464321d5f1e8694c048c24abf8d15d7 (patch)
treef625748df5ac43de3b19ad96863b098eb1231af6 /lib/sisu/se_file_op.rb
parenttxt_orgmode, update (dp add email header field) (diff)
json, an output representation, first pass
Diffstat (limited to 'lib/sisu/se_file_op.rb')
-rw-r--r--lib/sisu/se_file_op.rb59
1 files changed, 59 insertions, 0 deletions
diff --git a/lib/sisu/se_file_op.rb b/lib/sisu/se_file_op.rb
index 8a47b1cd..9a95baa5 100644
--- a/lib/sisu/se_file_op.rb
+++ b/lib/sisu/se_file_op.rb
@@ -418,6 +418,12 @@ module SiSU_File_Op
fn=base_filename.xml_scaffold_structure_collapse
make_file(path,fn)
end
+ def json
+ path=output_path.json.dir
+ make_path(path)
+ fn=base_filename.json
+ make_file(path,fn)
+ end
def manpage
path=output_path.manpage.dir
make_path(path)
@@ -713,6 +719,17 @@ module SiSU_File_Op
end
self
end
+ def json
+ def dir
+ output_path.json.dir + '/' \
+ + base_filename.json
+ end
+ def rel
+ output_path.json.rel + '/' \
+ + base_filename.json
+ end
+ self
+ end
def sqlite_discrete
def dir
output_path.sqlite_discrete.dir + '/' \
@@ -1241,6 +1258,24 @@ module SiSU_File_Op
end
i18n(fnh)
end
+ def json(fh=nil)
+ fh=default_hash_build(fh,Sfx[:json])
+ fh[:lng]=lang_code?(fh[:lng])
+ fnh=if output_dir_structure.by_filename?
+ {
+ fn: 'scroll',
+ ft: fh[:ft],
+ lng: fh[:lng],
+ }
+ else
+ {
+ fn: fh[:fn],
+ ft: fh[:ft],
+ lng: fh[:lng],
+ }
+ end
+ i18n(fnh)
+ end
def pdf_p(fh=nil)
fh=default_hash_build(fh,Sfx[:pdf])
fh[:lng]=lang_code?(fh[:lng])
@@ -2330,6 +2365,30 @@ module SiSU_File_Op
end
self
end
+ def json
+ def ft
+ 'json'
+ end
+ def dir
+ set_path(ft).dir.abc
+ end
+ def url
+ set_path(ft).url.abc
+ end
+ def rel
+ set_path(ft).rel.abc
+ end
+ def rcp
+ set_path(ft).rcp.abc
+ end
+ def rel_sm
+ set_path(ft).rel_sm.ab
+ end
+ def rel_image
+ '../../_sisu/image'
+ end
+ self
+ end
def pdf
def ft
'pdf'