fsprojects / FSharp.Formatting

F# tools for generating documentation (Markdown processor and F# code formatter)
https://fsprojects.github.io/FSharp.Formatting/
Other
462 stars 155 forks source link

Missing `fsdocs-page-source` in ApiDocs generation #805

Closed TheAngryByrd closed 1 year ago

TheAngryByrd commented 1 year ago

I'm adding a "Edit this page" type link to my _template.html

href="{{fsdocs-repository-link}}edit/{{fsdocs-repository-branch}}/{{fsdocs-page-source}}"

Which works for md/fsx files but it doesn't work for the API Documentation generation.

It seems to be part of the substitutions in Literate Programming but it seems missing from ApiDocs side.

Is there any reason it shouldn't be part of substitutions for the ApiDocs?

nojaf commented 1 year ago

Hi there, this kinda makes sense I think. As the documentation is generated, some pages wouldn't really have a source file to go to. For example https://fsprojects.github.io/fantomas/reference/fantomas-core.html This really just bundles everything it found in the processed assembly. There is no physical file to go there.

TheAngryByrd commented 1 year ago

Ah yeah good point.

Hmm, I guess then best way to hide it is to have some client side js if it’s not a valid link. I know you can have a template for references but I don’t want to keep them in sync for 1 button difference.