Skip to content

Guidance on literate programming  #804

@TheAngryByrd

Description

@TheAngryByrd

I'm looking for some guidance on how to deal with a specific problem when doing Literate Prgramming. This involves trying to update the doc's examples with new code that isn't available yet on nuget.

For example lets say I have this snippet:

#r "nuget: FsToolkit.Errorhandling"
open FsToolkit.ErrorHandling

let test : Result<int,string> = result { return 4 }

test
|> Result.map (fun x -> x * 2)
|> printf "A result is: %A" 
(*** include-output ***)

but then I added a new Result.someCoolThing function.

#r "nuget: FsToolkit.Errorhandling"
open FsToolkit.ErrorHandling

let test : Result<int,string> = result { return 4 }

test
|> Result.someCoolThing (fun x -> x * 2)
|> printf "A result is: %A" 
(*** include-output ***)

However, since I haven't published the nuget package yet, this wouldn't work. Is there any good tips/guidance on dealing with this problem?


I've looked into Referencing projects with #r: fsproj but I couldn't get this to work. Also with this workaround, I wouldn't necessarily want to show the referencing of the project or dlls, but only the nuget package so people would be easily able to copy snippets from the published docs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions