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? Missing 'relativeURL' handlebars helper #97

Closed
mcortesi opened this issue Sep 18, 2019 · 5 comments
Closed

Bug? Missing 'relativeURL' handlebars helper #97

mcortesi opened this issue Sep 18, 2019 · 5 comments

Comments

@mcortesi
Copy link

I'm trying to run typedoc with markdown plugin and have the following error:

mcortesi packages/contractkit% ./node_modules/.bin/typedoc --theme markdown
Loaded plugin /Users/mcortesi/code/monorepo/node_modules/typedoc-plugin-markdown

Using TypeScript 3.5.3 from /Users/mcortesi/code/monorepo/node_modules/typescript/lib
Rendering [==--------------------------------------] 4%/Users/mcortesi/code/monorepo/node_modules/typedoc-plugin-markdown/dist/resources/helpers/type.js:35
        ? [`[${model.reflection.name}](${Handlebars.helpers.relativeURL.call(this, model.reflection.url)})`]

Which seems related to #41, but at least not the same error message.

I did try to run as suggested in #41 with: ./node_modules/.bin/typedoc --theme markdown

Not sure if this changes anything, but I have a monorepo and I'm trying to generate doc in one of the packages..

Apart from that, the typdoc.json is:

{
  "target": "es5",
  "module": ["es2017","dom"],
  "ignoreCompilerErrors": true,
  "includeDeclarations": false,
  "excludeProtected": true,
  "excludePrivate": true,
  "mode": "modules",
  "out": "docs-build",
  "theme": "markdown",
  "mdEngine": "gitbook",
  "stripExternal": false,
  "exclude": ["**/*.test.ts"],
  "readme": "README.md",
  "hideGenerator": "true",
  "verbose": true,
}

Any ideas?

@tgreyuk
Copy link
Member

tgreyuk commented Sep 18, 2019

Hi @mcortesi

For now, if you are running from the shell then you will need to point to locally installed typedoc ie:

$ node_modules/.bin/typedoc 

@mcortesi
Copy link
Author

That's what i did

mcortesi packages/contractkit% ./node_modules/.bin/typedoc --theme markdown

Maybe this is because of the monorepo setup?

I have:

monorepo/
   node_modules/
      typedoc/
      typepoc-plugin-markdown
   packages/
       contractkit/
           node_modules/.bin/typedoc (symlink to root node_module binary)
           src/**/*ts 
           typedoc.json
           tsconfig.json

And i run ./node_modules/.bin/typedoc --theme markdown in packages/congractkit

@mcortesi
Copy link
Author

Hi @mcortesi

For now, if you are running from the shell then you will need to point to locally installed typedoc ie:

$ node_modules/.bin/typedoc 

Why is this required?

On my research i found that Marked plugin in typedoc/output/plugins folder seems to be the one that register relativeURL helper. But I'm not sure how those plugins are loaded, or if the are plugin in the same way that typedoc-plugin-markdown is a plugin....

@tgreyuk
Copy link
Member

tgreyuk commented Sep 18, 2019

ok sorry - i realise you did explain that now. Will have a look.

@tgreyuk
Copy link
Member

tgreyuk commented Sep 27, 2019

Ok have looked into this and basically the plugin does need to be executed from the same location as the typedoc cmd. Othewise there is a conflict t with the instances of Handlebars. In your example you don't need to symlink typdoc but just reference from the root ie:

../../node_modules/.bin/typedoc

@tgreyuk tgreyuk closed this as completed Sep 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants