[Scummvm-git-logs] scummvm master -> e271cdc6534763f4472c3ff70c22292268300814

digitall dgturner at iee.org
Thu Apr 18 04:55:27 CEST 2019


This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
50ed922cb7 RISCOS: Support creating a StrongHelp manual
287ba1d1ca RISCOS: Update FindHelp
e271cdc653 README: Link to the NEWS.md and AUTHORS files


Commit: 50ed922cb7466c25d874260e9c341cfbdb108341
    https://github.com/scummvm/scummvm/commit/50ed922cb7466c25d874260e9c341cfbdb108341
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2019-04-18T03:55:22+01:00

Commit Message:
RISCOS: Support creating a StrongHelp manual

Changed paths:
  A dists/riscos/manual/stronghelp.lua
    backends/platform/sdl/riscos/riscos.mk
    configure
    devtools/credits.pl


diff --git a/backends/platform/sdl/riscos/riscos.mk b/backends/platform/sdl/riscos/riscos.mk
index 44b49d5..4fea4d4 100644
--- a/backends/platform/sdl/riscos/riscos.mk
+++ b/backends/platform/sdl/riscos/riscos.mk
@@ -40,4 +40,35 @@ clean: riscosclean
 riscosclean:
 	$(RM_REC) $(APP_NAME)
 
+ifdef BINDHELP
+ifdef PANDOC
+
+riscosdist: $(APP_NAME)/docs/ScummVM,3d6 # $(APP_NAME)/docs/de/ScummVM,3d6 $(APP_NAME)/docs/cz/ScummVM,3d6 $(APP_NAME)/se/ScummVM,3d6
+
+README=${srcdir}/README.md
+NEWS=${srcdir}/NEWS.md
+$(APP_NAME)/docs/de/ScummVM,3d6: README=${srcdir}/doc/de/LIESMICH
+$(APP_NAME)/docs/de/ScummVM,3d6: NEWS=${srcdir}/doc/de/NEUES
+$(APP_NAME)/docs/cz/ScummVM,3d6: README=${srcdir}/doc/cz/PrectiMe
+$(APP_NAME)/docs/se/ScummVM,3d6: README=${srcdir}/doc/se/LasMig
+
+define manual-markdown
+	echo Converting markdown file '$1'
+	echo "ScummVM - $(notdir $(basename $1)) " > $(APP_NAME)/tmp/$2,fff
+	$(PANDOC) -f gfm -t ${srcdir}/dists/riscos/manual/stronghelp.lua $1 | iconv --to-code=$(ENCODING) >> $(APP_NAME)/tmp/$2,fff
+endef
+
+%,3d6: $(README) $(NEWS) ${srcdir}/dists/riscos/manual/stronghelp.lua ${srcdir}/devtools/credits.pl $(DIST_FILES_DOCS)
+	$(MKDIR) $(APP_NAME)/tmp
+	@$(call manual-markdown,$(README),!Root)
+	@$(call manual-markdown,$(NEWS),NEWS)
+	@$(call manual-markdown,${srcdir}/CONTRIBUTING.md,CONTRIBUTING)
+	${srcdir}/devtools/credits.pl --stronghelp > $(APP_NAME)/tmp/AUTHORS,fff
+	$(MKDIR) $(APP_NAME)/docs
+	$(BINDHELP) $(APP_NAME)/tmp $@ -r -f
+	$(RM_REC) $(APP_NAME)/tmp
+
+endif
+endif
+
 .PHONY: riscosdist riscosclean
diff --git a/configure b/configure
index 5de54af..1289b21 100755
--- a/configure
+++ b/configure
@@ -1851,6 +1851,11 @@ riscos)
 	elif `which tokenize >/dev/null 2>&1`; then
 		add_line_to_config_mk "TOKENIZE := tokenize"
 	fi
+	if test -e "$GCCSDK_INSTALL_ENV/bin/bindhelp"; then
+		add_line_to_config_mk "BINDHELP := $GCCSDK_INSTALL_ENV/bin/bindhelp"
+	elif `which bindhelp >/dev/null 2>&1`; then
+		add_line_to_config_mk "BINDHELP := bindhelp"
+	fi
 	;;
 tizen)
 	if test -z "$TIZEN_ROOTSTRAP"; then
