Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Silly hacks -- APASHTM (.pas to .htm via FPC GO32V2 build) (Developers)

posted by Rugxulo Homepage, Usono, 30.04.2013, 14:21

Another thing I've found interesting is converting .PAS sources to different formats. You can use other tools (GNU Enscript) or htmlfontify-buffer in latest GNU Emacs or write a buggy sed script. :-) I know there are other potential ways, but they don't seem as obvious (to me, yet).

Anyways, despite the horribly weird sources (no offense, but it could use some work), I thought this was interesting.

Another Pascal to Html Converter

Here's what so weird about it: his default .EXE builds use Lazarus. Granted, this was 2005, so maybe smartlinking wasn't effective (or available?), but 6.5 MB seems way overkill! The sources are less than 100 kb!

Apparently you can whip up your own easy console frontend to his UPasHtm (and Reser) units, and it'll still work:


{$mode objfpc}{$H+}

program apashtm;
uses UPasHtm; {which uses Reser}

begin
  if paramcount < 2 then writeln(paramstr(0),' in.pas out.html')
  else ConvertPasToHtm(paramstr(1),paramstr(2))
end.


"fpc -XXs -Os apashtm.pas" is only 36 kb on Linux (as opposed to his Linux Lazarus build from 2005, which is 5.8 MB. Oh, and it doesn't run, for me it needs libglib-2.0.so.0 and other stuff, blech).

This probably isn't super duper useful, and I somewhat doubt how reliable it is (esp. regarding "standard" Pascal), but hey, it's much better than nothing, right? At least without rewriting it myself. :-)

 

Complete thread:

Back to the forum
Board view  Mix view
22760 Postings in 2121 Threads, 402 registered users (1 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum