Skip to content
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

[Bug] Cannot remove View Source button #9487

Closed
rickbrew opened this issue Nov 29, 2023 · 2 comments · Fixed by #9490
Closed

[Bug] Cannot remove View Source button #9487

rickbrew opened this issue Nov 29, 2023 · 2 comments · Fixed by #9490
Labels
bug A bug to fix dotnet: csharp New features requires to handle C#

Comments

@rickbrew
Copy link

Describe the bug
I can't figure out how to get rid of the "View Source" buttons. I've added both "disableGitFeatures": true and "_disableContribution": true but they don't seem to work. The "Edit this Page" link at the bottom was removed, but not the </> buttons for View Source.

This is a privacy issue for me -- the View Source buttons are linking to my private GitHub repo, which I'd rather not advertise. Obviously the links will not work for anyone but me, so it's also just a dead link in my docs pages.

The github links are puzzling me for another reason: how is it even figuring out the github URLs into my private repo? I'm generating the docs from a temporary directory that does not have a .git folder or anything 🤔

Am I putting these properties in the wrong place? Anything else I'm missing?

To Reproduce
Steps to reproduce the behavior:

  1. Add "disableGitFeatures": true to the metadata and build sections of the configuration JSON
  2. Add "_disableContribution": true to the globalMetadata section within the build section of the configuration JSON
  3. Rebuild your docs

Expected behavior
No "Edit this Page" links (this is working correctly)
No "View Source" links (does not work)
No github URLs in the generated HTML pages (does not work)

Context (please complete the following information):

  • OS: Windows 11
  • Docfx version: 2.74.0

Additional context
Here is my docfx.json. The src property is filled-in by a pre-build script. It will point to a folder whose contents are exactly what are needed for correctly generating the docs. There's no .git in there or anything.

{
  "metadata": [
    {
      "src": [
        {
          "src": "C:/Users/Rick/AppData/Local/Temp/PDNBuildApiDocsa0258ba6-7536-44c9-a702-09eba7ccc8e3",
          "files": [
            "PaintDotNet.ComponentModel.dll",
            "PaintDotNet.Fundamentals.dll",
            "PaintDotNet.Primitives.dll",
            "PaintDotNet.PropertySystem.dll",
            "PaintDotNet.Collections.dll",
            "PaintDotNet.Runtime.dll",
            "PaintDotNet.ObjectModel.dll",
            "PaintDotNet.Windows.dll",
            "PaintDotNet.Windows.Core.dll",
            "PaintDotNet.Windows.Framework.dll",
            "PaintDotNet.UI.dll",
            "PaintDotNet.Base.dll",            
            "PaintDotNet.Core.dll",
            "PaintDotNet.Framework.dll",
            "PaintDotNet.Data.dll",
            "PaintDotNet.Effects.Core.dll",
            "PaintDotNet.Effects.Gpu.dll"
          ]
        }
      ],
      "dest": "api",
      "filter": "filterConfig.yml",
      "includePrivateMembers": false,
      "disableDefaultFilter": false,
      "noRestore": false,
      "namespaceLayout": "flattened",
      "memberLayout": "separatePages",
      "EnumSortOrder": "declaringOrder",
      "allowCompilationErrors": false,
      "disableGitFeatures": true
    }
  ],
  "build": {
    "content": [
      {
        "files": [
          "toc.yml",
          "*.md"
        ]
      },
      {
        "files": [
          "api/**.yml",
          "api/index.md"
        ]
      }
    ],
    "overwrite": [
      {
        "files": [
          "namespaces/**.md"
        ]
      }
    ],
    "globalMetadata": {
      "_appLogoPath": "images/logo.png",
      "_disableContribution": true
    },
    "resource": [
      {
        "files": [
          "images/**"
        ]
      }
    ],
    "output": "docs",
    "globalMetadataFiles": [],
    "fileMetadataFiles": [],
    "template": [
      "default",
      "modern",
      "pdn-template"
    ],
    "postProcessors": [],
    "keepFileLink": false,
    "disableGitFeatures": true
  }
}
@rickbrew rickbrew added the bug A bug to fix label Nov 29, 2023
@yufeih yufeih added the dotnet: csharp New features requires to handle C# label Nov 29, 2023
@yufeih
Copy link
Contributor

yufeih commented Nov 29, 2023

Git info likely came from PDB files in this case. Does the link still exist after deleting *.PDB files?

@rickbrew
Copy link
Author

Yes, the VIew Source buttons are removed when I exclude/delete the *.PDB files from the temporary directory. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug to fix dotnet: csharp New features requires to handle C#
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants