OverviewFilesCommitsIssuesDocsReleasesPeers

ollama_semantic_function_calling / ollamatools-new / keet / node_modules / markdown-it-html5-media / docs / HTML5Media.html

1284 lines · html ref:
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JSDoc: Namespace: HTML5Media</title>

    <script src="scripts/prettify/prettify.js"> </script>
    <script src="scripts/prettify/lang-css.js"> </script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

    <h1 class="page-title">Namespace: HTML5Media</h1>

    




<section>

<header>
    
        <h2>HTML5Media</h2>
        
    
</header>

<article>
    <div class="container-overview">
    
        
            <div class="description"><p>A minimalist <code>markdown-it</code> plugin for parsing video/audio references inside
markdown image syntax as <code>&lt;video&gt;</code> / <code>&lt;audio&gt;</code> tags.</p></div>
        

        


<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="index.js.html">index.js</a>, <a href="index.js.html#line5">line 5</a>
    </li></ul></dd>
    

    

    

    
</dl>


        
    
    </div>

    

    

    

    

    

    

    

    
        <h3 class="subsection-title">Methods</h3>

        
            

    

    
    <h4 class="name" id=".guessMediaType"><span class="type-signature">(static) </span>guessMediaType<span class="signature">(url)</span><span class="type-signature"> &rarr; {String}</span></h4>
    

    



<div class="description">
    <p>Guess the media type represented by a URL based on the file extension,
if any</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>url</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            

            

            <td class="description last"><p>any valid URL</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="index.js.html">index.js</a>, <a href="index.js.html#line247">line 247</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>a type identifier: 'image' (default for all unrecognized URLs), 'audio'
or 'video'</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">String</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id=".html5Media"><span class="type-signature">(static) </span>html5Media<span class="signature">(md, options<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>The main plugin function, exported as module.exports</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>md</code></td>
            

            <td class="type">
            
                
<span class="param-type">MarkdownIt</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>instance, automatically passed by md.use</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>configuration</p>
                <h6>Properties</h6>
                

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>videoAttrs</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    'controls class="html5-video-player"'
                
                </td>
            

            <td class="description last"><p>attributes to include inside <code>&lt;video&gt;</code> tags</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>audioAttrs</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    'controls class="html5-audio-player"'
                
                </td>
            

            <td class="description last"><p>attributes to include inside <code>&lt;audio&gt;</code> tags</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>messages</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="global.html#MessagesObj">MessagesObj</a></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    built-in messages
                
                </td>
            

            <td class="description last"><p>human-readable text that is part of the output</p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="index.js.html">index.js</a>, <a href="index.js.html#line324">line 324</a>
    </li></ul></dd>
    

    

    

    
</dl>




















        
            

    

    
    <h4 class="name" id=".renderMedia"><span class="type-signature">(static) </span>renderMedia<span class="signature">(tokens, idx, options, env, md)</span><span class="type-signature"> &rarr; {String}</span></h4>
    

    



<div class="description">
    <p>Render tokens of the video/audio type to HTML5 tags</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>tokens</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            

            

            <td class="description last"><p>token stream</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>idx</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            

            

            <td class="description last"><p>which token are we rendering</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            

            

            <td class="description last"><p>Markdown-It options, including this plugin's settings</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>env</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            

            

            <td class="description last"><p>Markdown-It environment, potentially including language setting</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>md</code></td>
            

            <td class="type">
            
                
<span class="param-type">MarkdownIt</span>


            
            </td>

            

            

            <td class="description last"><p>instance used for utilities access</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="index.js.html">index.js</a>, <a href="index.js.html#line278">line 278</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>rendered token</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">String</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id=".tokenizeImagesAndMedia"><span class="type-signature">(static) </span>tokenizeImagesAndMedia<span class="signature">(state, silent, md)</span><span class="type-signature"> &rarr; {Boolean}</span></h4>
    

    



<div class="description">
    <p>A fork of the built-in image tokenizer which guesses video/audio files based
on their extension, and tokenizes them accordingly.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>state</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            

            

            <td class="description last"><p>Markdown-It state</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>silent</code></td>
            

            <td class="type">
            
                
<span class="param-type">Boolean</span>


            
            </td>

            

            

            <td class="description last"><p>if true, only validate, don't tokenize</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>md</code></td>
            

            <td class="type">
            
                
<span class="param-type">MarkdownIt</span>


            
            </td>

            

            

            <td class="description last"><p>instance of Markdown-It used for utility functions</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="index.js.html">index.js</a>, <a href="index.js.html#line83">line 83</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Boolean</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id=".translate"><span class="type-signature">(static) </span>translate<span class="signature">(language, messageKey, messageParams)</span><span class="type-signature"> &rarr; {String}</span></h4>
    

    



<div class="description">
    <p>You can override this function using options.translateFn.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>language</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            

            

            <td class="description last"><p>a language code, typically an ISO 639-[1-3] code.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>messageKey</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            

            

            <td class="description last"><p>an identifier for the message, typically a short descriptive text</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>messageParams</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array.&lt;String></span>


            
            </td>

            

            

            <td class="description last"><p>Strings to be substituted into the message using some pattern, e.g., %s or
%1$s, %2$s. By default we only use a simple %s pattern.</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="index.js.html">index.js</a>, <a href="index.js.html#line50">line 50</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>the translation to use</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">String</span>


    </dd>
</dl>

    





        
    

    

    
</article>

</section>




</div>

<nav>
    <h2><a href="index.html">Home</a></h2><h3>Namespaces</h3><ul><li><a href="HTML5Media.html">HTML5Media</a></li></ul><h3><a href="global.html">Global</a></h3>
</nav>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Sat Jan 29 2022 22:21:26 GMT-0800 (Pacific Standard Time)
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>