The Colorer_lib (*.pb TO color *.xhtml+CSS)

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
User avatar
dobro
Enthusiast
Enthusiast
Posts: 766
Joined: Sun Oct 31, 2004 10:54 am
Location: France
Contact:

The Colorer_lib (*.pb TO color *.xhtml+CSS)

Post by dobro »

in french :
suite a une demande de Droopy
qui a besoin de convertir des fichiers *.pb en Xhtml

j'ai fait une version de colorer en librairie

cette lib ne contient qu'une seule fonction !

Colorer(fichier$,Style$,cadre)

fichier$ = le chemin+le nom du fichier *.pb a convertir
Style$ = le chemin+le nom du fichier de Style (themes) !
cadre = si superieur a 0 ajoute un cadre de l'epaisseur specifié
cette fonction va colorer le code du fichier *.pb , respecter l'indentation , et générer un fichier Xhtml du meme nom , au meme endroit ainsi qu'un fichier CSS du meme nom !!
ça respect la norme W3C ;)

Style$ est un fichier txt qui contient la palette de couleurs , c'est ce qui va servir
a colorer le fond de la page en jaune, ou les procédures en bleu... par exemple

pour fabriquer ce fichier de style (le themes donc) on peut en faire plusieurs avec diffèrent noms bien sur....
je fourni un petit Exe "Creatheme.exe" , qui sert a ça :)
c'est donc le nom du fichier generé par creatheme qu'il faut renseigner dans la fonction :)

ça parait compliqué a lire, mais c'est tres simple :)

le fait d'avoir fait une fonction qui permet la coloration d'un Pb et la generation de son équivalent en fichier html
permet facilement d'utiliser cette fonction pour faire de la conversion batch ...

a récuperer ici :
http://michel.dobro.free.fr/download.php?view.21

la lib est a poser dans le dossier ...\PureLibraries\UserLibraries\
un exemple d'appel de la lib est fourni ainsi que Creathemes.exe


l'exemple :

Code: Select all


fichier$=OpenFileRequester("ouvre un *.pb","","*.pb",1) ; cherche a ouvrir un fichier *.pb

;Style$="C:\style\style_black.txt" ; chemin du style
Style$="C:\style\style_test.txt" ; chemin du style
Colorer(fichier$,Style$) ; appel la lib qui va colorer le fichier pb et le mettre en forme, et generer un fichier html

si vous voulez avoir une idée du rendu
voici ce que ça donne sur un code a Comtois

http://michel.dobro.free.fr/droopy/raster2.htm


ps : 2eme avantage kiss kool , ça permet ensuite d'imprimer facilement vos listing en couleur !!
vu que c'est du html ;)

********************************************************************
********************************************************************
********************************************************************

Google translate hum ! :


Following a request Droopy
who needs to convert the *. bp to Xhtml

I made a colorer version in library

lib that contains only one function!

Colorer(file$,Style$,cadre)

file$ = path + filename *. pb convert
Style$ = path + filename of Style (themes !)

cadre = if > 0 add an cadre de l'epaisseur specifié

this function will color code the file *. pb, respect the indentation, and generate an XHTML file with the same name, in the same place and a CSS file of the same name!
this respect the W3C standard;)

Style$ is a txt file that contains the color palette, this is what will serve
to color the page background in yellow, blue or procedures ,constante,api,etc ... eg

to make this style file (the theme so) we can make several with different names of course ....
I provided a small exe "Creatheme.exe" which is used to it:)
so this is the name of the file generated by creatheme need information in it:)

it seems complicated to read, but it is very simple:)

having made a function that allows the coloration of a generation of Pb and its equivalent in html file
can easily use this to make batch conversion ...

to retrieve here:
http://michel.dobro.free.fr/download.php?view.21

the lib is a place in the ... \ PureLibraries \ UserLibraries \
an example of calling the lib is provided and Creathemes.exe


Example:

Code: Select all


fichier$=OpenFileRequester("ouvre un *.pb","","*.pb",1) ; open a file : *.pb

;Style$="C:\style\style_black.txt" ;path of  style (theme)
Style$="C:\style\style_test.txt" ;path of  style (theme)
Colorer(fichier$,Style$) ; appel la lib qui va colorer le fichier pb et le mettre en forme, et generer un fichier htm
if you have an idea of rendering
here is what happens on a code Comtois

http://michel.dobro.free.fr/droopy/raster2.htm

:)


ps: 2nd kiss kool advantage, then it can easily print your listing in color!
because it's html)
Last edited by dobro on Thu Feb 03, 2011 5:51 pm, edited 1 time in total.
Image
Windows 98/7/10 - PB 5.42
■ sites : http://michel.dobro.free.fr/
User avatar
dobro
Enthusiast
Enthusiast
Posts: 766
Joined: Sun Oct 31, 2004 10:54 am
Location: France
Contact:

Re: The Colorer_lib (*.pb TO *.xhtml+CSS)

Post by dobro »

have you understood what was used
The colorer_lib? :shock:
Image
Windows 98/7/10 - PB 5.42
■ sites : http://michel.dobro.free.fr/
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Re: The Colorer_lib (*.pb TO color *.xhtml+CSS)

Post by rsts »

Just saw this. Looks interesting (and colorful :)

I'll try it out a little later.

Thanks for contributing.

cheers
User avatar
dobro
Enthusiast
Enthusiast
Posts: 766
Joined: Sun Oct 31, 2004 10:54 am
Location: France
Contact:

Re: The Colorer_lib (*.pb TO color *.xhtml+CSS)

Post by dobro »

Thanks :)
Image
Windows 98/7/10 - PB 5.42
■ sites : http://michel.dobro.free.fr/
User avatar
idle
Always Here
Always Here
Posts: 5897
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: The Colorer_lib (*.pb TO color *.xhtml+CSS)

Post by idle »

thanks looks like it could be quite handy
Windows 11, Manjaro, Raspberry Pi OS
Image
Post Reply