Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can we access the Raw doc comments? #710

Closed
MangelMaxime opened this issue Oct 5, 2021 · 4 comments
Closed

How can we access the Raw doc comments? #710

MangelMaxime opened this issue Oct 5, 2021 · 4 comments

Comments

@MangelMaxime
Copy link

The ApiDocComment has a property RawData but this property is returning an already processed XML content.

For me, the returned information is not really usable for 2 reasons:

  1. It is removing some of the content from the XML for example the example content has been removed
  2. It modify the structure of the XML, see the para-0, para-1, para-2. I have no way of knowing where they where inside the XML
/// <summary>
/// <para>Represents the context of a page within Nacara.</para>
/// <para>It contains all the information available for the specified page like it's title, layout, etc.</para>
/// </summary>
/// <remarks>
/// <para>It contains all the information available for the specified page like it's title, layout, etc.</para>
/// <example>
/// blabla
/// </example>
/// </remarks>

gives:

[[summary, Represents the context of a page within Nacara.It contains all the information available for the specified page like it's title, layout, etc.];
 [remarks, It contains all the information available for the specified page like it's title, layout, etc.
 blabla
 ];
 [para-0, Represents the context of a page within Nacara.];
 [para-1, It contains all the information available for the specified page like it's title, layout, etc.];
 [para-2, It contains all the information available for the specified page like it's title, layout, etc.]]

I also tried to use the Symbol property from ApiDocEntity but when calling GetXmlText() or UnprocessedLines it returns nothing.

let renderRecord (info : ApiDocEntityInfo) =
    let entity = info.Entity

    match entity.Symbol.XmlDoc with
    | FSharpXmlDoc.FromXmlFile (dllName, xmlSig) ->
        printfn "%A" dllName
        printfn "%A" xmlSig

    | FSharpXmlDoc.FromXmlText xmlDoc ->
        printfn "%A" entity.Name
        printfn "Doc FromText: %A" (xmlDoc.GetXmlText())
        printfn "Doc FromText: %A" (xmlDoc.UnprocessedLines)

    | FSharpXmlDoc.None ->
        printfn "Note doc found"

This gives:

"PageContext"
Doc FromText: ""
Doc FromText: [||]

for this F# code:

/// <summary>
/// <para>Represents the context of a page within Nacara.</para>
/// <para>It contains all the information available for the specified page like it's title, layout, etc.</para>
/// </summary>
/// <remarks>
/// <para>It contains all the information available for the specified page like it's title, layout, etc.</para>
/// <example>
/// blabla
/// </example>
/// </remarks>
[<NoComparison>]
type PageContext =
    {
        PageId : string
    }
@MangelMaxime
Copy link
Author

MangelMaxime commented Oct 5, 2021

Another thing that I find strange is that I have provided the .dll file as input with the documentation extracted to the XML files but it says that the documentation has been found FromXmlText instead of FromXmlFile.

I used dotnet publish to generates the .dll serving as the entry point.

@MangelMaxime
Copy link
Author

One way to solve this problem, is to locate the generated XML files and parse to find the information in it.

@dsyme
Copy link
Contributor

dsyme commented Nov 10, 2021

@MangelMaxime It seems we can provide the XElement from the lookup in the XML file fairly easily, for those XML doc drawn from there

@dsyme
Copy link
Contributor

dsyme commented Nov 11, 2021

.Xml now available as an XElement, I trust it's enough.

@dsyme dsyme closed this as completed Nov 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants