Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b7b32b1

Browse files
committed
code changes to deal with updates
1 parent affc457 commit b7b32b1

File tree

3 files changed

+20
-19
lines changed

3 files changed

+20
-19
lines changed

generators/apiref.fsx

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#r "../_lib/Fornax.Core.dll"
22
#r "../packages/Newtonsoft.Json/lib/netstandard2.0/Newtonsoft.Json.dll"
3+
#r "../packages/FSharp.Compiler.Service/lib/netstandard2.0/FSharp.Compiler.Service.dll"
34
#r "../packages/FSharp.Formatting/lib/netstandard2.0/FSharp.Formatting.ApiDocs.dll"
45

56
#if !FORNAX
@@ -21,10 +22,10 @@ let stripMicrosoft (str: string) =
2122
else
2223
str
2324

24-
let getComment (c: DocComment) =
25+
let getComment (c: ApiDocComment) =
2526
sprintf """<div class="comment">%s</div>""" c.FullText
2627

27-
let formatMember (m: Member) =
28+
let formatMember (m: ApiDocMember) =
2829
let hasCustomOp =
2930
m.Attributes
3031
|> List.exists (fun a -> a.FullName = "Microsoft.FSharp.Core.CustomOperationAttribute")
@@ -53,12 +54,12 @@ let formatMember (m: Member) =
5354
br []
5455
br []
5556
b [] [!! "Signature: "]
56-
!!m.Details.Signature
57+
!! m.SignatureTooltip
5758
]
5859
td [] [!! (getComment m.Comment)]
5960
]
6061

61-
let generateType ctx (page: ApiPageInfo<Type>) =
62+
let generateType ctx (page: ApiPageInfo<ApiDocType>) =
6263
let t = page.Info
6364
let body =
6465
div [Class "api-page"] [
@@ -105,9 +106,9 @@ let generateType ctx (page: ApiPageInfo<Type>) =
105106
yield! t.UnionCases |> List.map formatMember
106107
]
107108
]
108-
t.UrlName, Layout.layout ctx [body] t.Name
109+
t.UrlBaseName, Layout.layout ctx [body] t.Name
109110

110-
let generateModule ctx (page: ApiPageInfo<Module>) =
111+
let generateModule ctx (page: ApiPageInfo<ApiDocModule>) =
111112
let m = page.Info
112113
let body =
113114
div [Class "api-page"] [
@@ -133,7 +134,7 @@ let generateModule ctx (page: ApiPageInfo<Module>) =
133134
]
134135
for t in m.NestedTypes do
135136
tr [] [
136-
td [] [a [Href (sprintf "%s.html" (stripMicrosoft t.UrlName))] [!! t.Name ]]
137+
td [] [a [Href (sprintf "%s.html" (stripMicrosoft t.UrlBaseName))] [!! t.Name ]]
137138
td [] [!! (getComment t.Comment)]
138139
]
139140
]
@@ -148,7 +149,7 @@ let generateModule ctx (page: ApiPageInfo<Module>) =
148149
]
149150
for t in m.NestedModules do
150151
tr [] [
151-
td [] [a [Href (sprintf "%s.html" (stripMicrosoft t.UrlName))] [!! t.Name ]]
152+
td [] [a [Href (sprintf "%s.html" (stripMicrosoft t.UrlBaseName))] [!! t.Name ]]
152153
td [] [!! (getComment t.Comment)]
153154
]
154155
]
@@ -175,9 +176,9 @@ let generateModule ctx (page: ApiPageInfo<Module>) =
175176
yield! m.TypeExtensions |> List.map formatMember
176177
]
177178
]
178-
m.UrlName, Layout.layout ctx [body] m.Name
179+
m.UrlBaseName, Layout.layout ctx [body] m.Name
179180