@@ -2892,6 +2897,7 @@ case $_host_os in
 		append_var CXXFLAGS "-fdata-sections"
 		append_var LDFLAGS "-Wl,--gc-sections"
 		_port_mk="backends/platform/sdl/riscos/riscos.mk"
+		_pandoc=yes
 		;;
 	solaris*)
 		append_var DEFINES "-DSOLARIS"
diff --git a/devtools/credits.pl b/devtools/credits.pl
index 59ebb51..b1c0845 100755
--- a/devtools/credits.pl
+++ b/devtools/credits.pl
@@ -36,11 +36,12 @@ if ($#ARGV >= 0) {
 	$mode = "CPP" if ($ARGV[0] eq "--cpp");		# credits.h (for use by about.cpp)
 	$mode = "XML-DOC" if ($ARGV[0] eq "--xml-docbook");		# credits.xml (DocBook)
 	$mode = "RTF" if ($ARGV[0] eq "--rtf");		# Credits.rtf (Mac OS X About box)
+	$mode = "STRONGHELP" if ($ARGV[0] eq "--stronghelp");	# AUTHORS (RISC OS StrongHelp manual)
 }
 
 if ($mode eq "") {
-	print STDERR "Usage: $0 [--text | --xml-website | --cpp | --xml-docbook | --rtf]\n";
-	print STDERR " Just pass --text / --xml-website / --cpp / --xml-docbook / --rtf as parameter, and credits.pl\n";
+	print STDERR "Usage: $0 [--text | --xml-website | --cpp | --xml-docbook | --rtf | --stronghelp]\n";
+	print STDERR " Just pass --text / --xml-website / --cpp / --xml-docbook / --rtf / --stronghelp as parameter, and credits.pl\n";
 	print STDERR " will print out the corresponding version of the credits to stdout.\n";
 	exit 1;
 }
@@ -106,6 +107,36 @@ sub html_entities_to_ascii {
 	return $text;
 }
 
+# Convert HTML entities to ISO/IEC 8859-1 for the StrongHelp manual
+sub html_entities_to_iso8859_1 {
+	my $text = shift;
+
+	$text =~ s/á/\xE1/g;
+	$text =~ s/é/\xE9/g;
+	$text =~ s/í/\xED/g;
+	$text =~ s/ì/\xEC/g;
+	$text =~ s/ó/\xF3/g;
+	$text =~ s/ø/\xF8/g;
+	$text =~ s/ú/\xFA/g;
+	$text =~ s/ą/a/g;
+	$text =~ s/Ł/L/g;
+	$text =~ s/ł/l/g;
+	$text =~ s/ś/s/g;
+	$text =~ s/Ľ/L/g;
+	$text =~ s/Š/S/g;
+	$text =~ s/å/\xE5/g;
+	$text =~ s/ñ/\xF1/g;
+
+	$text =~ s/ä/\xE4/g;
+	$text =~ s/ë/\xEB/g;
+	$text =~ s/ü/\xFC/g;
+	$text =~ s/ö/\xF6/g;
+
+	$text =~ s/&/&/g;
+
+	return $text;
+}
+
 # Convert HTML entities to C++ characters
 sub html_entities_to_cpp {
 	my $text = shift;
@@ -219,6 +250,9 @@ sub begin_credits {
 		print "<?xml version='1.0'?>\n";
 		print "<!-- This file was generated by credits.pl. Do not edit by hand! -->\n";
 		print "<credits>\n";
+	} elsif ($mode eq "STRONGHELP") {
+		print "ScummVM - AUTHORS\n";
+		print "# This file was generated by credits.pl. Do not edit by hand!\n";
 	}
 }
 
@@ -314,6 +348,9 @@ sub begin_section {
 			#print "\t\t\t<group>" . $title . "</group>\n";
 			#print "\t\t\t\t<name>" . $title . "</name>\n";
 		}
+	} elsif ($mode eq "STRONGHELP") {
+		$title = html_entities_to_iso8859_1($title);
+		print "#fH" . ($section_level + 1) . ":" . $title."\n";
 	}
 
 	# Implicit start of person list on section level 2
