(* Plant species sorted by families *) maintainIndexF := ( Print["Creating list of plant species sorted by families ..."]; xsizem1 = 400; (* Max width of pop-up thumbnail *) ysizem1 = 300; (* Max height of pop-up thumbnail *) height = 270; font =12; margin =3; text = { " Flora of Qatar - list of plants sorted by family

Home PagePicture ArchivesFlora of Qatar" <> " > List by familyAlphabetical listCompact list

Flora of Qatar

Plant families

", "", "

Species of plants listed by family

", (* Main body *) nfamily = 0; Table[nfamily++; listsortf = Select[listsort, #[[2]] === family &]; plants = #[[4]]& /@ listsortf; family1 = " ToLowerCase[family] <> ".htm\">" <> family <> ""; fcname = familyCommonName[family]; fauthor = familyAuthor[family]; (* If[Head[fauthor] === String, fadd = fauthor, fadd = ""]; If[Head[fcname] === String, fadd = fadd <> " (" <> fcname <> ")"]; *) If[Head[fcname] === String, fadd = "   " <> fcname, fadd = ""]; If[fadd =!= "", family1 = family1 <> " " <> fadd <> ""]; {"

" <> IntegerString[nfamily, "Roman"] <> ". family <> "\" HREF=\"" <> ToLowerCase[family] <> ".htm\">" <> family1 <> " 

", nplant = 0; Table[nplant++; name = plantname[plant]; excls = exclusions[plant]; nts = notes[plant]; name0 = shortenname[name]; syns = plantsynonyms[plant]; names = plantnames[plant]; cnames = Complement[names, {name0}, syns, SameTest -> ((ToLowerCase[#1] === ToLowerCase[#2]) &)]; wikitext = plantwiki[plant]; If[wikitext === "", wikitxt = "", wikitxt = StringCases[wikitext, "

" ~~ Shortest[x__] ~~ "

" -> x, 1]; If[!MatchQ[wikitxt, {_}], Print["Internal error: first paragraph of Wiki article not found: ", name, " -> ", wikitext, " -> ", wikitxt], wikitxt = StringTrim[wikitxt[[1]]]; If[wikitxt === "", Print["Internal error: first paragraph of Wiki article is empty: ", name, " -> ", wikitext, " -> ", wikitxt]; ]]; ]; namer = StringReplace[name0, redirects]; name1 = StringReplace[namer, " " -> "%20"]; name1a = StringReplace[name1, " " -> "_"]; planta = StringReplace[plant, " " -> "_"]; plantal = ToLowerCase[planta]; wikiurl = "http://en.wikipedia.org/wiki/" <> name1a; datasql = plantdatasql[plant]; { "

" <> IntegerString[nplant] <> ". planta <> "\" HREF=\"" <> plantal <> ".htm\">" <> name <> "

", (* <> " ", *) (* Data for a given plant *) If[syns =!= {}, "

(" <> StringJoin[Riffle[syns, ", "]] <> ")

", ""], If[cnames =!= {}, "

Common names: " <> StringJoin[Riffle[cnames, ", "]] <> "

", ""], If[nts =!= {}, "

My notes: " <> StringJoin[Riffle[nts, "\n"]] <> "

", ""], If[wikitxt =!= "", "

Extract from wikiurl <> "\">Wikipedia article: " <> wikitxt <> "

", ""], "
", Table[ {year, roll, pic, capt, xsize, ysize, date, pop} = dat; link = "asergeev/pictures/archives/compress/" <> year <> "/" <> roll <> "/" <> pic <> ".htm"; linkjpg = "asergeev/pictures/archives/" <> year <> "/" <> roll <> "/jpeg/" <> pic <> "b.jpg"; slink = "asergeev/pictures/archives/compress/" <> year <> "/" <> roll <> "/" <> pic <> ".htm"; capt1 = " link <> "\" TARGET=\"_blank\" TITLE=\"Photo " <> roll <> "-" <> pic <> "\">\"Link\"" <> capt; xscale = xsizem1/xsize; yscale = ysizem1/ysize; scale = Min[xscale, yscale]; xm = Round[scale xsize]; ym = Round[scale ysize]; wthmaxt = 240; hthmaxt = 180; {pw, ph} = {xsize, ysize}; (* {sc1, sc2} = {wthmaxt, hthmaxt}/{xsize, ysize}; sc = Min[sc1, sc2]; {pwr, phr} = Round[sc {xsize, ysize}]; *) If[pw > ph, phc = ph; If[pw > 4./3 ph, pwc = 4./3 ph, pwc = pw]; pwr = hthmaxt/phc pwc; phr = hthmaxt, pwc = pw; If[ph > 4./3 pw, phc = 4./3 pw, phc = ph]; pwr = hthmaxt; phr = hthmaxt/pwc phc; ]; pwr = Round[pwr]; phr = Round[phr]; imgtrail = "ONMOUSEOVER=\"showtrail('asergeev/pictures/archives/compress/" <> year <> "/" <> roll <> "/jpeg/" <> pic <> "m.jpg'," <> ToString[xm] <> "," <> ToString[ym] <> ");" <> "\" ONMOUSEOUT=\"hidetrail();\""; jpg = " linkjpg <> "\" TARGET=\"_blank\"> year <> "/" <> roll <> "/jpeg/" <> pic <> "t.jpg" <> "\" BORDER=\"0\" HEIGHT=\"" <> ToString[phr] <> "\" WIDTH=\"" <> ToString[pwr] <> "\" " <> imgtrail <> ">"; If[MemberQ[excls, {roll, pic}], "", "
" <> jpg <> "
" <> capt1 <> "
"], {dat, datasql}], "
" }, {plant, plants}]}, {family, plantfamilies}], (* Footer *) "

Links

Outside links

How the web page was created

Acknowledgements

QNHG (Qatar Natural History Group) and associated people, for a possibility to participate in their field excursions and to learn about local nature.

" }; file = ToFileName[dir0, "indexf.htm"]; Export[file, StringJoin[Riffle[Flatten[text], "\n"]], "Text", CharacterEncoding -> "UTF8"]; );