2025-02-19 05:43:34 +00:00
|
|
|
open AstAccess.AstImport
|
|
|
|
open HtmlStruct.Content
|
|
|
|
open System.Xml
|
2025-02-19 13:19:18 +00:00
|
|
|
open HtmlStruct.Assemble
|
|
|
|
open HtmlStruct.Content
|
|
|
|
open HtmlStruct.Present
|
|
|
|
|
2025-02-19 05:43:34 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2025-02-20 03:08:17 +00:00
|
|
|
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)
|
2025-02-20 06:50:38 +00:00
|
|
|
let point_pages = point_page_assemble(volume_pages @ story_pages)
|
2025-02-19 13:19:18 +00:00
|
|
|
|
2025-02-21 23:52:48 +00:00
|
|
|
volume_pages @ story_pages @ point_pages |> List.iter (fun it -> (it:?>PageAccess).setPageRoot("E:"))
|
|
|
|
|
2025-02-21 17:22:52 +00:00
|
|
|
let maker = 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 ""
|
|
|
|
)
|
|
|
|
let docx0 = maker.Item(5).getHtmlText()
|
|
|
|
let docx1 = maker.Item(18).getHtmlText()
|
|
|
|
let docx2 = maker.Item(22).getHtmlText()
|
|
|
|
|
2025-02-20 06:50:38 +00:00
|
|
|
for refs in point_pages do
|
2025-02-20 03:08:17 +00:00
|
|
|
System.Console.WriteLine(refs.ToString())
|