@@ -369,6 +406,8 @@ sub end_persons {
 	} elsif ($mode eq "XML-WEB") {
 		#print "\t\t\t\t</persons>\n";
 		print "\t\t\t</group>\n";
+	} elsif ($mode eq "STRONGHELP") {
+		print "\n";
 	}
 }
 
@@ -443,6 +482,15 @@ sub add_person {
 		print "\t\t\t\t\t<alias>" . $nick . "</alias>\n";
 		print "\t\t\t\t\t<description>" . $desc . "</description>\n";
 		print "\t\t\t\t</person>\n";
+	} elsif ($mode eq "STRONGHELP") {
+		my $min_name_width = length $desc > 0 ? $max_name_width : 0;
+		$name = $nick if $name eq "";
+		$name = html_entities_to_iso8859_1($name);
+		$desc = html_entities_to_iso8859_1($desc);
+
+		$tab = " " x ($section_level * 2 + 1);
+		print $tab . "{*}" . $name . "{*}";
+		print "\t" . $desc . "\n";
 	}
 }
 
@@ -471,6 +519,12 @@ sub add_paragraph {
 		print "  <row><entry namest='start' nameend='job'> </entry></row>\n\n";
 	} elsif ($mode eq "XML-WEB") {
 		print "\t\t<paragraph>" . $text . "</paragraph>\n";
+	} elsif ($mode eq "STRONGHELP") {
+		$text = html_entities_to_iso8859_1($text);
+		print "#Wrap On\n";
+		$tab = " " x ($section_level * 2 + 1);
+		print $text . "\n";
+		print "#Wrap\n\n";
 	}
 }
 
