[Scummvm-git-logs] scummvm branch-2-3 -> 0e8a06997ad6e7d05e4627241581ab7a0e9cc62e

ccawley2011 ccawley2011 at gmail.com
Sun Aug 29 15:08:48 UTC 2021


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

Summary:
0e8a06997a RISCOS: Replace the StrongHelp manual with the PDF manual


Commit: 0e8a06997ad6e7d05e4627241581ab7a0e9cc62e
    https://github.com/scummvm/scummvm/commit/0e8a06997ad6e7d05e4627241581ab7a0e9cc62e
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2021-08-29T16:08:33+01:00

Commit Message:
RISCOS: Replace the StrongHelp manual with the PDF manual

Changed paths:
  R dists/riscos/manual/stronghelp.lua
    backends/platform/sdl/riscos/riscos.mk
    configure
    devtools/credits.pl
    dists/riscos/FindHelp,fd1


diff --git a/backends/platform/sdl/riscos/riscos.mk b/backends/platform/sdl/riscos/riscos.mk
index 8feb75277e..9ed7919a18 100644
--- a/backends/platform/sdl/riscos/riscos.mk
+++ b/backends/platform/sdl/riscos/riscos.mk
@@ -6,6 +6,8 @@ endif
 
 APP_NAME=!ScummVM
 
+DIST_FILES_DOCS_plaintext := $(filter-out $(DIST_FILES_MANUAL),$(DIST_FILES_DOCS))
+
 # Special target to create an RISC OS snapshot installation
 riscosdist: all $(DIST_FILES_DOCS)
 	mkdir -p $(APP_NAME)
@@ -35,7 +37,10 @@ endif
 ifdef TOKENIZE
 	$(TOKENIZE) ${srcdir}/dists/riscos/FindHelp,fd1 -out $(APP_NAME)/FindHelp,ffb
 endif
-	@$(foreach file, $(DIST_FILES_DOCS) $(srcdir)/doc/QuickStart, echo '   ' ICONV '  ' $(APP_NAME)/docs/$(notdir $(file)),fff;iconv --to-code=$(ENCODING) $(file) > $(APP_NAME)/docs/$(notdir $(file)),fff;)
+ifdef DIST_FILES_MANUAL
+	cp $(DIST_FILES_MANUAL) $(APP_NAME)/docs/ScummVM,adf
+endif
+	@$(foreach file, $(DIST_FILES_DOCS_plaintext) $(srcdir)/doc/QuickStart, echo '   ' ICONV '  ' $(APP_NAME)/docs/$(notdir $(file)),fff;iconv --to-code=$(ENCODING) $(file) > $(APP_NAME)/docs/$(notdir $(file)),fff;)
 	@$(foreach lang, $(DIST_FILES_DOCS_languages), mkdir -p $(APP_NAME)/docs/$(lang); $(foreach file, $(DIST_FILES_DOCS_$(lang)), echo '   ' ICONV '  ' $(APP_NAME)/docs/$(lang)/$(notdir $(file)),fff;iconv --from-code=UTF-8 --to-code=$(ENCODING) $(file) > $(APP_NAME)/docs/$(lang)/$(notdir $(file)),fff;))
 
 clean: riscosclean
@@ -43,35 +48,4 @@ 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.md
-$(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 332d691952..ef24f2adc5 100755
--- a/configure
+++ b/configure
@@ -1883,11 +1883,6 @@ 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
 	;;
 *)
 	;;
diff --git a/devtools/credits.pl b/devtools/credits.pl
index b53eec4c7e..86310e9e62 100755
--- a/devtools/credits.pl
+++ b/devtools/credits.pl
@@ -41,14 +41,13 @@ if ($#ARGV >= 0) {
 	$mode = "TEXT" if ($ARGV[0] eq "--text");	# AUTHORS file
 	$mode = "CPP" if ($ARGV[0] eq "--cpp");		# credits.h (for use by about.cpp)
 	$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)
 	$mode = "YAML" if ($ARGV[0] eq "--yaml");	# YAML (Simple format, used in the Website)
 	$mode = "RST" if ($ARGV[0] eq "--rst");		# Restructured text (used in the manual)
 }
 
 if ($mode eq "") {
-	print STDERR "Usage: $0 [--text | --cpp | --rtf | --stronghelp | --yaml | --rst]\n";
-	print STDERR " Just pass --text / --cpp / --rtf / --stronghelp / --yaml / --rst as parameter, and credits.pl\n";
+	print STDERR "Usage: $0 [--text | --cpp | --rtf | --yaml | --rst]\n";
+	print STDERR " Just pass --text / --cpp / --rtf / --yaml / --rst as parameter, and credits.pl\n";
 	print STDERR " will print out the corresponding version of the credits to stdout.\n";
 	exit 1;
 }
