GithubHelp home page GithubHelp logo

Comments (10)

75lb avatar 75lb commented on July 26, 2024

hi.. the example content is deliberately not escaped as some users like to embed real markup in their @example (some people use the output on internal sites which permit markup).. e.g.

/** 
Constructs some UI widget or other
@example
<div data-create-widget="UIWidget"></div>
*/
function UIWidget()
{
    ...
};

now, in their generated documentation, the UIWidget renders inline as desired..

if you want to wrap your example in a code block use the standard markdown syntax of either

/**Perform foo
@example
    foo('<a href="#baz">hi!</a>');
 */
function foo(bar)
{
    return '<strong>' + bar + '</strong>';
};

or

/**Perform foo
@example
`foo('<a href="#baz">hi!</a>');`
 */
function foo(bar)
{
    return '<strong>' + bar + '</strong>';
};

i'm working on the next version of the tool which has options to automatically wrap examples in code blocks, amongst other things

from jsdoc-to-markdown.

Joris-van-der-Wel avatar Joris-van-der-Wel commented on July 26, 2024

Ah, that is what I suspected. However the regular jsdoc (html output) has the opposite behaviour so an option would be indeed be useful. (I want to use both jsdoc and jsdoc2md in the same project)

Thanks

from jsdoc-to-markdown.

75lb avatar 75lb commented on July 26, 2024

the jsdoc html output might look correct, but if you run jsdoc -X against your code you'll see the issue in the underlying data.. try it:
$ jsdoc -X my-code.js

from jsdoc-to-markdown.

Joris-van-der-Wel avatar Joris-van-der-Wel commented on July 26, 2024

Yes I understand, this is why jsdoc does this escaping in the templates:

https://github.com/jsdoc3/jsdoc/blob/b5653b838ce7b96f97322c77e65f74c3086bd3d1/templates/default/tmpl/examples.tmpl#L10

This was added because of jsdoc/jsdoc#511

from jsdoc-to-markdown.

75lb avatar 75lb commented on July 26, 2024

hey there, i am testing the next version of the tool against your project - this is how the output currently looks: https://github.com/75lb/domv/blob/master/api.md

any feedback is welcome ;)

from jsdoc-to-markdown.

Joris-van-der-Wel avatar Joris-van-der-Wel commented on July 26, 2024

Awesome, that looks much better.

Here's some things I have noticed:

from jsdoc-to-markdown.

75lb avatar 75lb commented on July 26, 2024
  1. good idea ๐Ÿ‘
  2. ah yes, thanks
  3. yes, i will tackle this
  4. true - that needs fixing

thanks! will get back to you..

from jsdoc-to-markdown.

75lb avatar 75lb commented on July 26, 2024

here are the domv docs generated using the latest jsdoc2md code, how does it look?: https://github.com/75lb/domv/blob/master/api.md

  1. implemented.. take a look at domv/lib/HtmlDocument.. if you click an inherited member in the class member index it takes you to the docs in the parent class (Component).. this reduces duplication in the docs (before, docs for inherited Component members were duplicated inside the docs for HtmlDocument)..
  2. this was caused by <p> tags in the domv jsdoc documentation that did not have a closing </p>..
  3. done
  4. done

from jsdoc-to-markdown.

Joris-van-der-Wel avatar Joris-van-der-Wel commented on July 26, 2024

awesome that looks much better! I do not see any other issues, thanks

I committed the missing </p>

from jsdoc-to-markdown.

75lb avatar 75lb commented on July 26, 2024

good, glad you like it.. i will package up a pre-release of jsdoc2md for you to experiment with.. will get back to you later..

from jsdoc-to-markdown.

Related Issues (20)

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.