docfx icon indicating copy to clipboard operation
docfx copied to clipboard

Edit on Github Link Missing

Open sahammer opened this issue 10 years ago • 31 comments

Hello,

We've created a couple of basic documentation pages on an internal repo which we have been successfully generating documentation from.

However - we've tried a variety of methods and the "Improve this Doc" link is not appearing in any of our documentation. We have an existing .git folder in the repo root that contains the appropriate information but have been unable to determine why the link is not appearing.

We have also added in the gitContribute metadata as well to see if that would make it appear and it has not.

Any suggestions as to what we may be missing?

sahammer avatar Sep 06 '16 22:09 sahammer

Not sure whether it's caused by this... Recently we have some UX change, which moved this button to the side affix in the right of page. Do you miss it as it less apparent than before?

superyyrrzz avatar Sep 07 '16 02:09 superyyrrzz

Unfortunately the link is not appearing anywhere. At a loss for what to look at next.

sahammer avatar Sep 07 '16 02:09 sahammer

@sahammer we moved the "Improve this doc" to right side affix panel. Sample page is here: http://dotnet.github.io/docfx/tutorial/docfx_getting_started.html, if you cannot find it, did you set "_disableContribution" in docfx.json? The value of "_disableContribution" should be "false" there.

hellosnow avatar Sep 07 '16 02:09 hellosnow

And also, the "_disableAffix" should be "false" to enable affix on right hand side, could you share your docfx.json with us if possible?

hellosnow avatar Sep 07 '16 02:09 hellosnow

@hellosnow

Here is the contents:

{
  "metadata": [
    {
      "src": [
        {
          "files": [
            "*.csproj"
          ],
          "cwd": ".",
          "exclude": [
            "**/obj/**",
            "**/bin/**",
            "docs/**"
          ]
        }
      ],
      "dest": "obj/api"
    }
  ],
  "build": {
    "content": [
      {
        "files": [
          "api/**.yml"
        ],
        "cwd": "obj"
      },
      {
        "files": [
          "api/*.md",
          "articles/**.md",
          "toc.yml",
          "*.md"
        ],
        "exclude": [
          "obj/**",
          "docs/**"
        ]
      }
    ],
    "dest": "docs",
    "globalMetadata": {
      "_appTitle": "DocFX website",
      "_appFooter": "© 2016 Graviton",
      "_enableSearch": "true",
      "_disableContribution": "false",
      "_disableAffix":  "false"
    },
    "overwrite": [
      {
        "files": [
          "apidoc/**.md"
        ],
        "exclude": [
          "obj/**",
          "docs/**"
        ]
      }
    ],
    "resource": [
      {
        "files": [
          "images/**"
        ],
        "exclude": [
          "obj/**",
          "docs/**"
        ]
      }
    ],
    "template": [
      "default",
      "graviton_template"
    ]
  }
}

drizzlelabs avatar Sep 07 '16 03:09 drizzlelabs

image image

drizzlelabs avatar Sep 07 '16 03:09 drizzlelabs

We've tried going straight from source, dnx, and Visual Studio. All the same results with version 2.4.

drizzlelabs avatar Sep 07 '16 03:09 drizzlelabs

The docfx.json looks good. For better investigation, is is possible to share the html file content which could not show "Improve this doc" to us?

hellosnow avatar Sep 07 '16 03:09 hellosnow

<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>

  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>Add your introductions here! | DocFX website </title>
    <meta name="viewport" content="width=device-width">
    <meta name="title" content="Add your introductions here! | DocFX website ">
    <meta name="generator" content="docfx 2.4.0.0">

    <link rel="shortcut icon" href="../favicon.ico">
    <link rel="stylesheet" href="../styles/docfx.vendor.css">
    <link rel="stylesheet" href="../styles/docfx.css">
    <link rel="stylesheet" href="../styles/main.css">
    <meta property="docfx:navrel" content="../toc.html">
    <meta property="docfx:tocrel" content="toc.html">
    <meta property="docfx:rel" content="../">
  </head>
  <body data-spy="scroll" data-target="#affix">
    <div id="wrapper">
      <header>

        <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
          <div class="container">
            <div class="navbar-header">
              <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
              </button>
              <a class="navbar-brand" href="../index.html">
                <img id="logo" class="svg" src="../logo.svg" alt="">
              </a>
            </div>
            <div class="collapse navbar-collapse" id="navbar">
              <form class="navbar-form navbar-right" role="search" id="search">
                <div class="form-group">
                  <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
                </div>
              </form>
            </div>
          </div>
        </nav>

        <div class="subnav navbar navbar-default">
          <div class="container hide-when-search" id="breadcrumb">
            <ul class="breadcrumb">
              <li></li>
            </ul>
          </div>
        </div>
      </header>
      <div class="container body-content">

        <div id="search-results">
          <div class="search-list"></div>
          <div class="sr-items"></div>
          <ul id="pagination"></ul>
        </div>
      </div>
      <div role="main" class="container body-content hide-when-search">

        <div class="sidenav hide-when-search">
          <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
          <div class="sidetoggle collapse" id="sidetoggle">
            <div id="sidetoc"></div>
          </div>
        </div>
        <div class="article row grid-right">
          <div class="col-md-12">
            <article class="content wrap" id="_content" data-uid="">
              <h1 id="add-your-introductions-here">Add your introductions here!</h1>


            </article>
          </div>
        </div>
      </div>

      <footer>
        <div class="grad-bottom"></div>
        <div class="footer">
          <div class="container">
            <span class="pull-right">
              <a href="#top">Back to top</a>
            </span>
            &#0169; 2016 Graviton

          </div>
        </div>
      </footer>
    </div>

    <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
    <script type="text/javascript" src="../styles/docfx.js"></script>
    <script type="text/javascript" src="../styles/main.js"></script>
    <script>hljs.initHighlightingOnLoad();</script>
  </body>