diff --git a/dists/riscos/manual/stronghelp.lua b/dists/riscos/manual/stronghelp.lua
new file mode 100644
index 0000000..ef17589
--- /dev/null
+++ b/dists/riscos/manual/stronghelp.lua
@@ -0,0 +1,341 @@
+-- This is a custom writer for pandoc.  It produces output suitable
+-- for use in a StrongHelp manual. Not all functionalilty is currently
+-- implemented.
+--
+-- Invoke with: pandoc -t stronghelp.lua
+--
+-- Note:  you need not have lua installed on your system to use this
+-- custom writer.  However, if you do have lua installed, you can
+-- use it to test changes to the script.  'lua stronghelp.lua' will
+-- produce informative error messages if your code contains
+-- syntax errors.
+
+-- Character escaping
+local function escape(s, in_attribute)
+  return s:gsub("[<>$\\]",
+    function(x)
+      if x == '<' then
+        return '\\<'
+      elseif x == '>' then
+        return '\\>'
+      elseif x == '$' then
+        return '\\$'
+      elseif x == '\\' then
+        return '\\\\'
+      else
+        return x
+      end
+    end)
+end
+
+local function convertPath(s)
+  local path = s:gsub("[./]",
+    function(x)
+      if x == '.' then
+        return '/'
+      elseif x == '/' then
+        return '.'
+      else
+        return x
+      end
+    end)
+  path = string.gsub(path, "/md", "")
+  return path;
+end
+
+-- Helper function to convert an attributes table into
+-- a string that can be put into HTML tags.
+local function attributes(attr)
+  local attr_table = {}
+  for x,y in pairs(attr) do
+    if y and y ~= "" then
+      table.insert(attr_table, ' ' .. x .. '="' .. escape(y,true) .. '"')
+    end
+  end
+  return table.concat(attr_table)
+end
+
+-- Helper function to look up an attribute by name from
+--  an attributes table.
+-- TODO: Is this necessary?
+local function getattribute(attr, name)
+  local attr_table = {}
+  for x,y in pairs(attr) do
+    if x == name then
+      do return escape(y,true) end
+    end
+  end
+  return ""
+end
+
+-- Table to store footnotes, so they can be included at the end.
+local notes = {}
+
+-- Blocksep is used to separate block elements.
+function Blocksep()
+  return "\n\n"
+end
+
+-- This function is called once for the whole document. Parameters:
+-- body is a string, metadata is a table, variables is a table.
+-- This gives you a fragment.  You could use the metadata table to
+-- fill variables in a custom lua template.  Or, pass `--template=...`
+-- to pandoc, and pandoc will add do the template processing as
+-- usual.
+function Doc(body, metadata, variables)
+  local buffer = {}
+  local function add(s)
+    table.insert(buffer, s)
+  end
+  add(body)
+  if #notes > 0 then
+    for _,note in pairs(notes) do
+      add(note)
+    end
+  end
+  return "#Indent +4\n" .. table.concat(buffer, "") .. "\n#Indent\n"
+end
+
+-- The functions that follow render corresponding pandoc elements.
+-- s is always a string, attr is always a table of attributes, and
+-- items is always an array of strings (the items in a list).
+-- Comments indicate the types of other variables.
+
+function Str(s)
+  return escape(s)
+end
+
+function Space()
+  return " "
+end
+
+function SoftBreak()
+  return " "
+end
+
+function LineBreak()
+  return "\n"
+end
+
+function Emph(s)
+  return "{/}" .. s .. "{/}"
+end
+
+function Strong(s)
+  return "{*}" .. s .. "{*}"
+end
+
+function Subscript(s)
+  -- TODO
+  return s
+end
+
+function Superscript(s)
+  -- TODO
+  return s
+end
+
+function SmallCaps(s)
+  -- TODO
+  return s
+end
+
+function Strikeout(s)
+  -- TODO
+  return s
+end
+
+function Link(s, src, tit, attr)
+  -- escape(tit,true)
+  if string.find(src, "://") or string.find(src, "mailto:") then
+    return "<" .. s .. "=>#URL " .. escape(src,true) .. ">"
+  elseif string.sub(src, 1, 1) == '#' then
+    return "<" .. s .. "=>#TAG " .. escape(string.sub(src,2),true) .. ">"
+  else
+    return "<" .. s .. "=>" .. convertPath(escape(src,true)) .. ">"
+  end
+end
+
+function Image(s, src, tit, attr)
+  -- TODO
+  return s
+end
+
+function Code(s, attr)
+  return "{FCode}" .. escape(s) .. "{F}"
+end
+
+function InlineMath(s)
+  return "\\(" .. escape(s) .. "\\)"
+end
+
+function DisplayMath(s)
+  return "\\[" .. escape(s) .. "\\]"
+end
+
+function SingleQuoted(s)
+  return "'" .. s .. "'"
+end
+
+function DoubleQuoted(s)
+  return '"' .. s .. '"'
+end
+
+
+function Note(s)
+  local num = #notes + 1
+  -- add a list item with the note to the note table.
+  table.insert(notes, '#Tag fn' .. num .. '\n' .. num .. ")\t" .. s .. '\n')
+  -- return the footnote reference, linked to the note.
+  return '<[' .. num .. ']=>#TAG fn' .. num .. '>'
+end
+
+function Span(s, attr)
+  -- TODO
+  return s
+end
+
+function RawInline(format, str)
+  -- TODO
+  return ''
+end
+
+function Cite(s, cs)
+  -- TODO
+  return s
+end
+
+function Plain(s)
+  return s
+end
+
+function Para(s)
+  return s
+end
+
+-- lev is an integer, the header level.
+function Header(lev, s, attr)
+  return  "#Tag " .. getattribute(attr, "id") .. "\n" .. "#fH" .. lev .. "\n" .. s .. "\n#f\n"
+end
+
+function BlockQuote(s)
+  return "#Indent +6\n" .. s .. "\n#Indent\n"
+end
+
+function HorizontalRule()
+  return "#Line\n"
+end
+
+function LineBlock(ls)
+  -- TODO
+  return table.concat(ls, '\n')
+end
+
+function CodeBlock(s, attr)
+  -- TODO: attr.class and string.match(' ' .. attr.class .. ' ',' dot ')
+  return "#fCode\n" .. escape(s) .. "\n#f"
+end
+
+function BulletList(items)
+  local buffer = {}
+  for _, item in pairs(items) do
+    table.insert(buffer, " •\t" .. string.gsub(string.gsub(item, "\n", "\n\t"), "\n\t#", "\n#") .. "\n")
+  end
+  return "#Indent +4\n" .. table.concat(buffer, "") .. "#Indent\n"
+end
+
+function OrderedList(items)
+  local buffer = {}
+  for _, item in pairs(items) do
+    table.insert(buffer,  _ .. ")\t"  .. string.gsub(string.gsub(item, "\n", "\n\t"), "\n\t#", "\n#") .. "\n")
+  end
+  return "#Indent +4\n" .. table.concat(buffer, "") .. "#Indent\n"
+end
+
+function DefinitionList(items)
+  local buffer = {}
+  for _,item in pairs(items) do
+    local k, v = next(item)
+    table.insert(buffer, k .. "\t" .. table.concat(v,"\n\t") .. "\n")
+  end
+  return "#Indent +4\n" .. table.concat(buffer, "") .. "#Indent\n"
+end
+
+-- Convert pandoc alignment to something StrongHelp can use.
+-- align is AlignLeft, AlignRight, AlignCenter, or AlignDefault.
+function stronghelp_align(align)
+  if align == 'AlignLeft' then
+    return 'Left'
+  elseif align == 'AlignRight' then
+    return 'Right'
+  elseif align == 'AlignCenter' then
+    return 'Centre'
+  else
+    return 'Left'
+  end
+end
+
+function CaptionedImage(src, tit, caption, attr)
+   -- TODO
+   return tit .. '\n' .. caption .. '\n'
+end
+
+-- Caption is a string, aligns is an array of strings,
+-- widths is an array of floats, headers is an array of
+-- strings, rows is an array of arrays of strings.
+function Table(caption, aligns, widths, headers, rows)
+  local buffer = {}
+  local function add(s)
+    table.insert(buffer, s)
+  end
+  add("#Tab\n")
+  if caption ~= "" then
+    add(caption .. "\n")
+  end
+  local header_row = {}
+  local empty_header = true
+  for i, h in pairs(headers) do
+    table.insert(header_row,h .. '\t')
+    empty_header = empty_header and h == ""
+  end
+  if empty_header then
+    head = ""
+  else
+    local cells = {}
+    for _,h in pairs(header_row) do
+      table.insert(cells, h)
+    end
+    add('{*}' .. table.concat(cells,'\t') .. '{*}\n')
+  end
+  for _, row in pairs(rows) do
+    local cells = {}
+    for i,c in pairs(row) do
+      table.insert(cells, c)
+    end
+    add(table.concat(cells,'\t') .. '\n')
+  end
+  add("#Tab\n")
+  return table.concat(buffer,'')
+end
+
+function RawBlock(format, str)
+  -- TODO
+  return ''
+end
+
+function Div(s, attr)
+  -- TODO
+  return s
+end
+
+-- The following code will produce runtime warnings when you haven't defined
+-- all of the functions you need for the custom writer, so it's useful
+-- to include when you're working on a writer.
+local meta = {}
+meta.__index =
+  function(_, key)
+    io.stderr:write(string.format("WARNING: Undefined function '%s'\n",key))
+    return function() return "" end
+  end
+setmetatable(_G, meta)
+


