2017-04-24 5 views
1

DocFX 구성에서 누락 된 것이 있으므로 적절한 문서가 생성되지 않습니다. DocFX 'src'폴더에 대한 상대 경로

는 나는 다음과 같은 폴더 구조 한 :

+Documentation 
|- _site 
|- api 
|- apidoc 
|- articles 
|- images 
|- src <-- This folder is autogenerated by `docfx init` command as a folders above 
    docfx.json 
    index.md 
    toc.md 
+packages 
|- Microsoft.NETCore.Platforms.1.0.1 
|- ... other nuget folders 
+src 
|- MyRealProject 
    |- assets 
    |- bin 
    |- Commands 
    |- obj 
    |- Properties 
    |- vendor  <- This folder should be excluded for documentation 
    app.config 
    MyRealProject.csproj 
    MyRealProject.csproj.user 
    Program.cs 
+test 
|-MyRealProjext.XUnit 
    |- bin 
    |- obj 
    |- Properties 
    app.config 
.gitattributes 
.gitignore 
.gitmodule 
MyRealProject.sln 

내 docfx.json 다음 index.html에서 대신 목록 http://locahost:8080 열려있는 디렉토리로 탐색 할 때

{ 
    "metadata": [ 
    { 
     "src": [ 
     { 
      "files": [ 
      "**/*.csproj" 
      ], 
      "exclude": [ 
      "**/obj/**", 
      "**/bin/**", 
      "_site/**", 
      "vendor/**" 
      ], 
      "src": "../src" 
     } 
     ], 
     "dest": "api" 
    } 
    ], 
    "build": { 
    "content": [ 
     { 
     "files": [ 
      "api/**.yml", 
      "api/index.md" 
     ] 
     }, 
     { 
     "files": [ 
      "articles/**.md", 
      "articles/**/toc.yml", 
      "toc.yml", 
      "*.md" 
     ], 
     "exclude": [ 
      "obj/**", 
      "_site/**" 
     ] 
     } 
    ], 
    "resource": [ 
     { 
     "files": [ 
      "images/**" 
     ], 
     "exclude": [ 
      "obj/**", 
      "_site/**" 
     ] 
     } 
    ], 
    "overwrite": [ 
     { 
     "files": [ 
      "apidoc/**.md" 
     ], 
     "exclude": [ 
      "obj/**", 
      "_site/**" 
     ] 
     } 
    ], 
    "dest": "_site", 
    "globalMetadataFiles": [], 
    "fileMetadataFiles": [], 
    "template": [ 
     "default" 
    ], 
    "postProcessors": [], 
    "noLangKeyword": false 
    } 
} 

는하는 오류없이 문서를 생성 명령 docfx build을 실행하지만, _site 폴더. 난 그냥 폴더 목록이있는 웹 페이지를 참조하십시오 의미 : API/ apidoc/ 기사/ 이미지/ _SITE/ 등 와 나는 _site 폴더에 입력하고 index.html를 클릭하더라도 - 그것은을 열 않습니다를 생성 된 페이지를 docfx하지만 상단에 'API 문서'를 클릭하면 텍스트를 보여줍니다 TODO: Add .NET projects to the src folder and run docfx to generate REAL API Documentation!

  • 내가 제대로/src 폴더가 아닌/설명서/src 폴더를 읽을 것이다, 그래서 docfx.json에 무엇을 다시 구성해야합니까?
  • src/ 폴더에서 vendor/ 폴더를 제외하는 올바른 방법입니까?

답변

0

내 실수. 모든 것이 정상적으로 작동합니다.

Github에서 코드 다운로드를 사용 중이며 로컬로 컴파일되었습니다. 이 문제는 구성 파일 (예상대로 작동)이 아니라 템플릿 생성시 발생했습니다. 웬일인지 Github의 코드도 '기본'템플릿없이 제공됩니다. 따라서 첫 번째 단계를 수행 한 후에도 docfx.exe metadata -> 메타 데이터가 생성되었지만 템플릿 엔진이 없어서 컨텍스트 테이블 (TOC)로 변환되지 않았습니다. 따라서 docfx.exe build + serve을 실행하면 빈 사이트가 표시됩니다. '기본'템플릿 Github 페이지가 있습니다.

관련 문제