</html>

Thanks again!

drizzlelabs avatar Sep 07 '16 03:09 drizzlelabs

I found "class="col-md-12"" from your html page, and according to our template conceptual.html.primary.tmpl, looks like the "_disableAffix" is set to "true"? But it's obviously not from your docfx.json.

{{#_disableAffix}}
     <div class="col-md-12">
{{/_disableAffix}}

Let's confirm something: If you open the same html page in browser, "In this article" also not show on the right hand side, correct?

And more, could you try to generate the html pages using our test project https://github.com/docascode/docfx-seed to check whether it contains "Improve this doc"?

hellosnow avatar Sep 07 '16 03:09 hellosnow

I went and viewed the same html page in browser, and it does not show on the right hand side still. I went ahead and generated the seed docs and the "Improve this doc" is still not present. I do see the right article section system though. I'm still using build 2.4. I also tested again with using the docfx.json file posted above and built it again, still no success. Finally I applied the "graviton_template" and that section disappeared. I used the export template option to adjust a few css colors. I won't use that template for testing purposes.

drizzlelabs avatar Sep 07 '16 03:09 drizzlelabs

Did you generate the docfx-seed using pure docfx 2.4 version(without any additional changes)? I downloaded docfx Version 2.4, build and serve docfx-seed, "Improve this doc" appears on right hand side.

In fact, the keypoint is not whether showing "Improve this doc", but showing affix including "Improve this doc", "In this article" and bookmarks.

hellosnow avatar Sep 07 '16 06:09 hellosnow

@hellosnow On a different machine, I went and downloaded the docfx.zip file and the docfx-seed master branch as a zip file. From there I ran:

PS C:\users\useraccount\Downloads\docfx> .\docfx.exe 'C:\users\useraccount\Downloads\docfx-seed-master\docfx-seed-master\docfx.json'

... and served the page up. The results are as follows in Microsoft Edge and Firefox:

drizzlelabs avatar Sep 07 '16 11:09 drizzlelabs

capture

drizzlelabs avatar Sep 07 '16 11:09 drizzlelabs

When I proceed to clone the git repo in a folder on my machine, I'm now able to see the "Improve this doc" link. I'm going to try this again with the template after I make it to work.

Thanks again for you help!

drizzlelabs avatar Sep 07 '16 12:09 drizzlelabs

sure @drizzlelabs , let's sync after you retry.

hellosnow avatar Sep 07 '16 14:09 hellosnow

@hellosnow I think we narrowed down the issue to Github Enterprise. Looking through the code, is it looking for the repo link out matching github.com?

drizzlelabs avatar Sep 07 '16 14:09 drizzlelabs

I just confirmed that is our issue. I went into the .git\config file and modified our repo to a random github.com location and it worked.

''' [core] repositoryformatversion = 0 filemode = false bare = false logallrefupdates = true symlinks = false ignorecase = true [remote "origin"] url = https://github.com/repotesting/docfx-seed.git fetch = +refs/heads/:refs/remotes/origin/ [branch "master"] remote = origin merge = refs/heads/master [remote "docascode"] url = https://github.com/docascode/docfx-seed.git [remote "docascode"] fetch = +refs/heads/:refs/remotes/docascode/ '''

drizzlelabs avatar Sep 07 '16 14:09 drizzlelabs

In reviewing the source it does appear that there are a few places where there are some regex checks for github.com meaning the link will never show on Enterprise GitHub deployments. In reviewing past issues on this repo I don't see where anyone else has reported this.

Is there another way to check the config vs matching it with a URL? It appears it contains several other configuration items.

sahammer avatar Sep 07 '16 14:09 sahammer

I tried to override the git repo location using:

"_gitContribute": {
        "repo": "https://github.contoso.com/Engineering/Documentation.git",
        "branch": "master",
        "path": ""
      }

... it didn't work. When I changed it to:

"_gitContribute": {
        "repo": "https://github.com/Engineering/Documentation.git",
        "branch": "master",
        "path": ""
      }

... it worked.

drizzlelabs avatar Sep 07 '16 16:09 drizzlelabs