Git Product home page Git Product logo

Comments (8)

jaydenseric avatar jaydenseric commented on June 19, 2024

The markdown structure for the generated API docs isn't customizable. What would you like to be different?

from jsdoc-md.

ErrorBot1122 avatar ErrorBot1122 commented on June 19, 2024

i don't know rn, because I keep getting this error:

Error running jsdoc-md:

  Error: Unable to get a code location for JSDoc source token `description`.
      at getJsdocSourceTokenCodeLocation (file:///home/runner/.npm-global/lib/node_modules/jsdoc-md/private/getJsdocSourceTokenCodeLocation.mjs:96:11)
      at jsdocCommentToMember (file:///home/runner/.npm-global/lib/node_modules/jsdoc-md/private/jsdocCommentToMember.mjs:353:33)
      at file:///home/runner/.npm-global/lib/node_modules/jsdoc-md/public/jsdocMd.mjs:98:29
      at async Promise.all (index 0)
      at async jsdocMd (file:///home/runner/.npm-global/lib/node_modules/jsdoc-md/public/jsdocMd.mjs:82:3)
      at async jsdocMdCli (file:///home/runner/.npm-global/lib/node_modules/jsdoc-md/cli/jsdoc-md.mjs:54:5)

from jsdoc-md.

jaydenseric avatar jaydenseric commented on June 19, 2024

It seems it's unable to parse the description part of a JSDoc comment correctly. Are you able to share minimal reproduction steps for the issue? Just the contents of a .js file that contains a single JSDoc comment that causes the error, with as much irrelevant details removed as possible.

from jsdoc-md.

ErrorBot1122 avatar ErrorBot1122 commented on June 19, 2024

@jaydenseric,

Now, I'm getting this error when I only read this file (Minimalsed Ver. Below)
TypeError: Argument 1 'markdown' must be a populated string.

/**
 * Check if the xml_Tag is the parse-able/parsed XML Tag
 * 
 * @param {*} xml_Tag - The object to check
 * @returns {Boolean}
*/
function isXMLTag(xml_Tag) {
...
}

/**
 * check if the item is the Item type
 * 
 * @param {*} item - The object to check
 * @returns {Boolean}
 */
const isItem = item => (isXMLTag(item) && item.$.referent) || !item.isParsed


/**
 * converts a referent id, item, or 
 * 
 * @param {String|Item|Instance} instance - the instance you want to convert
 * @returns {Instance}
 */
function convertValidInstance(instance) {
...
}

/**
 * @param {Array<Item>} itemList - A list of Item objects
 * @param {String} className - The name of the className
 * @param {String|Item|Instance} parent - The item's parent
 * @returns {null | Item}
 * @description Finds the first instance in 'itemList' with the same class as 'className'
 */
function findFirstItemByClassName(itemList, className, parent) {
...
}
/**
 * @param {Item} item - The Item you want convert
 * @param {String|Item|Instance} parent - The item's parent
 * @param {Object} options - extra options
 * 
 * @return {Instance | Item}
 */
function convertItemToInstance(item, parent, options) {
...
}
...

Full err:

Error running jsdoc-md:

  TypeError: Argument 1 `markdown` must be a populated string.
      at replaceMdSection (file:///home/runner/.npm-global/lib/node_modules/jsdoc-md/private/replaceMdSection.mjs:27:11)
      at jsdocMd (file:///home/runner/.npm-global/lib/node_modules/jsdoc-md/public/jsdocMd.mjs:111:19)
      at async jsdocMdCli (file:///home/runner/.npm-global/lib/node_modules/jsdoc-md/cli/jsdoc-md.mjs:54:5)

what i put in shell

jsdoc-md -s index.js

P.S: I'm not TENICLLY, installing it globally because it give me Error: EACCES: permission denied, access '/usr/local/lib/node_modules' error, so i followed this tutorial and just copied and pasted this:

npm config set prefix '~/.npm-global'
touch ~/.profile
export PATH=~/.npm-global/bin:$PATH
source ~/.profile

into my cmd line in repl.it project

from jsdoc-md.

jaydenseric avatar jaydenseric commented on June 19, 2024

I tried the code you shared on my computer, first using jsdoc-md dependencies as they were installed the last time I was working on it and again with a fresh node_modules installation (just in case an update to a dependency might be causing new users problems with fresh installs) and both worked fine.

I think there is something strange about the system you're on, and the problem is not likely to be the contents of your project code.

What would be interesting is if you were to clone this jsdoc-md project into a similar environment to the the project you're having problems with, then do an npm install within the jsdoc-md project and run npm run test:api to see exactly what parts of the API are not functioning as expected in that environment.

from jsdoc-md.

ErrorBot1122 avatar ErrorBot1122 commented on June 19, 2024

I cant do that because I use repl.it an online code editor

from jsdoc-md.

jaydenseric avatar jaydenseric commented on June 19, 2024

Double check the version of Node.js you're using matches what is supported:

"node": "^12.20 || >= 14.13"

Note that Node.js v17 is pretty new and jsdoc-md isn't tested yet with it in CI, so it might be a bit risky to use. I just ran the tests locally with Node.js v17.0.1 though and everything was fine.

Also, make sure npm is up to date.

Other than these suggestions, I'm not able to help you much further. The burden should be on repl.it to support packages that have been proven to work ok in a regular Node.js environment. Our GitHub Actions CI tests the full API and CLI with 100% code coverage, against supported Node.js versions on both Linux and macOS:

os: [ubuntu-latest, macos-latest]
node: ['12', '14', '16']

Feel free to investigate further if you like and consider reporting the problems you're experiencing to repl.it. If there is anything specific that can be improved about jsdoc-md let us know either here or via a PR :)

from jsdoc-md.

ErrorBot1122 avatar ErrorBot1122 commented on June 19, 2024

@jaydenseric,
repl.it's node version is v12.22.6 and npm's is also 6.14.15

I really don't know why this is helping or if it is only a repl.it problem, or even if it's my code!!!

i my have to contact the reply,it team about this

P.S: If you tried my code by just git cloning to or copying the main branch... that won't work, all my new code is in rep.lt and in the unable branch, as you can see here:
image

from jsdoc-md.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.