Comments (9)
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.
from fsharp.formatting.
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? (Or maybe not cache to begin with Looks like people have been asking for this for a while.)
Do you foresee any other issues with having some output package directory always in the NuGet.config
file?
from fsharp.formatting.
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.
from fsharp.formatting.
You can use a hidden (*** condition:prepare ***)
section to reference the dlls explicitly.
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
https://github.com/fsprojects/FSharp.Data.Toolbox/blob/4cd853c39ffa2131976f9681b4837dd88731cb58/docs/TwitterProvider.fsx#L41
from fsharp.formatting.
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.
Yeah this is possible but it's a very weird experience making this work. If you don't set NUGET_PACKAGES
before you open your editor, it won't pick up these changes.
If you only set it for the dotnet fsdocs
command itself, it doesn't seem to pull from the new cache.
Content:
generating model for C:\Users\jimmy\Repositories\public\TheAngryByrd\fsdocstster\docsSrc\Tutorials\Tutorial-3.fsx --> .\Tutorials\Tutorial-3.html
C:\Users\jimmy\Repositories\public\TheAngryByrd\fsdocstster\docsSrc\Tutorials\Tutorial-3.fsx: error(20,17)-(20,20) The value, constructor, namespace or type 'Foo' is not defined.
C:\Users\jimmy\Repositories\public\TheAngryByrd\fsdocstster\docsSrc\Tutorials\Tutorial-3.fsx: error(0,0)-(0,0) The module/namespace 'Project1.Say' from compilation unit 'Project1' did not contain the namespace, module or type 'Foo'
You can use a hidden (*** condition:prepare ***) section to reference the dlls explicitly.
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
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.
f 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.
This issue is more about before publication of the nuget package but still valuable to know. Thanks!
from fsharp.formatting.
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. :(
from fsharp.formatting.
This issue is more about before publication of the nuget package.
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.
from fsharp.formatting.
Not sure if this helps but in Fantomas, we switched to local assemblies instead of #r "nuget:
:
https://github.com/fsprojects/fantomas/blob/v6.0/docs/docs/end-users/Configuration.fsx#L18-L19
from fsharp.formatting.
In Plotly.NET, we use local assembly references as well. If your project has external dependencies, they can be loaded via #r nuget:
from fsharp.formatting.
Related Issues (20)
- Get CommonMark 0.30 tests to pass for "Tabs" section
- Get CommonMark 0.30 tests to pass for "Fenced code blocks" section
- Dockerfile fails to build with "failed to solve: process /bin/bash ..." HOT 2
- discussion: multi target F# libraries (IL, WebSharper, Fable, etc.)
- discussion: offering back links form API pages to the other documentation pages?
- Need to update repo's nuget API key HOT 2
- Package references cannot be resolved when trying to build API documentation programmatically HOT 4
- Modernize the default theme HOT 37
- Some displayed examples may have broken indendation HOT 11
- Add how-to for the most typical scenario HOT 2
- List users of this tool HOT 1
- CSharp library not used for generating API docs HOT 7
- Function signature tooltips include attributes for arguments that make the tooltip unreadable HOT 5
- Directory.Build.props is ignored if there are no projects or solutions HOT 3
- SEO-optimization for new theme HOT 4
- Suggestion: init command
- Dark mode borders: too much contrast?
- Namespace description overflows content box
- Output font size on mobile safari is too big HOT 6
- Using testcontainers in a fsx script gives wrong output HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fsharp.formatting.