Page 1 of 1

Preparing the UI

Posted: Tue Feb 15, 2022 11:37 pm UTC
by SuperDupont
Hi!

I started working on a gAWK script, to help create web page from UI to view on web browser.

Actually, the script only search and duplicate with new extension all files with extension .rml and .rcss to make .html and .css respectively.

This script intend to be run in /pkg/unvanquished_src.dpkdir/ui/

Code: Select all

#!/bin/awk
# By SuperDupont
# 2022.02.16
# Work in progress
# Version 0.2
# Licence : Creative Commons Attribution Share Alike 
function namefile(file) {
	sub(".*/", "", file)
	return file
}

function notlastpart(path,delimit) { # This function is used by pathfile and extname
	# init
	split("",tab)
	split(path,tab,delimit)
	path = ""
	#The last part won't be keep
	for (i=1;i<=length(tab)-1;++i){
		path = path tab[i] delimit
	}
	return path
}
function pathfile(file) {
	return notlastpart(file,"/")
}
function extname(file) {
	return notlastpart(file,".")
}
function searchingfile(ext) {
	# init
	split("",listfiles)
	print "Searching files... (*." ext ")"
	cmd = "find . -type f -iname '*." ext "' -printf '%h/%f;'"
	cmd | getline liste ; close("cmd")
	split(liste,lfiles,";")
	for (indexvar in lfiles) {
		realpath = lfiles[indexvar]
		if (realpath != "") {
			print "Preparing file ",indexvar," : ",realpath
			listfiles[indexvar] = realpath
		}
	}
	return
}
function copy2ext(file,ext) {
		filename = namefile(file)
		shortname = extname(filename)
		path = pathfile(file)
		target = path shortname ext
		print "$: cp " file " -> " target
		cmd = "cp " file " " target
		system(cmd)
}
BEGIN{
	#print "Searching files... (*.rml *.rcss)"
	# Les tableaux des fichiers rml et rcss
	# cmd = "find . -type f -iname '*.rml' -printf '%h/%f;'"
	# cmd | getline liste ; close("cmd")
	searchingfile("rml")
	print "Copying files with new extension"
	for (indexvar in listfiles) {
		file = listfiles[indexvar]
		print "file ",indexvar," : ",file
		copy2ext(file,"html")
	}
	

	searchingfile("rcss")
	print "Copying files with new extension"
	for (indexvar in listfiles) {
		file = listfiles[indexvar]
		print "file ",indexvar," : ",file
		copy2ext(file,"css")
	}
	
	
	
	exit
}
#=patern={
#}
END{
}

Re: Preparing the UI

Posted: Wed Feb 16, 2022 11:12 am UTC
by SuperDupont

Re: Preparing the UI

Posted: Wed Feb 16, 2022 7:39 pm UTC
by killing time
I tried it on help_gameplay.rml and it looks like mostly unformatted text, I guess because imports aren't implemented.

The libRocket/RmlUi CSS engines don't adhere very closely to the CSS standard, so unfortunately there are too many differences between them and browsers for working in a browser to be a useful development methodology.

Re: Preparing the UI

Posted: Tue Mar 08, 2022 1:26 pm UTC
by SuperDupont
I wrote there is ever a tool for this :

https://mikke89.github.io/RmlUiDoc/page ... cmake.html
https://mikke89.github.io/RmlUiDoc/index.html

So, I stopped what I started to do. There is ever a tool for this. Isn't it?