180-
let generateNamespace ctx (n: Namespace) =
181+
let generateNamespace ctx (n: ApiDocNamespace) =
181182
let body =
182183
div [Class "api-page"] [
183184
h2 [] [!! (stripMicrosoft n.Name)]
@@ -192,7 +193,7 @@ let generateNamespace ctx (n: Namespace) =
192193
]
193194
for t in n.Types do
194195
tr [] [
195-
td [] [a [Href (sprintf "%s.html" (stripMicrosoft t.UrlName))] [!! t.Name ]]
196+
td [] [a [Href (sprintf "%s.html" (stripMicrosoft t.UrlBaseName))] [!! t.Name ]]
196197
td [] [!!(getComment t.Comment)]
197198
]
198199
]
@@ -208,7 +209,7 @@ let generateNamespace ctx (n: Namespace) =
208209
]
209210
for t in n.Modules do
210211
tr [] [
211-
td [] [a [Href (sprintf "%s.html" (stripMicrosoft t.UrlName))] [!! t.Name ]]
212+
td [] [a [Href (sprintf "%s.html" (stripMicrosoft t.UrlBaseName))] [!! t.Name ]]
212213
td [] [!! (getComment t.Comment)]
213214
]
214215
]

generators/lunr.fsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ let generate (ctx : SiteContents) (projectRoot: string) (page: string) =
5858
(m.TypeExtensions |> List.map (fun m -> m.Name + " " + m.Comment.FullText ) |> String.concat " ")
5959

6060

61-
{uri = rootUrl + sprintf "/reference/%s/%s.html" n.Label (stripMicrosoft m.UrlName) ; title = m.Name; content = cnt }
61+
{uri = rootUrl + sprintf "/reference/%s/%s.html" n.Label (stripMicrosoft m.UrlBaseName) ; title = m.Name; content = cnt }
6262
)
6363

6464
let tsGen =
@@ -72,7 +72,7 @@ let generate (ctx : SiteContents) (projectRoot: string) (page: string) =
7272
(m.AllMembers |> List.map (fun m -> m.Name + " " + m.Comment.FullText ) |> String.concat " ")
7373

7474

75-
{uri = rootUrl + sprintf "/reference/%s/%s.html" n.Label m.UrlName ; title = m.Name; content = cnt }
75+
{uri = rootUrl + sprintf "/reference/%s/%s.html" n.Label m.UrlBaseName ; title = m.Name; content = cnt }
7676
)
7777
[gen; yield! mdlsGen; yield! tsGen]
7878
)

loaders/apirefloader.fsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ type ApiPageInfo<'a> = {
1515

1616
type AssemblyEntities = {
1717
Label: string
18-
Modules: ApiPageInfo<Module> list
19-
Types: ApiPageInfo<Type> list
18+
Modules: ApiPageInfo<ApiDocModule> list
19+
Types: ApiPageInfo<ApiDocType> list
2020
GeneratorOutput: ApiDocsModel
2121
}
2222

@@ -28,10 +28,10 @@ let stripMicrosoft (str: string) =
2828
else
2929
str
3030

31-
let rec collectModules pn pu nn nu (m: Module) =
31+
let rec collectModules pn pu nn nu (m: ApiDocModule) =
3232
[
3333
yield { ParentName = stripMicrosoft pn; ParentUrlName = stripMicrosoft pu; NamespaceName = stripMicrosoft nn; NamespaceUrlName = stripMicrosoft nu; Info = m}
34-
yield! m.NestedModules |> List.collect (collectModules m.Name m.UrlName nn nu )
34+
yield! m.NestedModules |> List.collect (collectModules m.Name m.UrlBaseName nn nu )
3535
]
3636

3737
let loader (projectRoot: string) (siteContent: SiteContents) =
@@ -67,7 +67,7 @@ let loader (projectRoot: string) (siteContent: SiteContents) =
6767
n.Info.NestedTypes
6868
|> List.map (fun t ->
6969
{ ParentName = stripMicrosoft n.Info.Name
70-
ParentUrlName = stripMicrosoft n.Info.UrlName
70+
ParentUrlName = stripMicrosoft n.Info.UrlBaseName
7171
NamespaceName = stripMicrosoft n.NamespaceName
7272
NamespaceUrlName = stripMicrosoft n.NamespaceUrlName
7373
Info = t }))

0 commit comments

Comments
 (0)