diff options
Diffstat (limited to 'lib/sisu/se_file_op.rb')
-rw-r--r-- | lib/sisu/se_file_op.rb | 81 |
1 files changed, 69 insertions, 12 deletions
diff --git a/lib/sisu/se_file_op.rb b/lib/sisu/se_file_op.rb index 55e4b1c1..9a95baa5 100644 --- a/lib/sisu/se_file_op.rb +++ b/lib/sisu/se_file_op.rb @@ -7,11 +7,11 @@ *** system environment, resource control and configuration details ** Author: Ralph Amissah - <ralph@amissah.com> - <ralph.amissah@gmail.com> + [ralph@amissah.com] + [ralph.amissah@gmail.com] ** Copyright: (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Ralph Amissah, + 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Ralph Amissah, All Rights Reserved. ** License: GPL 3 or later: @@ -31,14 +31,12 @@ more details. You should have received a copy of the GNU General Public License along with - this program. If not, see <http://www.gnu.org/licenses/>. + this program. If not, see [http://www.gnu.org/licenses/]. If you have Internet connection, the latest version of the GPL should be available at these locations: - <http://www.fsf.org/licensing/licenses/gpl.html> - <http://www.gnu.org/licenses/gpl.html> - - <http://www.sisudoc.org/sisu/en/manifest/gpl.fsf.html> + [http://www.fsf.org/licensing/licenses/gpl.html] + [http://www.gnu.org/licenses/gpl.html] ** SiSU uses: * Standard SiSU markup syntax, @@ -46,12 +44,12 @@ * Standard SiSU object citation numbering and system ** Hompages: - <http://www.jus.uio.no/sisu> - <http://www.sisudoc.org> + [http://www.jus.uio.no/sisu] + [http://www.sisudoc.org] ** Git - <http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=summary> - <http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=blob;f=lib/sisu/se_file_op.rb;hb=HEAD> + [http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=summary] + [http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=blob;f=lib/sisu/se_file_op.rb;hb=HEAD] =end module SiSU_Info_File @@ -420,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) @@ -715,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 + '/' \ @@ -1243,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]) @@ -2332,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' |