question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can not create docs

See original GitHub issue

Hi, I’m trying to port my existing docs to the markdown format. I have the following jsdoc config:

{
    "tags": {
        "allowUnknownTags": true
    },
    "source": {
        "include": "src",
        "includePattern": "\\.?js$",
        "excludePattern": "(node_modules/|docs)"
    },
    "plugins": [
        "plugins/markdown",
        "node_modules/jsdoc-export-default-interop/dist/index"
    ],
    "opts": {
        "template": "node_modules/docdash",
        "encoding": "utf8",
        "destination": "docs/",
        "recurse": true,
        "verbose": true
    },
    "templates": {
        "cleverLinks": false,
        "monospaceLinks": false
    }
}

My classes are located in .mjs files. jsdoc works fine with the following command and creates a number of documentation files:

$ yarn run jsdoc -c jsdoc.json app.mjs
yarn run v1.16.0
warning package.json: No license field
$ /mnt/c/develop/projects/pg/node_modules/.bin/jsdoc -c jsdoc.json app.mjs
Parsing /mnt/c/develop/projects/pg/app.mjs ...
Parsing /mnt/c/develop/projects/pg/src/db-classes/AbstractDbObject.mjs ...
Parsing /mnt/c/develop/projects/pg/src/db-classes/AbstractSchemaObject.mjs ...
Parsing /mnt/c/develop/projects/pg/src/db-classes/Attribute.mjs ...
Parsing /mnt/c/develop/projects/pg/src/db-classes/ChangesContext.mjs ...
Parsing /mnt/c/develop/projects/pg/src/db-classes/Column.mjs ...
Parsing /mnt/c/develop/projects/pg/src/db-classes/DataBase.mjs ...
Parsing /mnt/c/develop/projects/pg/src/db-classes/ForeignKey.mjs ...
Parsing /mnt/c/develop/projects/pg/src/db-classes/Function.mjs ...
Parsing /mnt/c/develop/projects/pg/src/db-classes/Index.mjs ...
Parsing /mnt/c/develop/projects/pg/src/db-classes/PrimaryKey.mjs ...
Parsing /mnt/c/develop/projects/pg/src/db-classes/Role.mjs ...
Parsing /mnt/c/develop/projects/pg/src/db-classes/Rows.mjs ...
Parsing /mnt/c/develop/projects/pg/src/db-classes/Schema.mjs ...
Parsing /mnt/c/develop/projects/pg/src/db-classes/Table.mjs ...
Parsing /mnt/c/develop/projects/pg/src/db-classes/Trigger.mjs ...
Parsing /mnt/c/develop/projects/pg/src/db-classes/Type.mjs ...
Parsing /mnt/c/develop/projects/pg/src/db-classes/utils.mjs ...
Parsing /mnt/c/develop/projects/pg/src/loader.mjs ...
Parsing /mnt/c/develop/projects/pg/src/plugins/AbstractPlugin.mjs ...
Parsing /mnt/c/develop/projects/pg/src/plugins/PostgraphilePlugin.mjs ...
Parsing /mnt/c/develop/projects/pg/src/psql.mjs ...
Parsing /mnt/c/develop/projects/pg/src/utils.mjs ...
Generating output files...
Finished running in 1.10 seconds.
Done in 1.26s.

But when I’m trying to run jsdoc2md with the same parameters I’m getting absolute nonsense:

$ yarn run jsdoc2md -c jsdoc.json app.mjs
yarn run v1.16.0
warning package.json: No license field
$ /mnt/c/develop/projects/pg/node_modules/.bin/jsdoc2md -c jsdoc.json app.mjs
<a name="buildChanges"></a>

## buildChanges(prevState, curState, prevVersion, curVersion) ⇒ <code>array</code>
Compare old and current states and return changes object with differences

**Kind**: global function

| Param |
| --- |
| prevState |
| curState |
| prevVersion |
| curVersion |

Done in 0.30s.
  1. All files in the src folder are ignored. Only the app.mjs file is processed.
  2. The docs folder is empty. But I need documentation files to be created there.
  3. Docs are printed to stdout. Why? If it is supposed to save the output to an .md file, it also will contain the yarn command output, which is unacceptable. Also, I prefer having multiple MD files instead of a single one.
  4. It seems like some options in the jsdoc.json configuration file are ignored. At least, source.include, opts.destination. And I didn’t find any documentation which options are effective which not. I also didn’t find any CLI options documentation.

How to make this command yarn run jsdoc2md -c jsdoc2.json app.mjs working as expected, same as jsdoc?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
75lbcommented, Dec 21, 2019

there seems to be an issue with yarn run, it has also been reported here. I don’t use yarn will take a look into it. If you figure out why npm run works but yarn run does not, let me know.

Jsdoc2md supports standard bash pattern matching, which includes the !(pattern-list) exclusion syntax. For example, operate on all files in all directories except node_modules and __tests__:

$ jsdoc2md "!(node_modules|__tests__)/**" > docs.md"
0reactions
zababurinsvcommented, Feb 28, 2021

My *.mjs files not work too

    "includePattern": "(./.+\\.(mjs|cjs)?$)",

jsdoc compiled this file

jsdoc  -c jsdoc.docs.json -r server_books.mjs -d ./test.md

package,json

    "[jsdoc2md]api": "jsdoc2md -c jsdoc.api.json --files server_books.js > API.md && npm run [jsdoc2md]api.cat",

Not compiled this file

jsdoc2md -c jsdoc.api.json --files server_books.mjs > API.md 

But compiled this file

jsdoc2md  --files server_books.js > API.md 

Am I connecting json correctly? This line does not work for me. Maybe mjs doesn’t work because json isn’t connected?

jsdoc2md -c jsdoc.api.json --files server_books.js > API.md 
Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't create docs in my google drive
Yes, I tried that first - I am online and oddly, this is my work drive and my personal drive has no problems...
Read more >
Google Drive Unable to Create New Documents [Solved]
How to fix the Google Drive issue where you are unable to create a new document. This is a common and very frustrating...
Read more >
Google Docs error leaves users unable to create a new ...
AN ERROR with Google Docs has left thousands of users unable to start a new document in the popular online word processor.
Read more >
Can't Create New/Blank File - Google Groups
I'm on Mac OXS Yosemite 10.10.4. GWD will open, but I cannot create a new/blank file. After I hit OK it just doesn't...
Read more >
I can't create new documents in OneDrive - Microsoft Community
Log in to OneDrive, and then change the location to your new folder. Check if giving full permissions to users, and placing the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found