Commit: 287ba1d1caf47420764001cfec22751feb306558
    https://github.com/scummvm/scummvm/commit/287ba1d1caf47420764001cfec22751feb306558
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2019-04-18T03:55:22+01:00

Commit Message:
RISCOS: Update FindHelp

Changed paths:
    dists/riscos/FindHelp,fd1


diff --git a/dists/riscos/FindHelp,fd1 b/dists/riscos/FindHelp,fd1
index 289936b..b319bfb 100644
--- a/dists/riscos/FindHelp,fd1
+++ b/dists/riscos/FindHelp,fd1
@@ -1,23 +1,20 @@
 ON ERROR PROCerror
+SYS "XOS_ReadVarVal","StrongHelp$Dir",-1,-1 TO ,,stronghelp%
 file$=""
+readme$=""
 
 SYS "Territory_Number" TO current_territory%
 REPEAT
-   READ territory%, prefix$, quickstart$, readme$
-   IF territory%=current_territory% OR territory%=-1 THEN
-      IF quickstart$<>"" THEN
-         SYS "OS_File",20,"<ScummVM$Dir>.docs."+prefix$+quickstart$ TO qtype%
-         IF qtype%<>0 THEN
-            file$="<ScummVM$Dir>.docs."+prefix$+quickstart$
-         ENDIF
-      ENDIF
-      IF readme$<>"" THEN
-         SYS "OS_File",20,"<ScummVM$Dir>.docs."+prefix$+readme$ TO rtype%
-         IF rtype%<>0 THEN
+   READ territory%, prefix$, readme$
+   WHILE readme$<>""
+      IF territory%=current_territory% OR territory%=-1 THEN
+         SYS "OS_File",20,"<ScummVM$Dir>.docs."+prefix$+readme$ TO type%,,,,,,ftype%
+         IF type%<>0 AND NOT (stronghelp%=0 AND ftype%=&3D6) THEN
             file$="<ScummVM$Dir>.docs."+prefix$+readme$
          ENDIF
       ENDIF
