javascripthtmlmarkdowndocfx

Rendering docfx-built landing page from some html/javascript content


I have some .md files that are happily built into articles of a site generated by docfx. The landing page of this site which at the moment is a index.md file is empty. I have a separate static html page that its content is rendered by javascript containing some graph etc. What I would like to do is to render this html content as the landing page of the docfx site.

How do I do that?

Any help is much appreciated. Thanks.


Solution

  • If I understand your use case, this worked for me:

    Add index.html at root. This is your HTML landing page.

    Reference index.html in the resource object in docfx.json:

    "resource": [
          {
            "files": [
              "articles/**/media/**",
              "index.html"
            ]
    

    Reference index.html in toc.yml at root:

    - name: Home
      homepage: index.html
    

    Make sure you delete the previous site output directory (_site by default) before testing this new configuration.

    I would expect there is a more sophisticated way but maybe this can get you started.