-
Notifications
You must be signed in to change notification settings - Fork 158
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
Guidance on literate programming #804
Comments
One thing to do might be to build the docs after you package the local copy. When you build the docs, you can use a nuget.config file that specifies the location of the built package as an additional package source. That would keep you from having to specify the local source in the documentation files themselves, which means that after you publish the package to NuGet.org users could just copy and paste directly. |
Yeah this seems to work somewhat. The problem here is once you reference a nuget package, you'd have to go clear out your local nuget cache if you have to regenerate the package for any reason. Is there some type of way to get FSI to force reinstall those local packages? ( Do you foresee any other issues with having some output package directory always in the |
If that directory doesn't exist then dotnet restore/FSI will report errors. To get around that I commit a dummy file to the folder, but I also put the folder under gitignore to prevent packages being checked in. Another thing to do would be to set a different global packages dir to prevent corrupting your global cache. I forget the nuget.config setting for that, but I think it's the NUGET_PACKAGES env var. |
You can use a hidden https://github.com/fsprojects/FSharp.Data/blob/main/docs/library/CsvProvider.fsx you can then fake a reference to the nuget within a markdown comment block. See also If you use {{fsdocs-package-version}} you can automatically update to latest your nuget version on publication, see the diffsharp docs use of it. I think fsharp data uses that trick too. Here’s a use of package version |
Yeah this is possible but it's a very weird experience making this work. If you don't set If you only set it for the
This is good to know! Only problem I have here is it becomes difficult to reference a project if it has dependencies. Yeah, you can generate it load references in VSCode but in my experience, the load order isn't correct always.
This issue is more about before publication of the nuget package but still valuable to know. Thanks! |
The package caching wouldn't be so bad if NuGet locals command should allow deleting specific packages from NuGet global packages folder was available also. :( |
Just fyi for future reference, fsdocs takes {{fsdocs-package-version}} from your project or directory build props, not nuget.org. There’s no nuget dependency. It’ll work pre-publication. |
Not sure if this helps but in Fantomas, we switched to local assemblies instead of |
In Plotly.NET, we use local assembly references as well. If your project has external dependencies, they can be loaded via #r nuget: |
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:
but then I added a new
Result.someCoolThing
function.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.
The text was updated successfully, but these errors were encountered: