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

Include assets in specific directories, e.g. .github #2042

Open
D-Pow opened this issue Mar 4, 2023 · 0 comments
Open

Include assets in specific directories, e.g. .github #2042

D-Pow opened this issue Mar 4, 2023 · 0 comments

Comments

@D-Pow
Copy link

D-Pow commented Mar 4, 2023

Include assets in specific directories, e.g. .github

TL;DR - When using the jsdoc npm command, .github/ works locally but not when published to https://www.npmjs.com. In other words, the local path .github/docs/my-image.svg works when displaying the image locally or on GitHub, but it fails on https://www.npmjs.com/package/my-package because the asset(s) aren't copied over to the docs/ directory, nor is the markdown URL path rewritten from local to absolute (though this could be meditated if the local path would work).

Input code

My current config { "source": { "include": [ "src", "bin", "config/jsdoc.shim.js", ".github/docs/**" ], "includePattern": "\\.[jt]sx?$" }, "opts": { "destination": "./docs", "readme": "./ReadMe.md", "template": "node_modules/docdash" }, "tags": { "allowUnknownTags": true }, "templates": { "default": { "includeDate": false } }, "plugins": [ "config/jsdoc.fix-ts-type-defs-plugin.js", "node_modules/better-docs/typescript", "node_modules/better-docs/typedef-import" ], "markdown": { "idInHeadings": true }, "docdash": { "sort": false, "sectionOrder": [ "Modules", "Namespaces", "Classes" ], "typedefs": false, "meta": { "title": "Documentation", "description": "MockRequests will mock both XMLHttpRequest and fetch such that any requested URL will return the specified mock object instead of actually making an async request. URLs not configured will be unaffected and still trigger an async request as normal.", "keyword": "request HTTP requests XMLHttpRequest fetch mock mocks network" }, "menu": { "Demo": { "href": "./demo" }, "npm": { "href": "https://www.npmjs.com/package/mock-requests" }, "GitHub": { "href": "https://github.com/D-Pow/mock-requests" } } } }
// use config file above in ./config/jsdoc.config.json
// package.json
"myCommand": "jsdoc -c config/jsdoc.config.json"

JSDoc configuration

Use code above.

Expected behavior

I would expect any local path to be added to the final output, including if my website is published elsewhere.

Current behavior

The ReadMe/Markdown paths only work on GitHub itself, not if published elsewhere because the image assets aren't copied over to the "docs" dir (in this case due to opts.destination: ./docs in the config file).

Your environment

Any.

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

1 participant