fslaborg / FsSpreadsheet

Spreadsheet creation and manipulation in F#, Javascript, and Python.
http://fslab.org/FsSpreadsheet/
MIT License
27 stars 1 forks source link

Use xml doc structure with tags #10

Open kMutagene opened 1 year ago

kMutagene commented 1 year ago

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 commented 1 year ago
/// <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?