Re: a text versions of docs for Eu?
- Posted by _tom (admin) Jun 10, 2014
- 1514 views
You can download the file plain.txt which is the current OpenEuphoria documentation. Most of the Creole markup has been removed.
The link is: https://drive.google.com/file/d/0B4wfRhusHmUbTU81ZzVhV0t2Y3M/edit?usp=sharing
You can also create your own version by running this utility. Adjust the program to your needs.
_tom
-- clean.ex -- https://drive.google.com/file/d/0B4wfRhusHmUbTU81ZzVhV0t2Y3M/edit?usp=sharing -- Create your own "plain text documentation." -- * Vist http://scm.openeuphoria.org/ -- ** Download a fresh copy of OpenEuphoria source code -- ** Download eudoc -- * From the /euphoria/docs folder run eudoc.ex -- ** eui eudoc.ex -a manual.af -o foo.txt -- ** The result is "foo.txt" a documentation file formatted using Creole markup. -- * To remove most of the Creole markup run this basic cleanup program: ------------------------------------------------------------------------------------------ include std/io.e include std/console.e include std/text.e include std/search.e include std/sequence.e sequence raw = read_lines( "foo.txt") sequence peeled = {} for i=1 to length(raw) do sequence line = raw[i] if begins( "%%", line ) then -- ignore elsif begins( "!!", line) then -- ignore elsif begins( "@", line ) then -- ignore elsif begins( "<<", line ) then -- ignore elsif begins( "= ", line ) then peeled = append(peeled, line[3..$] ) --peeled = append(peeled, "" ) elsif begins( "== ", line ) then peeled = append(peeled, line[4..$] ) --peeled = append(peeled, "" ) elsif begins( "=== ", line ) then peeled = append(peeled, line[5..$]) --peeled = append(peeled, "") elsif begins( "==== ", line) then peeled = append(peeled, line[6..$]) --peeled = append(peeled, "") elsif begins( "===== ", line ) then peeled = append(peeled, line[7..$]) peeled = append(peeled, "") elsif begins( "* ", line ) then peeled = append(peeled, line[3..$]) elsif begins( "** ", line ) then peeled = append(peeled, line[4..$]) elsif begins( "*** ", line) then peeled = append(peeled, line[5..$]) elsif begins( "# ", line ) then peeled = append(peeled, line[3..$]) elsif begins( "## ", line) then peeled = append(peeled, line[4..$]) elsif begins( "### ", line ) then peeled = append(peeled, line[5..$]) elsif begins( "<eucode>", line) then peeled = append(peeled, line[9..$]) elsif begins( "<//eucode>", line) then -- NOTE: only one slash here (wiki formatting problem!) peeled = append(peeled, line[10..$]) elsif begins( "{{{", line) then peeled = append(peeled, "") elsif begins( "}}}", line) then peeled = append(peeled, "") else peeled = append(peeled, line) end if end for for i=1 to length(peeled) do sequence line = peeled[i] line = fix( "**", line ) line = fix( "##", line ) line = fix( "[[", line ) line = fix( "]]", line ) line = fix( `//`, line ) peeled[i] = line end for function fix( sequence needle, sequence haystack ) integer n = 1 while n>0 do n = match( needle, haystack ) if n then haystack = haystack[1..n-1] & haystack[n+2..$] end if end while return haystack end function write_lines( "plain.txt", peeled) display( "done\n" )