mipatterson / typedoc-plugin-pages

A TypeDoc plugin that lets you integrate your own pages into the documentation output
Apache License 2.0
37 stars 21 forks source link

Cannot find resource `markdown-page.hbs` #15

Open alexandercerutti opened 4 years ago

alexandercerutti commented 4 years ago

Hi @mipatterson, thank you for this plugin.

I've installed the plugin and tried to build the docs. I receive the message

Cannot find resource `markdown-page.hbs`

as shown in the screenshot below. I don't know what could be the cause of this.

image

I'm using typedoc v0.17.6, typedoc-plugin-pages v1.0.1 and this is the configuration I used. It has been inserted in the tsconfig.json file, inside the object typedocOptions.

    "pages": {
      "groups": [{
        "title": "0.4.x to 0.5.0 Migration Guide",
        "path": "./docFiles/migrationGuide0.4.x-0.5.x"
      }],
      "output": "pages",
      "theme": "pages-plugin",
    }

My tsconfig.json is sibling of ./docFiles/ folder. Thank you!

mipatterson commented 4 years ago

The markdown-page.hbs file is the theme's handlebars template for rendering pages generated by this plugin. @alexandercerutti, could you double check that that file exists in /node_modules/typedoc-plugin-pages/dist/theme/v2/templates?

If that file is indeed there, then I suspect that the root cause could be a cross-platform issue. I can see from the screenshot that you are on a Mac. I developed the plugin on my Windows machine. I will try to reproduce this issue on my Mac, when I get a chance. If I see the issue there, I should be able to get a fix in.

alexandercerutti commented 4 years ago

I have it inside the folder. Yes, I'm on MacOS. Okay, I'll wait for updates. Thank you again. 😄

alexandercerutti commented 4 years ago

Hi, are there any updates? I'd like to look into the issue too, but I don't know where to start. 😄🤔

gino8080 commented 4 years ago

Hello I have a similar problem with the markdown plugin

here is the output

npx typedoc                              
Loaded plugin /Volumes/.../node_modules/typedoc-plugin-markdown
Loaded plugin /Volumes/.../node_modules/typedoc-plugin-pages

Using TypeScript 3.9.3 from /Volumes/.../node_modules/typescript/lib
ENOENT: no such file or directory, stat '/Volumes/.../node_modules/typedoc-plugin-markdown/dist/resources/assets'

this are my settings inside tsconfig.json (altro tried using a separate pagesconfig.json)

 "typedocOptions": {
    "inputFiles": [
      "./lib"
    ],
    "mode": "library",
    "out": "documentation/dist",
    "excludeNotExported": true,
    "excludePrivate": true,
    "excludeProtected": true,
    "disableSources": true,
    "theme": "pages-plugin",
    "pages": {
      "groups": [
        {
          "title": "Documentation",
          "pages": [
            {
              "title": "My Page",
              "path": "./documentation/index.md"
            }
          ]
        }
      ],
      "theme": "pages-plugin"
    }
  }
IchZerowan commented 4 years ago

Reproduceavble with typedoc 0.17.7 on Windows.

UPD: I was using the default TypeDoc theme instead of this plugin's one, with a proper theme everything is OK

MCluck90 commented 3 years ago

For what it's worth, I ran in to this problem when I wanted to use my own custom theme. I found out that I needed to create this file:

path/to/theme/templates/markdown-page.hbs

Here's the contents of that file:

<div class="tsd-panel tsd-typography">
    {{#markdown}}{{{model.pagesPlugin.item.contents}}}{{/markdown}}
</div>
mipatterson commented 3 years ago

@alexandercerutti

Sorry for the slow response. I've had a surprisingly small amount of time to dedicate to this project in 2020, considering quarantine.

I think it's likely that you're running into the same issue as @IchZerowan and @MCluck90. Make sure that you're telling TypeDoc to use the pages-plugin theme according to the TypeDoc documentation, here.

Previous plugin documentation incorrectly indicated that you could specify the theme in the Pages Plugin configuration object (like it appears you have above). The documentation has since been corrected. You should move the following line from the Pages Plugin configuration portion of your configuration to the top-level TypeDoc configuration:

"theme": "pages-plugin",
alexandercerutti commented 3 years ago

Hi @mipatterson Well, a lot of time passed and we needed the plugin for the project at work. We had to workaround the docs generation in another way. Sadly I won't be able to test this again soon... So for the moment, thank you for your reply. I'll see if I'll be able to look at this plug-in again.