38 lines
1.3 KiB
Forth
38 lines
1.3 KiB
Forth
open AstAccess.AstImport
|
|
open HtmlStruct.Content
|
|
open System.Xml
|
|
open HtmlStruct.Assemble
|
|
open HtmlStruct.Content
|
|
open HtmlStruct.Present
|
|
open System.IO
|
|
|
|
|
|
let doc = XmlDocument()
|
|
doc.Load("E:/storyline.xast")
|
|
|
|
let prog = Program.GenerateFrom(doc)
|
|
|
|
let entry = AstVisitEntry(prog)
|
|
let visitor = UnitGenerate(prog)
|
|
entry.visitWith(visitor) |> ignore
|
|
|
|
let volume_pages = volume_page_assemble(visitor.contents()) |> List.map<VolumePage, IDomUnit> (fun x->x)
|
|
let story_pages = story_page_assemble(visitor.contents()) |> List.map<StoryPage, IDomUnit> (fun x->x)
|
|
let point_pages = point_page_assemble(volume_pages @ story_pages)
|
|
|
|
volume_pages @ story_pages @ point_pages |> List.iter (fun it -> (it:?>PageAccess).setPageRoot("E:"))
|
|
let makers = volume_pages @ story_pages @ point_pages
|
|
|> List.map(fun page_unit ->
|
|
match page_unit with
|
|
| :? PointPage as point ->
|
|
PageMaker<PointPage>(point) :> PageText
|
|
| :? VolumePage as vol ->
|
|
PageMaker<VolumePage>(vol)
|
|
| :? StoryPage as story ->
|
|
PageMaker<StoryPage>(story)
|
|
| _ -> failwith ""
|
|
)
|
|
|
|
for refs in makers do
|
|
let file_path = (refs.bindPage() :?> PageAccess).pageURL()
|
|
File.WriteAllLines(file_path, [refs.getHtmlText()]) |