-   ENDIF
+      READ readme$
+   ENDWHILE
 UNTIL territory%=-1 OR file$<>""
 
 IF file$<>"" THEN
@@ -31,12 +28,12 @@ DEF PROCerror
 ENDPROC
 
 REM Reference: https://www.riscosopen.org/wiki/documentation/show/Territory%20Numbers
-DATA 4,   "it.",    "GuidaRapida",     ""
-DATA 5,   "es.",    "InicioRapido",    ""
-DATA 6,   "fr.",    "DemarrageRapide", ""
-DATA 7,   "de.",    "Schnellstart",    "LIESMICH"
-DATA 11,  "se.",    "Snabbstart",      "LasMig"
-DATA 14,  "da.",    "HurtigStart",     ""
-DATA 15,  "no-nb.", "HurtigStart",     ""
-DATA 134, "cz.",    "",                "PrectiMe"
-DATA -1,  "",       "QuickStart",      "README"
+DATA 4,   "it.",    "GuidaRapida",                                         ""
+DATA 5,   "es.",    "InicioRapido",                                        ""
+DATA 6,   "fr.",    "DemarrageRapide",                                     ""
+DATA 7,   "de.",    "Schnellstart",                 "LIESMICH",            ""
+DATA 11,  "se.",    "Snabbstart",                   "LasMig",              ""
+DATA 14,  "da.",    "HurtigStart",                                         ""
+DATA 15,  "no-nb.", "HurtigStart",                                         ""
+DATA 134, "cz.",                                    "PrectiMe",            ""
+DATA -1,  "",       "QuickStart",      "README/md", "README",   "ScummVM", ""


Commit: e271cdc6534763f4472c3ff70c22292268300814
    https://github.com/scummvm/scummvm/commit/e271cdc6534763f4472c3ff70c22292268300814
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2019-04-18T03:55:22+01:00

Commit Message:
README: Link to the NEWS.md and AUTHORS files

Changed paths:
    README.md


diff --git a/README.md b/README.md
index 9943468..3cb92cf 100644
--- a/README.md
+++ b/README.md
@@ -118,7 +118,8 @@ page at: <https://www.scummvm.org/>
   - [9.0) Screenshots (SDL backend
     only)](#90-screenshots-sdl-backend-only)
   - [10.0) Compiling](#100-compiling)
-  - [11.0) Credits](#110-credits)
+  - [11.0) Changelog](#110-changelog)
+  - [12.0) Credits](#120-credits)
 
 ## 1.0) Introduction
 
@@ -2939,11 +2940,13 @@ debug messages (see
       - Please refer to:
         <https://wiki.scummvm.org/index.php/Compiling_ScummVM/Symbian>
 
-## 11.0) Credits
+## 11.0) Changelog
 
-Please refer to our extensive Credits list at:
+Please refer to our extensive Changelog [here](NEWS.md).
 
-<https://www.scummvm.org/credits/>
+## 12.0) Credits
+
+Please refer to our extensive Credits list [here](AUTHORS).
 
 -----
 





More information about the Scummvm-git-logs mailing list