• R/O
  • SSH
  • HTTPS

autocodeforsql: コミット


コミットメタ情報

リビジョン236 (tree)
日時2019-10-16 17:00:48
作者hilinwei

ログメッセージ

変更サマリ

差分

--- AutoEpub3/AutoEpub7.vb (revision 235)
+++ AutoEpub3/AutoEpub7.vb (revision 236)
@@ -6,60 +6,212 @@
66
77 Private Sub btnNCXDep2_Click(sender As Object, e As EventArgs) Handles btnNCXDep2.Click
88
9+ 'Dim listVolumn As List(Of String) = {"part0003", "part0017", "part0029", "part0041", "part0053", "part0065", "part0077", "part0089"}.ToList()
10+
11+
12+ Dim listVolumn As List(Of String) = {"part0003"}.ToList()
13+
14+
15+
916 Try
1017
11- Dim ncxFilePath As String = "C:\Users\DataTrade\Downloads\cd\OEBPS\toc.ncx"
12-
13- Dim fs As System.IO.FileStream = New System.IO.FileStream(ncxFilePath, System.IO.FileMode.Open)
14- Dim serializer As System.Xml.Serialization.XmlSerializer = New System.Xml.Serialization.XmlSerializer(GetType(ncx))
15- Dim fileNCX As ncx = CType(serializer.Deserialize(fs), ncx)
1618 Dim mEpub As New List(Of modelVolume)
1719
20+ For Each uPage As String In listVolumn
1821
19- For ctrVolume As Integer = 1 To fileNCX.navMap.Count - 1
22+ Dim sPath As String = "C:\Soft\A1\OEBPS\Text\" & uPage & ".xhtml"
23+ Dim sHtml As String = cTools.sFileReader(sPath, cEpub6.encUTF8)
2024
21- Dim fileVoluem As ncxNavPoint = fileNCX.navMap(ctrVolume)
25+ Dim listVolume As List(Of String) = cTools.listNav_SE(sHtml, "<p class=""kindle-cn-toc-level-1"">", "</p>", False)
2226
27+ listVolume.RemoveAt(listVolume.Count - 1)
2328
24- Dim mVolume As New modelVolume
25- mVolume.Title = fileVoluem.navLabel.text
2629
27- For ctrChapter As Integer = 0 To fileVoluem.navPoint.Length - 1
30+ For Each eachVolume As String In listVolume
2831
29- Dim fileChapter As ncxNavPointNavPoint = fileVoluem.navPoint(ctrChapter)
32+ Dim sURL As String = cTools.listNav_SE(eachVolume, "<a href=""", """>", False)(0)
33+ Dim sTitle As String = cTools.listNav_SE(eachVolume, """>", "</a>", False)(0)
3034
31- Dim mChapter As New modelChapter
32- mChapter.Title = fileChapter.navLabel.text
33- mChapter.Scr = fileChapter.content.src
34- mChapter.Scr = mChapter.Scr.Split("#")(0)
35+ If sTitle.IndexOf("青霞") > 0 Then
36+ Continue For
37+ End If
3538
36- Dim sChapter As String = cTools.sFileReader("C:\Users\DataTrade\Downloads\cd\OEBPS\" & mChapter.Scr, cEpub6.encUTF8)
37- Dim listText As List(Of String) = cTools.listText_P(sChapter)
3839
39- mChapter.listText = listText
40+ Dim mVolume As New modelVolume
41+ mVolume.Title = sTitle
4042
41- mVolume.listChapter.Add(mChapter)
4243
43- Next
44+ If sTitle.IndexOf("第四十一回") > -1 Then
4445
45- mEpub.Add(mVolume)
46+ Dim kkkere = "1"
4647
48+ End If
49+
50+
51+ Dim listChart As List(Of String) = cTools.listNav_SE(sHtml, sURL, """>", True)
52+
53+
54+
55+ sURL = "C:\Soft\A1\OEBPS\Text\" & sURL
56+
57+ If listChart.Count = 1 Then
58+
59+ Dim sChartHtml As String = cTools.sFileReader(sURL, cEpub6.encUTF8)
60+
61+ mVolume.listText = cTools.listText_P(sChartHtml)
62+
63+
64+ Else
65+
66+ Dim sChartHtml As String = cTools.sFileReader(sURL, cEpub6.encUTF8)
67+
68+
69+
70+
71+
72+
73+ Dim listChartLine As List(Of String) = sChartHtml.Split(New String() {"<h2"}, StringSplitOptions.None).ToList
74+ listChartLine.RemoveAt(0)
75+
76+ For Each eachChartLine11 As String In listChartLine
77+
78+ Dim eachChartLine As String = eachChartLine11
79+
80+
81+
82+ If sChartHtml.IndexOf("image01385") > -1 Then
83+
84+ Dim kkdfd = "1"
85+ End If
86+
87+
88+
89+
90+ Dim listImg As List(Of String) = cTools.listNav_SE(eachChartLine, "<img", "/>", True)
91+
92+ For Each eachImg As String In listImg
93+
94+
95+ Dim sScr As String = eachImg.Split("/").ToList()(2).Split("""").ToList()(0)
96+
97+
98+ Dim sNewImg As String = cTools.sGaiji(sScr, emEpub6.emUrlImgDep.Chapter)
99+
100+ eachChartLine = eachChartLine.Replace(eachImg, sNewImg)
101+
102+ Next
103+
104+
105+
106+
107+
108+
109+ Dim mChart As New modelChapter
110+
111+ Dim listCHK As List(Of String) = cTools.listNav_SE(eachChartLine, "</a>", "</h2>", False)
112+
113+ If listCHK.Count = 0 Then
114+ listCHK = cTools.listNav_SE(eachChartLine, """>", "</h2>", False)
115+ End If
116+
117+ If listCHK.Count = 0 Then
118+
119+ Dim kk1 = "11"
120+
121+ End If
122+
123+
124+
125+ mChart.Title = listCHK(0)
126+ mChart.listText = cTools.listText_P(eachChartLine)
127+
128+
129+ mVolume.listChapter.Add(mChart)
130+ Next
131+
132+
133+
134+
135+ End If
136+
137+ mEpub.Add(mVolume)
138+
139+
140+ Next
47141 Next
48142
49- Dim cEpub As New cEpub6(emEpub6.emEncCode.GB2321, emEpub6.emLan.ZH, "王占君武侠小说合集", "王占君", "WZJWX_201906")
50- cEpub.bConvertToMobi = False
143+
144+ Dim cEpub As New cEpub6(emEpub6.emEncCode.GB2321, emEpub6.emLan.ZH, "蒋勋说红楼梦", "蒋勋", "JXHLM_201910")
145+ cEpub.bConvertToMobi = True
51146 cEpub.CreateEpub(mEpub)
52147 MessageBox.Show("Finished")
53148
54149
150+
151+
55152 Catch ex As Exception
56153
57- MessageBox.Show(ex.Message)
58-
59154 End Try
60155
61156
62157
158+ 'Try
159+
160+ ' Dim ncxFilePath As String = "C:\CD1\toc.ncx"
161+
162+ ' Dim fs As System.IO.FileStream = New System.IO.FileStream(ncxFilePath, System.IO.FileMode.Open)
163+ ' Dim serializer As System.Xml.Serialization.XmlSerializer = New System.Xml.Serialization.XmlSerializer(GetType(ncx))
164+ ' Dim fileNCX As ncx = CType(serializer.Deserialize(fs), ncx)
165+ ' fs.Dispose()
166+
167+
168+ ' Dim mEpub As New List(Of modelVolume)
169+
170+
171+ ' For ctrVolume As Integer = 1 To fileNCX.navMap.Count - 1
172+
173+ ' Dim fileVoluem As ncxNavPoint = fileNCX.navMap(ctrVolume)
174+
175+
176+ ' Dim mVolume As New modelVolume
177+ ' mVolume.Title = fileVoluem.navLabel.text
178+
179+ ' For ctrChapter As Integer = 0 To fileVoluem.navPoint.Length - 1
180+
181+ ' Dim fileChapter As ncxNavPointNavPoint = fileVoluem.navPoint(ctrChapter)
182+
183+ ' Dim mChapter As New modelChapter
184+ ' mChapter.Title = fileChapter.navLabel.text
185+ ' mChapter.Scr = fileChapter.content.src
186+ ' mChapter.Scr = mChapter.Scr.Split("#")(0)
187+
188+ ' Dim sChapter As String = cTools.sFileReader("C:\CD1\" & mChapter.Scr, cEpub6.encUTF8)
189+ ' Dim listText As List(Of String) = cTools.listText_P(sChapter)
190+
191+ ' mChapter.listText = listText
192+
193+ ' mVolume.listChapter.Add(mChapter)
194+
195+ ' Next
196+
197+ ' mEpub.Add(mVolume)
198+
199+ ' Next
200+
201+ ' Dim cEpub As New cEpub6(emEpub6.emEncCode.GB2321, emEpub6.emLan.ZH, "中篇推理小说", "合集", "ZPTLXSHJ_201909")
202+ ' cEpub.bConvertToMobi = True
203+ ' cEpub.CreateEpub(mEpub)
204+ ' MessageBox.Show("Finished")
205+
206+
207+ 'Catch ex As Exception
208+
209+ ' MessageBox.Show(ex.Message)
210+
211+ 'End Try
212+
213+
214+
63215 End Sub
64216
65217 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
--- AutoEpub3/Files/OEBPS/stylesheet.css (revision 235)
+++ AutoEpub3/Files/OEBPS/stylesheet.css (revision 236)
@@ -91,6 +91,11 @@
9191 .mobiText {
9292 text-indent: 2em;
9393 display: block;
94+ letter-spacing: auto;
95+ line-height: 1.5em;
96+ text-align: left;
97+ text-indent: 2em;
98+ margin: 10pt 0
9499 }
95100
96101 .mobiCommand {
--- AutoEpub3/My Project/Application.Designer.vb (revision 235)
+++ AutoEpub3/My Project/Application.Designer.vb (revision 236)
@@ -32,7 +32,7 @@
3232
3333 <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
3434 Protected Overrides Sub OnCreateMainForm()
35- Me.MainForm = Global.AutoEpub3.AutoPdf
35+ Me.MainForm = Global.AutoEpub3.AutoEpub7
3636 End Sub
3737 End Class
3838 End Namespace
--- AutoEpub3/cTools.vb (revision 235)
+++ AutoEpub3/cTools.vb (revision 236)
@@ -1089,18 +1089,18 @@
10891089 Public Shared Function sGaiji(ByVal sScr As String, ByVal iDep As emEpub6.emUrlImgDep) As String
10901090
10911091 Dim listTemp As List(Of String) = sScr.Split("/").ToList()
1092- sScr = "/Img/" & listTemp(listTemp.Count - 1)
1092+ sScr = "Img/" & listTemp(listTemp.Count - 1)
10931093
10941094 If iDep = emEpub6.emUrlImgDep.Section Then
1095- sScr = "../../" & sScr
1095+ sScr = "" & sScr
10961096 End If
10971097
10981098 If iDep = emEpub6.emUrlImgDep.Volume Then
1099- sScr = "../../../" & sScr
1099+ sScr = "../" & sScr
11001100 End If
11011101
11021102 If iDep = emEpub6.emUrlImgDep.Chapter Then
1103- sScr = "../../../" & sScr
1103+ sScr = "../../" & sScr
11041104 End If
11051105
11061106 sGaiji = "<img class=""mobiImgChar_Bottom_5px"" alt="""" src=""" & sScr & """/>"
旧リポジトリブラウザで表示