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

Use xml doc structure with tags #10

Open
kMutagene opened this issue Mar 6, 2023 · 1 comment
Open

Use xml doc structure with tags #10

kMutagene opened this issue Mar 6, 2023 · 1 comment
Assignees
Milestone

Comments

@kMutagene
Copy link
Member

kMutagene commented Mar 6, 2023

For example this XML doc:

https://github.com/CSBiology/FsSpreadsheet/blob/810424fadaf432587c12e24d550a30578ed7598c/src/FsSpreadsheet/FsAddress.fs#L7-L15

should be

/// <summary> 
/// Transforms excel column string indices (e.g. A, B, Z, AA, CD) to index number (starting with A = 1).
/// </summary> 
/// <param name="columnAdress">param description here</param>
let colAdressToIndex (columnAdress : string) =
    let length = columnAdress.Length
    let mutable sum = 0u
    for i=0 to length-1 do
        let c = columnAdress.[length-1-i] |> System.Char.ToUpper
        let factor = 26. ** (float i) |> uint
        sum <- sum + ((uint c - 64u) * factor)
    sum

Why?

while fsdocs is debatable for creating actual tutorial-style documentation (we might migrate to something that can convert notebooks for that), it's API doc generation is top-notch. XML docs using tags are significantly improving the output of API doc generation.

For a real-life example, take a look at plotly.net's API docs, for example here: https://plotly.net/reference/plotly-net-chart.html#Grid

@omaus omaus self-assigned this Mar 6, 2023
@omaus
Copy link
Collaborator

omaus commented Mar 6, 2023

/// <summary> 
/// Transforms excel column string indices (e.g. A, B, Z, AA, CD) to index number (starting with A = 1).
/// <param name="columnAdress">param description here</param>
let colAdressToIndex (columnAdress : string) =
    let length = columnAdress.Length
    let mutable sum = 0u
    for i=0 to length-1 do
        let c = columnAdress.[length-1-i] |> System.Char.ToUpper
        let factor = 26. ** (float i) |> uint
        sum <- sum + ((uint c - 64u) * factor)
    sum

Aren't you missing the closing </summary> tag or is that not needed anymore by now?

@kMutagene kMutagene added this to the Backlog milestone Mar 6, 2023
@omaus omaus moved this to Backlog in ARCStack Jun 5, 2024
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