[Scummvm-git-logs] scummvm master -> 21e709af1d3b03f8c945e523f1eb55a33eab6f33
lephilousophe
lephilousophe at users.noreply.github.com
Tue May 25 21:10:24 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:
21e709af1d AMIGAOS: Support the new reduced README.md for AmigaGuide conversion (#3025)
Commit: 21e709af1d3b03f8c945e523f1eb55a33eab6f33
https://github.com/scummvm/scummvm/commit/21e709af1d3b03f8c945e523f1eb55a33eab6f33
Author: Hubert Maier (raziel- at users.noreply.github.com)
Date: 2021-05-25T23:10:21+02:00
Commit Message:
AMIGAOS: Support the new reduced README.md for AmigaGuide conversion (#3025)
AMIGAOS: Support the new reduced README.md for AmigaGuide conversion
Co-authored-by: Le Philousophe <lephilousophe at users.noreply.github.com>
Changed paths:
A dists/amigaos/md2ag.rexx
A dists/amigaos/md2ag.rexx.in
R dists/amigaos/RM2AG.rexx
R dists/amigaos/RM2AG.rexx.in
R dists/amigaos/convertRM.sed
backends/platform/sdl/amigaos/amigaos.mk
diff --git a/backends/platform/sdl/amigaos/amigaos.mk b/backends/platform/sdl/amigaos/amigaos.mk
index 59f9162e10..13bc4494f5 100644
--- a/backends/platform/sdl/amigaos/amigaos.mk
+++ b/backends/platform/sdl/amigaos/amigaos.mk
@@ -13,16 +13,17 @@ amigaosdist: $(EXECUTABLE) $(PLUGINS)
cp ${srcdir}/dists/amigaos/scummvm_drawer.info $(patsubst %/,%,$(AMIGAOSPATH)).info
cp ${srcdir}/dists/amigaos/scummvm.info $(AMIGAOSPATH)/$(EXECUTABLE).info
ifdef DIST_FILES_DOCS
- cp -r $(srcdir)/doc/ $(AMIGAOSPATH)
+ cp -r ${srcdir}/doc/ $(AMIGAOSPATH)
cp $(DIST_FILES_DOCS) $(AMIGAOSPATH)/doc
- # Prepare README.md for AmigaGuide conversion.
- cat ${srcdir}/README.md | sed -f ${srcdir}/dists/amigaos/convertRM.sed > README.conv
+ # README.md must be in the current working directory
+ # when building out of tree.
+ cp ${srcdir}/README.md README.tmp
# AmigaOS AREXX will error with a "Program not found" message
# if srcdir is '.'. Copy the script to cwd instead.
- cp ${srcdir}/dists/amigaos/RM2AG.rexx .
- rx RM2AG.rexx README.conv $(AMIGAOSPATH)/doc/
- rm -f README.conv
- rm -f RM2AG.rexx
+ cp ${srcdir}/dists/amigaos/md2ag.rexx .
+ # LC_ALL is here to workaround Debian bug #973647
+ LC_ALL=C rx md2ag.rexx README.tmp $(AMIGAOSPATH)/doc/
+ rm -f md2ag.rexx README.tmp
endif
# Copy mandatory installation files.
makedir all $(AMIGAOSPATH)/extras
diff --git a/dists/amigaos/RM2AG.rexx b/dists/amigaos/RM2AG.rexx
deleted file mode 100644
index d41789d348..0000000000
--- a/dists/amigaos/RM2AG.rexx
+++ /dev/null
@@ -1,313 +0,0 @@
-/*
-$VER: RM2AG.rexx 0.25 (09.01.2021) README (.md) to .guide converter.
-Converts the ScummVM markdown README file to a basic hypertext AmigaGuide
-file and installs it to the given path.
-*/
-
-PARSE ARG readme_md install_path
-
-/*
-Check if arguments are available, otherwise quit.
-*/
-IF ~ARG() THEN DO
- SAY 'No Arguments given!'
- SAY 'Usage: RM2AG.rexx README_MD INSTALL_PATH'
- EXIT
-END
-
-/*
-If the given filename/path has spaces in it, AmigaDOS/CLI will add extra
-quotation marks to secure a sane working path.
-Get rid of them to make AREXX find the file and remove leading and trailing
-spaces.
-*/
-IF ~EXISTS(readme_md) THEN DO
- SAY readme_md' not available!'
- EXIT
-END
-ELSE DO
- readme_md=STRIP(readme_md)
- readme_md=COMPRESS(readme_md,'"')
-END
-IF installpath='' THEN DO
- SAY 'No installation destination given!'
- EXIT
-END
-ELSE DO
- install_path=STRIP(install_path)
- install_path=STRIP(install_path,'T','/')
- install_path=COMPRESS(install_path,'"')
- /*
- Check for destination path and create it, if needed.
- */
- IF ~EXISTS(install_path'/') THEN
- ADDRESS COMMAND 'makedir all 'install_path
-END
-
-IF ~OPEN(check_readme,readme_md,'R') THEN DO
- SAY readme_md' opening failed!'
- EXIT
-END
-
-IF READCH(check_readme,18) = '# [ScummVM README]' THEN DO
- IF ~CLOSE(check_readme) THEN DO
- SAY readme_md' closing failed!'
- EXIT
- END
-END
-ELSE DO
- IF ~CLOSE(check_readme) THEN DO
- SAY readme_md' closing failed!'
- EXIT
- END
- SAY "Not the ScummVM README.md file. Aborting!"
- EXIT
-END
-
-IF ~OPEN(readme_read,readme_md,'R') THEN DO
- SAY 'File 'readme_md' opening failed!'
- EXIT
-END
-IF ~OPEN(guide_write,'README.guide','W') THEN DO
- SAY README.guide' opening failed!'
- EXIT
-END
-
-/*
-Prepare AmigaGuide file, add intro and fixed text.
-*/
-CALL WRITELN guide_write,'@DATABASE ScummVM README.guide'
-CALL WRITELN guide_write,'@$VER: ScummVM Readme 2.3.0git'
-CALL WRITELN guide_write,'@(C) by The ScummVM team'
-CALL WRITELN guide_write,'@AUTHOR The ScummVM team'
-CALL WRITELN guide_write,'@WORDWRAP'
-CALL WRITELN guide_write,'@NODE "main" "ScummVM README Guide"'
-CALL WRITELN guide_write,'@{b}'
-CALL WRITELN guide_write,SUBSTR(READLN(readme_read),4,14)
-CALL WRITELN guide_write,'@{ub}'
-
-/*
-Creating main (TOC) link nodes.
-*/
-
-DO WHILE EOF(readme_read) = 0
- working_line=READLN(readme_read)
-
- /*
- Check for start of actual content and, if available, leave TOC link loop.
- */
- IF POS('## <>1.0<>)',working_line) = 1 THEN
- LEAVE
-
- /*
- Check for any "rolled over" lines and, if available, read in the rest
- (on the following line) and rejoin them before processing any further.
- e.g. - [3.11) Flight of the Amazon Queen
- notes](#311-flight-of-the-amazon-queen-notes)
- */
- IF POS('- [<>',working_line) > 0 THEN DO
- IF POS('(#',working_line) = 0 THEN DO
- rejoin_line=COMPRESS(READLN(readme_read),' ')
- working_line=working_line rejoin_line
- END
- END
-
- /*
- If no chapter has been found, simply write the line and skip the rest.
- */
- IF POS('- [',working_line) = 0 THEN
- CALL WRITELN guide_write,working_line
- ELSE DO
- /*
- Fix empty chapters:
- Two chapters (1.0 and 7.8) are "empty", consisting of only it's
- chapter names. Link them to their respective sub chapters (1.1 and
- 7.8.1) to not display a blank page.
- If chapter 1.0 is found, add a link node to chapter 1.1.
- */
- IF POS(' - [<>1.0<>)',working_line) = 1 THEN DO
- /*
- Get rid of the markers, so the following loops won't process them
- again.
- */
- working_line=COMPRESS(working_line,'[<>')
- CALL WRITELN guide_write,' @{" 1.0 " Link "1.1"} 'SUBSTR(working_line,1,LASTPOS(']',working_line)-1)
- END
-
- /*
- If chapter 7.8 is found, add a link node to 7.8.1.
- */
- IF POS(' - [<>7.8<>)',working_line) = 1 THEN DO
- /*
- Get rid of the markers, so the following loops won't process them
- again.
- */
- working_line=COMPRESS(working_line,'[<>')
- CALL WRITELN guide_write,' @{" 7.8 " Link "7.8.1"} 'SUBSTR(working_line,1,LASTPOS(']',working_line)-1)
- END
-
- /*
- If a single number main chapter is found (1.0 upto 9.0), prepare and
- write the link node.
- Note:
- A "\" (backslash) is treated as escape character in AmigaGuides.
- Remove it from the node links.
- */
- IF POS('- [<>',working_line) = 3 THEN DO
- CALL WRITELN guide_write,' '
- CALL WRITELN guide_write,' @{" 'SUBSTR(working_line,POS('<>',working_line)+2,LASTPOS('<>',working_line)-POS('<>',working_line)-2) '" Link "'SUBSTR(working_line,POS('<>',working_line)+2,LASTPOS('<>',working_line)-POS('<>',working_line)-2)'"} 'COMPRESS(SUBSTR(working_line,1,LASTPOS(']',working_line)-1),'*<>[]\')
- /*
- Get rid of the markers, so the following loops won't process them
- again.
- */
- working_line=COMPRESS(working_line,'-[<>')
- END
-
- /*
- If a level one sub chapter is found (i.e. 1.1, 1.2 etc.), prepare and
- write the link node.
- */
- IF POS('- [<>',working_line) = 7 THEN DO
- CALL WRITELN guide_write,' @{" 'SUBSTR(working_line,POS('<>',working_line)+2,LASTPOS('<>',working_line)-POS('<>',working_line)-2) '" Link "'SUBSTR(working_line,POS('<>',working_line)+2,LASTPOS('<>',working_line)-POS('<>',working_line)-2)'"} 'COMPRESS(SUBSTR(working_line,1,LASTPOS(']',working_line)-1),'*<>[]\')
- /*
- Get rid of the markers, so the following loops won't process them
- again.
- */
- working_line=COMPRESS(working_line,'.[<>')
- END
-
- /*
- If a level two sub chapter is found (i.e. 3.6.1, 3.6.2 etc.), prepare
- and write the link node.
- */
- IF POS('- [<>',working_line) = 11 THEN DO
- CALL WRITELN guide_write,' @{" 'SUBSTR(working_line,POS('<>',working_line)+2,LASTPOS('<>',working_line)-POS('<>',working_line)-2) '" Link "'SUBSTR(working_line,POS('<>',working_line)+2,LASTPOS('<>',working_line)-POS('<>',working_line)-2)'"} 'COMPRESS(SUBSTR(working_line,1,LASTPOS(']',working_line)-1),'*<>[]\')
- /*
- Get rid of the markers, so the following loops won't process them
- again.
- */
- working_line=COMPRESS(working_line,'.[<>')
- END
- END
-END
-
-/*
-Finish TOC (hardcoded as the outro text would be read in last, but needs to
-be written after TOC creation finished).
-*/
-CALL WRITELN guide_write,'-----'
-CALL WRITELN guide_write,' '
-CALL WRITELN guide_write,'Good Luck and Happy Adventuring!'
-CALL WRITELN guide_write,'The ScummVM team.'
-CALL WRITELN guide_write,'@{"https://www.scummvm.org/" System "URLOpen https://www.scummvm.org/"}'
-
-/*
-Creating sub link nodes.
-*/
-DO WHILE EOF(readme_read) = 0
- /*
- Change html/markdown links to AmigaGuide ones.
- */
- IF POS('[here](',working_line) > 0 THEN DO
- working_line=INSERT('@{"',working_line,POS('[',working_line)-1)
- working_line=INSERT('" link ',working_line,POS(']',working_line))
- working_line=INSERT('/main}',working_line,POS(')',working_line))
- working_line=COMPRESS(working_line,'()')
- END
-
- /*
- If no chapter has been found, simply write the line and skip the rest.
- */
- IF POS('<>',working_line) = 0 THEN
- CALL WRITELN guide_write,working_line
- ELSE DO
- /*
- Fix empty chapters:
- Two chapters (1.0 and 7.8) are "empty", consisting of only it's
- chapter names. Link them to their respective sub chapters (1.1 and
- 7.8.1) to not display a blank page.
- If chapter 1.1 is found, don't close the NODE, just write the line.
- */
- IF POS('<>1.1<>',working_line) = 1 THEN DO
- /*
- Get rid of the markers, so the following loops won't process them
- again.
- */
- CALL WRITELN guide_write,COMPRESS(working_line,'<>')
- END
-
- /*
- If chapter 7.8.1 is found don't close the NODE, just write the line.
- */
- IF POS('<>7.8.1<>',working_line) = 1 THEN DO
- /*
- Get rid of the markers, so the following loops won't process them
- again.
- */
- CALL WRITELN guide_write,COMPRESS(working_line,'<>')
- END
-
- IF POS('<>',working_line) > 0 THEN DO
- /*
- Check for link references inside the text and create link nodes
- for them.
- */
- IF POS('section <>',working_line) > 0 THEN DO
- working_line=SUBSTR(working_line,1,POS('<>',working_line)-1)'@{"'SUBSTR(working_line,POS('<>',working_line)+2,LASTPOS('<>',working_line)-POS('<>',working_line)-2)'" Link "'SUBSTR(working_line,POS('<>',working_line)+2,LASTPOS('<>',working_line)-POS('<>',working_line)-2)'"}'SUBSTR(working_line,LASTPOS('<>',working_line)+2)
- /*
- Get rid of the markers, so the following loops won't process
- them again.
- */
- CALL WRITELN guide_write,COMPRESS(working_line,'<>')
- END
- ELSE DO
- /*
- If a chapter has been found, prepare and write the link node.
- */
- CALL WRITELN guide_write,'@ENDNODE'
- CALL WRITELN guide_write,'@NODE "'SUBSTR(working_line,POS('<>',working_line)+2,LASTPOS('<>',working_line)-POS('<>',working_line)-2)'" "'COMPRESS(working_line,'<>#')'"'
- CALL WRITELN guide_write,' '
- /*
- Get rid of the markers, so the following loops won't process
- them again.
- */
- CALL WRITELN guide_write,COMPRESS(working_line,'<>')
- END
- END
- END
- /*
- Read in the line at the end of the second loop, as the first line to work
- with was already read in on the end of the first loop.
- */
- working_line=READLN(readme_read)
-
- /*
- If the outtro text has been found, leave loop and prepare for closing.
- */
- IF WORD(working_line,1) = '-----' THEN
- LEAVE
-END
-
-CALL WRITELN guide_write,'@ENDNODE'
-
-/*
-Close guide and clean up.
-*/
-CALL WRITELN guide_write,'@ENDNODE'
-
-IF ~CLOSE(readme_read) THEN DO
- SAY readme_md' closing failed!'
- EXIT
-END
-IF ~CLOSE(guide_write) THEN DO
- SAY 'README.guide closing failed!'
- EXIT
-END
-
-/*
-Install finished README.guide to installation path and delete it on closure.
-*/
-ADDRESS COMMAND 'copy clone quiet README.guide 'install_path
-ADDRESS COMMAND 'delete force quiet README.guide'
-
-EXIT
diff --git a/dists/amigaos/RM2AG.rexx.in b/dists/amigaos/RM2AG.rexx.in
deleted file mode 100644
index a5f5d537b3..0000000000
--- a/dists/amigaos/RM2AG.rexx.in
+++ /dev/null
@@ -1,313 +0,0 @@
-/*
-$VER: RM2AG.rexx 0.25 (09.01.2021) README (.md) to .guide converter.
-Converts the ScummVM markdown README file to a basic hypertext AmigaGuide
-file and installs it to the given path.
-*/
-
-PARSE ARG readme_md install_path
-
-/*
-Check if arguments are available, otherwise quit.
-*/
-IF ~ARG() THEN DO
- SAY 'No Arguments given!'
- SAY 'Usage: RM2AG.rexx README_MD INSTALL_PATH'
- EXIT
-END
-
-/*
-If the given filename/path has spaces in it, AmigaDOS/CLI will add extra
-quotation marks to secure a sane working path.
-Get rid of them to make AREXX find the file and remove leading and trailing
-spaces.
-*/
-IF ~EXISTS(readme_md) THEN DO
- SAY readme_md' not available!'
- EXIT
-END
-ELSE DO
- readme_md=STRIP(readme_md)
- readme_md=COMPRESS(readme_md,'"')
-END
-IF installpath='' THEN DO
- SAY 'No installation destination given!'
- EXIT
-END
-ELSE DO
- install_path=STRIP(install_path)
- install_path=STRIP(install_path,'T','/')
- install_path=COMPRESS(install_path,'"')
- /*
- Check for destination path and create it, if needed.
- */
- IF ~EXISTS(install_path'/') THEN
- ADDRESS COMMAND 'makedir all 'install_path
-END
-
-IF ~OPEN(check_readme,readme_md,'R') THEN DO
- SAY readme_md' opening failed!'
- EXIT
-END
-
-IF READCH(check_readme,18) = '# [ScummVM README]' THEN DO
- IF ~CLOSE(check_readme) THEN DO
- SAY readme_md' closing failed!'
- EXIT
- END
-END
-ELSE DO
- IF ~CLOSE(check_readme) THEN DO
- SAY readme_md' closing failed!'
- EXIT
- END
- SAY "Not the ScummVM README.md file. Aborting!"
- EXIT
-END
-
-IF ~OPEN(readme_read,readme_md,'R') THEN DO
- SAY 'File 'readme_md' opening failed!'
- EXIT
-END
-IF ~OPEN(guide_write,'README.guide','W') THEN DO
- SAY README.guide' opening failed!'
- EXIT
-END
-
-/*
-Prepare AmigaGuide file, add intro and fixed text.
-*/
-CALL WRITELN guide_write,'@DATABASE ScummVM README.guide'
-CALL WRITELN guide_write,'@$VER: ScummVM Readme @VERSION@'
-CALL WRITELN guide_write,'@(C) by The ScummVM team'
-CALL WRITELN guide_write,'@AUTHOR The ScummVM team'
-CALL WRITELN guide_write,'@WORDWRAP'
-CALL WRITELN guide_write,'@NODE "main" "ScummVM README Guide"'
-CALL WRITELN guide_write,'@{b}'
-CALL WRITELN guide_write,SUBSTR(READLN(readme_read),4,14)
-CALL WRITELN guide_write,'@{ub}'
-
-/*
-Creating main (TOC) link nodes.
-*/
-
-DO WHILE EOF(readme_read) = 0
- working_line=READLN(readme_read)
-
- /*
- Check for start of actual content and, if available, leave TOC link loop.
- */
- IF POS('## <>1.0<>)',working_line) = 1 THEN
- LEAVE
-
- /*
- Check for any "rolled over" lines and, if available, read in the rest
- (on the following line) and rejoin them before processing any further.
- e.g. - [3.11) Flight of the Amazon Queen
- notes](#311-flight-of-the-amazon-queen-notes)
- */
- IF POS('- [<>',working_line) > 0 THEN DO
- IF POS('(#',working_line) = 0 THEN DO
- rejoin_line=COMPRESS(READLN(readme_read),' ')
- working_line=working_line rejoin_line
- END
- END
-
- /*
- If no chapter has been found, simply write the line and skip the rest.
- */
- IF POS('- [',working_line) = 0 THEN
- CALL WRITELN guide_write,working_line
- ELSE DO
- /*
- Fix empty chapters:
- Two chapters (1.0 and 7.8) are "empty", consisting of only it's
- chapter names. Link them to their respective sub chapters (1.1 and
- 7.8.1) to not display a blank page.
- If chapter 1.0 is found, add a link node to chapter 1.1.
- */
- IF POS(' - [<>1.0<>)',working_line) = 1 THEN DO
- /*
- Get rid of the markers, so the following loops won't process them
- again.
- */
- working_line=COMPRESS(working_line,'[<>')
- CALL WRITELN guide_write,' @{" 1.0 " Link "1.1"} 'SUBSTR(working_line,1,LASTPOS(']',working_line)-1)
- END
-
- /*
- If chapter 7.8 is found, add a link node to 7.8.1.
- */
- IF POS(' - [<>7.8<>)',working_line) = 1 THEN DO
- /*
- Get rid of the markers, so the following loops won't process them
- again.
- */
- working_line=COMPRESS(working_line,'[<>')
- CALL WRITELN guide_write,' @{" 7.8 " Link "7.8.1"} 'SUBSTR(working_line,1,LASTPOS(']',working_line)-1)
- END
-
- /*
- If a single number main chapter is found (1.0 upto 9.0), prepare and
- write the link node.
- Note:
- A "\" (backslash) is treated as escape character in AmigaGuides.
- Remove it from the node links.
- */
- IF POS('- [<>',working_line) = 3 THEN DO
- CALL WRITELN guide_write,' '
- CALL WRITELN guide_write,' @{" 'SUBSTR(working_line,POS('<>',working_line)+2,LASTPOS('<>',working_line)-POS('<>',working_line)-2) '" Link "'SUBSTR(working_line,POS('<>',working_line)+2,LASTPOS('<>',working_line)-POS('<>',working_line)-2)'"} 'COMPRESS(SUBSTR(working_line,1,LASTPOS(']',working_line)-1),'*<>[]\')
- /*
- Get rid of the markers, so the following loops won't process them
- again.
- */
- working_line=COMPRESS(working_line,'-[<>')
- END
-
- /*
- If a level one sub chapter is found (i.e. 1.1, 1.2 etc.), prepare and
- write the link node.
- */
- IF POS('- [<>',working_line) = 7 THEN DO
- CALL WRITELN guide_write,' @{" 'SUBSTR(working_line,POS('<>',working_line)+2,LASTPOS('<>',working_line)-POS('<>',working_line)-2) '" Link "'SUBSTR(working_line,POS('<>',working_line)+2,LASTPOS('<>',working_line)-POS('<>',working_line)-2)'"} 'COMPRESS(SUBSTR(working_line,1,LASTPOS(']',working_line)-1),'*<>[]\')
- /*
- Get rid of the markers, so the following loops won't process them
- again.
- */
- working_line=COMPRESS(working_line,'.[<>')
- END
-
- /*
- If a level two sub chapter is found (i.e. 3.6.1, 3.6.2 etc.), prepare
- and write the link node.
- */
- IF POS('- [<>',working_line) = 11 THEN DO
- CALL WRITELN guide_write,' @{" 'SUBSTR(working_line,POS('<>',working_line)+2,LASTPOS('<>',working_line)-POS('<>',working_line)-2) '" Link "'SUBSTR(working_line,POS('<>',working_line)+2,LASTPOS('<>',working_line)-POS('<>',working_line)-2)'"} 'COMPRESS(SUBSTR(working_line,1,LASTPOS(']',working_line)-1),'*<>[]\')
- /*
- Get rid of the markers, so the following loops won't process them
- again.
- */
- working_line=COMPRESS(working_line,'.[<>')
- END
- END
-END
-
-/*
-Finish TOC (hardcoded as the outro text would be read in last, but needs to
-be written after TOC creation finished).
-*/
-CALL WRITELN guide_write,'-----'
-CALL WRITELN guide_write,' '
-CALL WRITELN guide_write,'Good Luck and Happy Adventuring!'
-CALL WRITELN guide_write,'The ScummVM team.'
-CALL WRITELN guide_write,'@{"https://www.scummvm.org/" System "URLOpen https://www.scummvm.org/"}'
-
-/*
-Creating sub link nodes.
-*/
-DO WHILE EOF(readme_read) = 0
- /*
- Change html/markdown links to AmigaGuide ones.
- */
- IF POS('[here](',working_line) > 0 THEN DO
- working_line=INSERT('@{"',working_line,POS('[',working_line)-1)
- working_line=INSERT('" link ',working_line,POS(']',working_line))
- working_line=INSERT('/main}',working_line,POS(')',working_line))
- working_line=COMPRESS(working_line,'()')
- END
-
- /*
- If no chapter has been found, simply write the line and skip the rest.
- */
- IF POS('<>',working_line) = 0 THEN
- CALL WRITELN guide_write,working_line
- ELSE DO
- /*
- Fix empty chapters:
- Two chapters (1.0 and 7.8) are "empty", consisting of only it's
- chapter names. Link them to their respective sub chapters (1.1 and
- 7.8.1) to not display a blank page.
- If chapter 1.1 is found, don't close the NODE, just write the line.
- */
- IF POS('<>1.1<>',working_line) = 1 THEN DO
- /*
- Get rid of the markers, so the following loops won't process them
- again.
- */
- CALL WRITELN guide_write,COMPRESS(working_line,'<>')
- END
-
- /*
- If chapter 7.8.1 is found don't close the NODE, just write the line.
- */
- IF POS('<>7.8.1<>',working_line) = 1 THEN DO
- /*
- Get rid of the markers, so the following loops won't process them
- again.
- */
- CALL WRITELN guide_write,COMPRESS(working_line,'<>')
- END
-
- IF POS('<>',working_line) > 0 THEN DO
- /*
- Check for link references inside the text and create link nodes
- for them.
- */
- IF POS('section <>',working_line) > 0 THEN DO
- working_line=SUBSTR(working_line,1,POS('<>',working_line)-1)'@{"'SUBSTR(working_line,POS('<>',working_line)+2,LASTPOS('<>',working_line)-POS('<>',working_line)-2)'" Link "'SUBSTR(working_line,POS('<>',working_line)+2,LASTPOS('<>',working_line)-POS('<>',working_line)-2)'"}'SUBSTR(working_line,LASTPOS('<>',working_line)+2)
- /*
- Get rid of the markers, so the following loops won't process
- them again.
- */
- CALL WRITELN guide_write,COMPRESS(working_line,'<>')
- END
- ELSE DO
- /*
- If a chapter has been found, prepare and write the link node.
- */
- CALL WRITELN guide_write,'@ENDNODE'
- CALL WRITELN guide_write,'@NODE "'SUBSTR(working_line,POS('<>',working_line)+2,LASTPOS('<>',working_line)-POS('<>',working_line)-2)'" "'COMPRESS(working_line,'<>#')'"'
- CALL WRITELN guide_write,' '
- /*
- Get rid of the markers, so the following loops won't process
- them again.
- */
- CALL WRITELN guide_write,COMPRESS(working_line,'<>')
- END
- END
- END
- /*
- Read in the line at the end of the second loop, as the first line to work
- with was already read in on the end of the first loop.
- */
- working_line=READLN(readme_read)
-
- /*
- If the outtro text has been found, leave loop and prepare for closing.
- */
- IF WORD(working_line,1) = '-----' THEN
- LEAVE
-END
-
-CALL WRITELN guide_write,'@ENDNODE'
-
-/*
-Close guide and clean up.
-*/
-CALL WRITELN guide_write,'@ENDNODE'
-
-IF ~CLOSE(readme_read) THEN DO
- SAY readme_md' closing failed!'
- EXIT
-END
-IF ~CLOSE(guide_write) THEN DO
- SAY 'README.guide closing failed!'
- EXIT
-END
-
-/*
-Install finished README.guide to installation path and delete it on closure.
-*/
-ADDRESS COMMAND 'copy clone quiet README.guide 'install_path
-ADDRESS COMMAND 'delete force quiet README.guide'
-
-EXIT
diff --git a/dists/amigaos/convertRM.sed b/dists/amigaos/convertRM.sed
deleted file mode 100644
index 405d17879d..0000000000
--- a/dists/amigaos/convertRM.sed
+++ /dev/null
@@ -1,17 +0,0 @@
-# $VER: READMEconverter.sed 1.05 (25.01.2018) © Eugene "sev" Sandulenko
-# Additions and changes by Raziel
-#
-# Preprocessing the README file and adding some markers for easier parsing
-# and later converting it to an AmigaGuide Hypertext file.
-#
-s/http:\/\/[#?=&a-zA-Z0-9_.\/\-]*/@{"&" System "URLOpen &"}/ # Convert all URLs to AmigaGuide format
-s/https:\/\/[#?=&a-zA-Z0-9_.\/\-]*/@{"&" System "URLOpen &"}/ # Convert all secure URLs to AmigaGuide format
-s/[0-9][0-9]*\.[0-9][0-9]*/<>&<>/ # Convert all chapter numbers to <>x<>...
-s/<>\([0-9][0-9]*\.[0-9][0-9]*\)<>\(\.[0-9]\)/<>\1\2<>/ # ...and all three-digit chapter numbers...
-s/<>\([01]\.[0-9][0-9]*\.[0-9][0-9]*\)<>/\1/ # ...and restore mentioned version numbers like 1.0.0 and 0.7.0.
-s/of <>0\.0<>/of 0.0/ # "Fluidsynth's gain setting of 0.0" is not a chapter reference.
-s/through <>10\.0<>/through 10.0/ # "through 10.0" is not a chapter reference.
-s/ttf-<>2\.00.1<>/ttf-2.00.1/ # This part of an url link is not a chapter reference.
-s/patch <>1\.2<>/patch 1.2/ # "Zork patch 1.2" is not a chapter reference.
-s/Mac OS X <>10\.2.8<>/Mac OS X 10.2.8/ # "Mac OS X 10.2.8" is not a chapter reference.
-s/Mac_OS_X_<>10\.2.8<>/Mac_OS_X_10.2.8/ # "Mac_OS_X_10.2.8" is not a chapter reference.
diff --git a/dists/amigaos/md2ag.rexx b/dists/amigaos/md2ag.rexx
new file mode 100644
index 0000000000..774c055ada
--- /dev/null
+++ b/dists/amigaos/md2ag.rexx
@@ -0,0 +1,159 @@
+/*
+$VER: md2ag.rexx 0.1 (25.05.2021) README(.md) to (amiga).guide converter.
+Converts a given markdown README file to a basic hypertext Amiga guide file
+and installs it to a given location.
+*/
+
+PARSE ARG p_readme p_instpath
+
+/*
+Check if arguments are available, otherwise quit.
+*/
+IF ~ARG() THEN DO
+ SAY 'No Arguments given!'
+ SAY 'Usage: md2ag.rexx README.md INSTALLPATH'
+ EXIT
+END
+
+/*
+If the given filename/path has spaces in it, AmigaDOS/CLI
+will add extra quotation marks to secure a sane working path.
+Get rid of them to make AREXX find the file and remove leading
+and trailing spaces.
+*/
+IF ~EXISTS(p_readme) THEN DO
+ SAY p_readme' not available!'
+ EXIT
+END
+ELSE DO
+ p_readme=STRIP(p_readme)
+ p_readme=COMPRESS(p_readme,'"')
+END
+IF p_instpath='' THEN DO
+ SAY 'No installation destination given!'
+ EXIT
+END
+ELSE DO
+ p_instpath=STRIP(p_instpath)
+ p_instpath=STRIP(p_instpath,'T','/')
+ p_instpath=COMPRESS(p_instpath,'"')
+END
+
+/*
+Convert README.md to ASCII to get rid of non-displayable characters.
+*/
+ADDRESS COMMAND 'iconv -f UTF-8 -t ASCII//TRANSLIT 'p_readme' >README.conv'
+
+CALL OPEN read_md,'README.conv','R'
+
+IF READCH(read_md,18)~='# [ScummVM README]' THEN DO
+ CALL CLOSE read_md
+ SAY p_readme' is not the ScummVM README.md file. Aborting!'
+ EXIT
+END
+ELSE
+ /*
+ Skip the first "Build Status" line.
+ */
+ CALL READLN read_md
+
+CALL OPEN write_guide,'README.guide','W'
+
+/*
+Prepare Amiga guide, add intro and fixed text.
+*/
+CALL WRITELN write_guide,'@DATABASE ScummVM README.guide'
+CALL WRITELN write_guide,'@$VER: ScummVM Readme 2.3.0git'
+CALL WRITELN write_guide,'@(C) by The ScummVM team'
+CALL WRITELN write_guide,'@AUTHOR The ScummVM team'
+CALL WRITELN write_guide,'@WORDWRAP'
+CALL WRITELN write_guide,'@NODE "main" "ScummVM README Guide"'
+CALL WRITELN write_guide,'@{b}'
+CALL WRITELN write_guide,'ScummVM README'
+CALL WRITELN write_guide,'@{ub}'
+
+DO WHILE ~EOF(read_md)
+ v_line=READLN(read_md)
+
+ /*
+ Handle one rolled over line that cuts a weblink.
+ Lines 11, 12 and 13 in the original .md file hold a weblink which is cut short.
+ Rejoin lines 12 and 13 to fix the otherwise cut link.
+ Lines are:
+ "latest release, progress reports and more, please visit the ScummVM [home
+ page](https://www.scummvm.org/)"
+ */
+ IF POS('[',v_line)>0 THEN DO
+ IF POS(']',v_line)=0 THEN DO
+ rejoin_line=READLN(read_md)
+ v_line=v_line''rejoin_line
+ END
+ END
+
+ /*
+ Change local markdown links to AmigaGuide ones.
+ */
+ IF POS('[here](',v_line)>0 THEN DO
+ v_locallink=SUBSTR(v_line,POS('(',v_line)+1,POS(')',v_line)-POS('(',v_line)-1)
+ v_line=DELSTR(v_line,POS('(',v_line)+1,POS(')',v_line)-POS('(',v_line)-1)
+ v_line=INSERT('@{"'v_locallink'" link 'v_locallink'/main}',v_line,POS(']',v_line)+1)
+ END
+
+ /*
+ Change html markdown links to AmigaGuide ones.
+ */
+ IF POS('http',v_line)>0 THEN DO
+ v_protocol=UPPER(SUBSTR(v_line,POS('http',v_line),POS('://',v_line)-POS('http',v_line)))
+ IF POS('(http',v_line)>0 THEN DO
+ v_weblink=SUBSTR(v_line,POS('(',v_line)+1,POS(')',v_line)-POS('(',v_line)-1)
+ v_weblink=COMPRESS(v_weblink,'>')
+ v_line=DELSTR(v_line,POS('(',v_line)+1,POS(')',v_line)-POS('(',v_line)-1)
+ v_line=INSERT('@{"'v_weblink'" System "URLOpen 'v_protocol' 'v_weblink'"}',v_line,POS(']',v_line)+1)
+ END
+ ELSE DO
+ v_weblink=SUBSTR(v_line,LASTPOS('<',v_line)+1,LASTPOS('/>',v_line)-LASTPOS('<',v_line)-1)
+ v_line=DELSTR(v_line,LASTPOS('<',v_line)+1,LASTPOS('>',v_line)-LASTPOS('<',v_line)-1)
+ v_line=INSERT('@{"'v_weblink'" System "URLOpen 'v_weblink'"}',v_line,LASTPOS('>',v_line)-1)
+ END
+ END
+
+ /*
+ Make the "[]" links stand out.
+ */
+ IF POS('[',v_line)>0 THEN DO
+ v_line=INSERT('@{b}',v_line,POS('[',v_line)-1)
+ v_line=INSERT('@{ub} ',v_line,POS(']',v_line))
+ END
+
+ /*
+ There is one long line with two weblinks.
+ */
+ IF POS('[Supported Games]',v_line)>0 THEN DO
+ v_protocol=UPPER(SUBSTR(v_line,LASTPOS('http',v_line),LASTPOS('://',v_line)-LASTPOS('http',v_line)))
+ v_weblink=SUBSTR(v_line,LASTPOS('(',v_line)+1,LASTPOS(')',v_line)-LASTPOS('(',v_line)-1)
+ v_weblink=COMPRESS(v_weblink,'>')
+ v_line=DELSTR(v_line,LASTPOS('(',v_line)+1,LASTPOS(')',v_line)-LASTPOS('(',v_line)-1)
+ v_line=INSERT('@{"'v_weblink'" System "URLOpen 'v_protocol' 'v_weblink'"}',v_line,LASTPOS(']',v_line)+1)
+ v_line=INSERT('@{b}',v_line,LASTPOS('[',v_line)-1)
+ v_line=INSERT('@{ub} ',v_line,LASTPOS(']',v_line))
+ END
+
+ CALL WRITELN write_guide,v_line
+END
+
+/*
+Close guide and clean up.
+*/
+CALL WRITELN write_guide,'@ENDNODE'
+
+CALL CLOSE read_md
+CALL CLOSE write_guide
+
+/*
+Install finished README.guide to installation path and delete README.guide.
+*/
+ADDRESS COMMAND 'copy README.guide 'p_instpath
+ADDRESS COMMAND 'delete quiet README.guide'
+ADDRESS COMMAND 'delete quiet README.conv'
+
+EXIT
diff --git a/dists/amigaos/md2ag.rexx.in b/dists/amigaos/md2ag.rexx.in
new file mode 100644
index 0000000000..f46de0328a
--- /dev/null
+++ b/dists/amigaos/md2ag.rexx.in
@@ -0,0 +1,159 @@
+/*
+$VER: md2ag.rexx 0.1 (25.05.2021) README(.md) to (amiga).guide converter.
+Converts a given markdown README file to a basic hypertext Amiga guide file
+and installs it to a given location.
+*/
+
+PARSE ARG p_readme p_instpath
+
+/*
+Check if arguments are available, otherwise quit.
+*/
+IF ~ARG() THEN DO
+ SAY 'No Arguments given!'
+ SAY 'Usage: md2ag.rexx README.md INSTALLPATH'
+ EXIT
+END
+
+/*
+If the given filename/path has spaces in it, AmigaDOS/CLI
+will add extra quotation marks to secure a sane working path.
+Get rid of them to make AREXX find the file and remove leading
+and trailing spaces.
+*/
+IF ~EXISTS(p_readme) THEN DO
+ SAY p_readme' not available!'
+ EXIT
+END
+ELSE DO
+ p_readme=STRIP(p_readme)
+ p_readme=COMPRESS(p_readme,'"')
+END
+IF p_instpath='' THEN DO
+ SAY 'No installation destination given!'
+ EXIT
+END
+ELSE DO
+ p_instpath=STRIP(p_instpath)
+ p_instpath=STRIP(p_instpath,'T','/')
+ p_instpath=COMPRESS(p_instpath,'"')
+END
+
+/*
+Convert README.md to ASCII to get rid of non-displayable characters.
+*/
+ADDRESS COMMAND 'iconv -f UTF-8 -t ASCII//TRANSLIT 'p_readme' >README.conv'
+
+CALL OPEN read_md,'README.conv','R'
+
+IF READCH(read_md,18)~='# [ScummVM README]' THEN DO
+ CALL CLOSE read_md
+ SAY p_readme' is not the ScummVM README.md file. Aborting!'
+ EXIT
+END
+ELSE
+ /*
+ Skip the first "Build Status" line.
+ */
+ CALL READLN read_md
+
+CALL OPEN write_guide,'README.guide','W'
+
+/*
+Prepare Amiga guide, add intro and fixed text.
+*/
+CALL WRITELN write_guide,'@DATABASE ScummVM README.guide'
+CALL WRITELN write_guide,'@$VER: ScummVM Readme @VERSION@'
+CALL WRITELN write_guide,'@(C) by The ScummVM team'
+CALL WRITELN write_guide,'@AUTHOR The ScummVM team'
+CALL WRITELN write_guide,'@WORDWRAP'
+CALL WRITELN write_guide,'@NODE "main" "ScummVM README Guide"'
+CALL WRITELN write_guide,'@{b}'
+CALL WRITELN write_guide,'ScummVM README'
+CALL WRITELN write_guide,'@{ub}'
+
+DO WHILE ~EOF(read_md)
+ v_line=READLN(read_md)
+
+ /*
+ Handle one rolled over line that cuts a weblink.
+ Lines 11, 12 and 13 in the original .md file hold a weblink which is cut short.
+ Rejoin lines 12 and 13 to fix the otherwise cut link.
+ Lines are:
+ "latest release, progress reports and more, please visit the ScummVM [home
+ page](https://www.scummvm.org/)"
+ */
+ IF POS('[',v_line)>0 THEN DO
+ IF POS(']',v_line)=0 THEN DO
+ rejoin_line=READLN(read_md)
+ v_line=v_line''rejoin_line
+ END
+ END
+
+ /*
+ Change local markdown links to AmigaGuide ones.
+ */
+ IF POS('[here](',v_line)>0 THEN DO
+ v_locallink=SUBSTR(v_line,POS('(',v_line)+1,POS(')',v_line)-POS('(',v_line)-1)
+ v_line=DELSTR(v_line,POS('(',v_line)+1,POS(')',v_line)-POS('(',v_line)-1)
+ v_line=INSERT('@{"'v_locallink'" link 'v_locallink'/main}',v_line,POS(']',v_line)+1)
+ END
+
+ /*
+ Change html markdown links to AmigaGuide ones.
+ */
+ IF POS('http',v_line)>0 THEN DO
+ v_protocol=UPPER(SUBSTR(v_line,POS('http',v_line),POS('://',v_line)-POS('http',v_line)))
+ IF POS('(http',v_line)>0 THEN DO
+ v_weblink=SUBSTR(v_line,POS('(',v_line)+1,POS(')',v_line)-POS('(',v_line)-1)
+ v_weblink=COMPRESS(v_weblink,'>')
+ v_line=DELSTR(v_line,POS('(',v_line)+1,POS(')',v_line)-POS('(',v_line)-1)
+ v_line=INSERT('@{"'v_weblink'" System "URLOpen 'v_protocol' 'v_weblink'"}',v_line,POS(']',v_line)+1)
+ END
+ ELSE DO
+ v_weblink=SUBSTR(v_line,LASTPOS('<',v_line)+1,LASTPOS('/>',v_line)-LASTPOS('<',v_line)-1)
+ v_line=DELSTR(v_line,LASTPOS('<',v_line)+1,LASTPOS('>',v_line)-LASTPOS('<',v_line)-1)
+ v_line=INSERT('@{"'v_weblink'" System "URLOpen 'v_weblink'"}',v_line,LASTPOS('>',v_line)-1)
+ END
+ END
+
+ /*
+ Make the "[]" links stand out.
+ */
+ IF POS('[',v_line)>0 THEN DO
+ v_line=INSERT('@{b}',v_line,POS('[',v_line)-1)
+ v_line=INSERT('@{ub} ',v_line,POS(']',v_line))
+ END
+
+ /*
+ There is one long line with two weblinks.
+ */
+ IF POS('[Supported Games]',v_line)>0 THEN DO
+ v_protocol=UPPER(SUBSTR(v_line,LASTPOS('http',v_line),LASTPOS('://',v_line)-LASTPOS('http',v_line)))
+ v_weblink=SUBSTR(v_line,LASTPOS('(',v_line)+1,LASTPOS(')',v_line)-LASTPOS('(',v_line)-1)
+ v_weblink=COMPRESS(v_weblink,'>')
+ v_line=DELSTR(v_line,LASTPOS('(',v_line)+1,LASTPOS(')',v_line)-LASTPOS('(',v_line)-1)
+ v_line=INSERT('@{"'v_weblink'" System "URLOpen 'v_protocol' 'v_weblink'"}',v_line,LASTPOS(']',v_line)+1)
+ v_line=INSERT('@{b}',v_line,LASTPOS('[',v_line)-1)
+ v_line=INSERT('@{ub} ',v_line,LASTPOS(']',v_line))
+ END
+
+ CALL WRITELN write_guide,v_line
+END
+
+/*
+Close guide and clean up.
+*/
+CALL WRITELN write_guide,'@ENDNODE'
+
+CALL CLOSE read_md
+CALL CLOSE write_guide
+
+/*
+Install finished README.guide to installation path and delete README.guide.
+*/
+ADDRESS COMMAND 'copy README.guide 'p_instpath
+ADDRESS COMMAND 'delete quiet README.guide'
+ADDRESS COMMAND 'delete quiet README.conv'
+
+EXIT
More information about the Scummvm-git-logs
mailing list