@@ -126,37 +125,6 @@ sub html_entities_to_utf8 {
 	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/Á/\xC1/g;
-	$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;
@@ -254,9 +222,6 @@ sub begin_credits {
 		print "static const char *credits[] = {\n";
 	} elsif ($mode eq "YAML") {
 		print "# This file was generated by credits.pl. Do not edit by hand!\n";
-	} elsif ($mode eq "STRONGHELP") {
-		print "ScummVM - AUTHORS\n";
-		print "# This file was generated by credits.pl. Do not edit by hand!\n";
 	} elsif ($mode eq "RST") {
 		print "..\n";
 		print "   This file was generated by credits.pl. Do not edit by hand!\n";
@@ -342,9 +307,6 @@ sub begin_section {
 				print $indent . "  anchor: \"" . $anchor . "\"\n";
 			}
 		}
-	} elsif ($mode eq "STRONGHELP") {
-		$title = html_entities_to_iso8859_1($title);
-		print "#fH" . ($section_level + 1) . ":" . $title."\n";
 	} elsif ($mode eq "RST") {
 		$title = html_entities_to_utf8($title);
 		print $title."\n";
@@ -412,8 +374,6 @@ sub end_persons {
 		print "\n";
 	} elsif ($mode eq "RTF") {
 		# nothing
-	} elsif ($mode eq "STRONGHELP") {
-		print "\n";
 	} elsif ($mode eq "YAML") {
 		$person_started = 0;
 	} elsif ($mode eq "RST") {
@@ -484,15 +444,6 @@ sub add_person {
 		print $indent . "  name: \"" . $name . "\"\n";
 		print $indent . "  alias: \"" . $nick . "\"\n";
 		print $indent . "  description: \"" . $desc . "\"\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";
 	} elsif ($mode eq "RST") {
 		my $min_name_width = length $desc > 0 ? $max_name_width : 0;
 		$name = $nick if $name eq "";
@@ -535,12 +486,6 @@ sub add_paragraph {
 			$paragraph_started = 1;
 		}
 		print $indent . "- \"" . $text . "\"\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";
 	} elsif ($mode eq "RST") {
 		$text = html_entities_to_utf8($text);
 		print $text . "\n\n";
diff --git a/dists/riscos/FindHelp,fd1 b/dists/riscos/FindHelp,fd1
index b319bfbf25..c31bac5028 100644
--- a/dists/riscos/FindHelp,fd1
+++ b/dists/riscos/FindHelp,fd1
@@ -1,5 +1,4 @@
 ON ERROR PROCerror
-SYS "XOS_ReadVarVal","StrongHelp$Dir",-1,-1 TO ,,stronghelp%
 file$=""
 readme$=""
 
@@ -9,7 +8,7 @@ REPEAT
    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
+         IF type%<>0 AND FNsupported(ftype%)<>0 THEN
             file$="<ScummVM$Dir>.docs."+prefix$+readme$
          ENDIF
       ENDIF
@@ -27,6 +26,11 @@ DEF PROCerror
    ERROR ERR, REPORT$+" at line "+STR$(ERL)
 ENDPROC
 
+DEF FNsupported(ftype%)
+   LOCAL r2%
+   SYS "XOS_ReadVarVal","Alias$@RunType_"+STR$~(ftype%),-1,-1 TO ,,r2%
+=r2%
+
 REM Reference: https://www.riscosopen.org/wiki/documentation/show/Territory%20Numbers
 DATA 4,   "it.",    "GuidaRapida",                                         ""
 DATA 5,   "es.",    "InicioRapido",                                        ""
diff --git a/dists/riscos/manual/stronghelp.lua b/dists/riscos/manual/stronghelp.lua
deleted file mode 100644
index ef17589dd7..0000000000
--- a/dists/riscos/manual/stronghelp.lua
+++ /dev/null
@@ -1,341 +0,0 @@
--- 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)
-




More information about the Scummvm-git-logs mailing list