{"componentChunkName":"component---src-pages-index-js","path":"/","result":{"data":{"allMarkdownRemark":{"edges":[{"node":{"html":"<h1>TOAST UI Doc</h1>\n<blockquote>\n<p>TOAST UI Doc is a documentation generator used with TOAST UI products that allows you to create documentations for any JavaScript library easily.</p>\n</blockquote>\n<p><a href=\"https://github.com/nhn/toast-ui.doc/releases/latest\"><img src=\"https://img.shields.io/github/v/release/nhn/toast-ui.doc?include_prereleases\" alt=\"GitHub release\"></a> <a href=\"https://www.npmjs.com/package/@toast-ui/doc\"><img src=\"https://img.shields.io/npm/v/@toast-ui/doc\" alt=\"npm\"></a> <a href=\"https://github.com/nhn/toast-ui.doc/blob/master/LICENSE\"><img src=\"https://img.shields.io/github/license/nhn/toast-ui.doc.svg\" alt=\"GitHub license\"></a> <a href=\"https://github.com/nhn/toast-ui.doc/pulls\"><img src=\"https://img.shields.io/badge/PRs-welcome-ff69b4.svg\" alt=\"PRs welcome\"></a> <a href=\"https://github.com/nhn\"><img src=\"https://img.shields.io/badge/%3C%2F%3E%20with%20%E2%99%A5%20by-NHN-ff1414.svg\" alt=\"code with hearth by NHN\"></a></p>\n<p><img src=\"https://user-images.githubusercontent.com/18183560/63479557-bd9a7e00-c4c9-11e9-96d7-4a2cf694e1e7.png\" alt=\"toastui-doc\"></p>\n<h2>🚩 Table of Contents</h2>\n<ul>\n<li><a href=\"#-what-is-toast-ui-doc\">What is TOAST UI Doc?</a></li>\n<li>\n<p><a href=\"#-main-features\">Main Features</a></p>\n<ul>\n<li><a href=\"#api-page\">API Page</a></li>\n<li><a href=\"#examples-page\">Examples Page</a></li>\n<li><a href=\"#search-feature\">Search Feature</a></li>\n<li><a href=\"#permalink\">Permalink</a></li>\n<li><a href=\"#customizable-layout-contents\">Customizable Layout Contents</a></li>\n<li><a href=\"#simple-builds\">Simple Builds</a></li>\n</ul>\n</li>\n<li><a href=\"#-demo\">Demo</a></li>\n<li>\n<p><a href=\"#-usage\">Usage</a></p>\n<ul>\n<li><a href=\"#install\">Install</a></li>\n<li><a href=\"#adding-config-files\">Adding Config Files</a></li>\n<li><a href=\"#setting-options-in-config-files\">Setting Options in Config Files</a></li>\n<li><a href=\"#running-the-command\">Running the Command</a></li>\n</ul>\n</li>\n<li><a href=\"#-contributing\">Contributing</a></li>\n<li><a href=\"#-license\">License</a></li>\n</ul>\n<h2>📑 What is TOAST UI Doc?</h2>\n<p>TOAST UI Doc is a documentation generator used with TOAST UI products, and is a module that creates a single documentation by combining the API document created by parsing the <a href=\"https://jsdoc.app/\">JSDoc comments</a> with the example page. TOAST UI Doc uses the <a href=\"https://documentation.js.org\">documentation.js</a> and <a href=\"https://www.gatsbyjs.org\">Gatsby</a>. The layouts TOAST UI Doc is created with Gatsby to be a <a href=\"https://reactjs.org/\">React</a> component. Simply by configuring the options and running TOAST UI Doc, you can easily create documentations for any JavaScript library.</p>\n<h2>🎨 Main Features</h2>\n<h3>API Page</h3>\n<p>TOAST UI Doc parses the JSDoc composed within the JavaScript file to create the API page. The API page can mainly be categorized into seven types, and is represented as a menu in the Local Navigation Bar (LNB).</p>\n<ul>\n<li>MODULES</li>\n<li>EXTERNALS</li>\n<li>CLASSES</li>\n<li>NAMESPACES</li>\n<li>MIXINS</li>\n<li>TYPEDEF</li>\n</ul>\n<p>Furthermore, each type has a submenu, and you can easily check the inheritance or mixin relationship, member (property, method) and other custom event API information.</p>\n<ul>\n<li>EXTENDS</li>\n<li>MIXES</li>\n<li>STATIC PROPERTIES</li>\n<li>STATIC METHODS</li>\n<li>INSTANCE METHODS</li>\n<li>EVENTS</li>\n</ul>\n<h3>Examples Page</h3>\n<p>TOAST UI Doc reads the HTML file to directly create an Examples page. If you use appropriate selectors for each Example page, you can display HTML and JavaScript snippets within the page. The Try-it-yourself demos and each code snippet are provided as tabs.</p>\n<h3>Search Feature</h3>\n<p>You can use the search bar in the top portion of the local navigation bar (LNB) to search for any API and Example pages provided by TOAST UI Doc. TOAST UI Doc also comes with auto-complete feature to facilitate faster transversals between API and Examples pages for users.</p>\n<h3>Permalink</h3>\n<p>TOAST UI Doc provides a <a href=\"https://help.github.com/en/articles/getting-permanent-links-to-files\">Github Permalink</a> feature. The permalinks can be found at the top right of each API area, and links the location where the JSDoc file is to the Github repository. Permalinks can be useful when directly accessing the API codes and JSDoc contents for reference.</p>\n<h3>Customizable Layout Contents</h3>\n<p>TOAST UI Doc layouts can mainly be categorized in Header, Footer, LNB, Contents (Main, API, and Examples). You can use the config file to readily customize which content goes in Header and Footer areas. Furthermore, if necessary, you can configure whether or not to expose the Examples page.</p>\n<h3>Simple Builds</h3>\n<p>TOAST UI Doc comes with Gatsby built into it, so when the build takes place, Gatsby script runs automatically to compile documentation files into a folder. By uploading the created folder onto the <a href=\"https://pages.github.com/\">Github Pages</a> or onto a server, you can easily create your public API page.</p>\n<h2>🐾 Demo</h2>\n<ul>\n<li><a href=\"https://nhn.github.io/toast-ui.doc/latest/\">https://nhn.github.io/toast-ui.doc/latest/</a></li>\n</ul>\n<h2>🔨 Usage</h2>\n<h3>Install</h3>\n<p>Use npm to install it globally.</p>\n<div class=\"gatsby-highlight\" data-language=\"sh\"><pre class=\"tui-language-sh\"><code class=\"tui-language-sh\">$ npm install -g @toast-ui/doc</code></pre></div>\n<h3>Adding Config Files</h3>\n<p>Add your config files to the root of your working directory. The config file must be in the form of <code class=\"tui-language-text\">tuidoc.config.json</code>.</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"tui-language-text\"><code class=\"tui-language-text\">project/\n├─ ...\n├─ package.json\n└─ tuidoc.config.json</code></pre></div>\n<h3>Setting Options in Config Files</h3>\n<p>The <code class=\"tui-language-text\">tuidoc.config.json</code> file can be used to configure following options, and such options can be customized to create more approprite documents. For a full explanation on using options, refer to <a href=\"https://github.com/nhn/toast-ui.doc/blob/master/tuidoc.config.json\">here</a>.</p>\n<h4>Configuring the Header Area</h4>\n<p><code class=\"tui-language-text\">[logo] / [text] [version]</code> can be exposed sequentially.</p>\n<table>\n<thead>\n<tr>\n<th>Option</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code class=\"tui-language-text\">header.logo.src</code></td>\n<td><code class=\"tui-language-text\">string</code></td>\n<td>Configures the path for the logo image source.</td>\n</tr>\n<tr>\n<td><code class=\"tui-language-text\">header.logo.linkUrl</code></td>\n<td><code class=\"tui-language-text\">?string</code></td>\n<td>Embeds a URL link onto the logo image. The default is set to be the root (<code class=\"tui-language-text\">/</code>).</td>\n</tr>\n<tr>\n<td><code class=\"tui-language-text\">header.title</code></td>\n<td><code class=\"tui-language-text\">object \\| boolean</code></td>\n<td>Determines whether or not to display a text to the right of the logo.</td>\n</tr>\n<tr>\n<td><code class=\"tui-language-text\">header.title.text</code></td>\n<td><code class=\"tui-language-text\">?string</code></td>\n<td>When displaying text, declares the value of the to be displayed text. The default is set to be the <code class=\"tui-language-text\">name</code> value of the <code class=\"tui-language-text\">package.json</code>.</td>\n</tr>\n<tr>\n<td><code class=\"tui-language-text\">header.title.linkUrl</code></td>\n<td><code class=\"tui-language-text\">?string</code></td>\n<td>When displaying text, configures a URL link onto the text. The default is set to be the <code class=\"tui-language-text\">github</code> value of <code class=\"tui-language-text\">package.json</code>.</td>\n</tr>\n<tr>\n<td><code class=\"tui-language-text\">header.version</code></td>\n<td><code class=\"tui-language-text\">?boolean</code></td>\n<td>Determines whether or not to display the module version. The default is set to be <code class=\"tui-language-text\">true</code>, and the <code class=\"tui-language-text\">version</code> value of <code class=\"tui-language-text\">package.json</code> will be displayed.</td>\n</tr>\n</tbody>\n</table>\n<h4>Configuring the Footer Area</h4>\n<p>A list of product related links including company information can be displayed.</p>\n<table>\n<thead>\n<tr>\n<th>Option</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code class=\"tui-language-text\">footer[].title</code></td>\n<td><code class=\"tui-language-text\">string</code></td>\n<td>Configures the link text.</td>\n</tr>\n<tr>\n<td><code class=\"tui-language-text\">footer[].linkUrl</code></td>\n<td><code class=\"tui-language-text\">string</code></td>\n<td>Configures the link URL.</td>\n</tr>\n</tbody>\n</table>\n<h4>Configuring the Main Page</h4>\n<table>\n<thead>\n<tr>\n<th>Option</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code class=\"tui-language-text\">main.filePath</code></td>\n<td><code class=\"tui-language-text\">string</code></td>\n<td>Configures the file path to be displayed on the main page, and the file must be a markdown (<code class=\"tui-language-text\">*.md</code>) file. The default is set to be the <code class=\"tui-language-text\">README.md</code> file found in the project folder.</td>\n</tr>\n</tbody>\n</table>\n<h4>Configuring the API Page</h4>\n<table>\n<thead>\n<tr>\n<th>Option</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code class=\"tui-language-text\">api.filePath</code></td>\n<td><code class=\"tui-language-text\">string \\| array</code></td>\n<td>Configures the file path to be displayed on the API page (the file to be parsed using JSDoc). When declaring the path to be the entire folder, declare it as a <code class=\"tui-language-text\">string</code>, and for individual files, use an <code class=\"tui-language-text\">array</code>. Only JavaScript files (<code class=\"tui-language-text\">*.js</code>) can be parsed.</td>\n</tr>\n<tr>\n<td><code class=\"tui-language-text\">api.permalink</code></td>\n<td><code class=\"tui-language-text\">object \\| boolean</code></td>\n<td>Determines whether or not to use permalinks. If set to <code class=\"tui-language-text\">false</code>, permalinks are hidden.</td>\n</tr>\n<tr>\n<td><code class=\"tui-language-text\">api.permalink.repository</code></td>\n<td><code class=\"tui-language-text\">?string</code></td>\n<td>If using permalinks, configures the Github repository URL. The default is set to be the <code class=\"tui-language-text\">github</code> value of <code class=\"tui-language-text\">package.json</code>.</td>\n</tr>\n<tr>\n<td><code class=\"tui-language-text\">api.permalink.ref</code></td>\n<td><code class=\"tui-language-text\">?string</code></td>\n<td>If using permalinks, configures the branch or the tag. This option can be used to declare the hash value of a specific commit. The default value is set to be <code class=\"tui-language-text\">v{SemVer}</code>.</td>\n</tr>\n</tbody>\n</table>\n<h4>Configuring the Examples Page</h4>\n<table>\n<thead>\n<tr>\n<th>Option</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code class=\"tui-language-text\">examples</code></td>\n<td><code class=\"tui-language-text\">object \\| boolean</code></td>\n<td>Configures options to use the Examples page. If set to <code class=\"tui-language-text\">false</code>, the Examples tab is hidden from the local navigation bar.</td>\n</tr>\n<tr>\n<td><code class=\"tui-language-text\">examples.filePath</code></td>\n<td><code class=\"tui-language-text\">string</code></td>\n<td>Configures the file path to be displayed on the Examples page. Declare the folder with example files in <code class=\"tui-language-text\">string</code> format.</td>\n</tr>\n<tr>\n<td><code class=\"tui-language-text\">examples.titles</code></td>\n<td><code class=\"tui-language-text\">object</code></td>\n<td>Maps each example file to the menu name to be displayed on the local navigation bar. The configuration should be made in <code class=\"tui-language-text\">{ [Example File Name]: [LNB Menu Name]}</code> format.</td>\n</tr>\n<tr>\n<td><code class=\"tui-language-text\">examples.globalErrorLogVariable</code></td>\n<td><code class=\"tui-language-text\">?string \\| ?boolean</code></td>\n<td>Automatically inserts the code snippet that puts the error in the example page into a global variable. Variable names can be set directly as strings. If set to <code class=\"tui-language-text\">true</code>, the default <code class=\"tui-language-text\">errorLogs</code> is used.</td>\n</tr>\n</tbody>\n</table>\n<h4>Others</h4>\n<table>\n<thead>\n<tr>\n<th>Option</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code class=\"tui-language-text\">pathPrefix</code></td>\n<td><code class=\"tui-language-text\">string</code></td>\n<td>Only used when the created documentation file exists at a location that is not the root of the Github repository or the server, and is used to declare the specific path. If not configured, the documentation may be prone to link reference error due to the lack of the resource file.</td>\n</tr>\n</tbody>\n</table>\n<h3>Configuring the Files for Examples Page</h3>\n<p>In order to display the tabular content in the Examples page, additional configuration is necessary besides managing the options. The page that is finally displayed on the Result tab is the file that has been configured using the <code class=\"tui-language-text\">examples</code> option, and has to be of HTML format. The code snippets found in JavaScript tab and HTML tab must be declared to be <code class=\"tui-language-text\">code-js</code> and <code class=\"tui-language-text\">code-html</code> class, respectively. For the basic template, see <a href=\"https://github.com/nhn/toast-ui.doc/blob/master/demo/examples/example01-default-template.html\">here</a>.</p>\n<div class=\"gatsby-highlight\" data-language=\"html\"><pre class=\"tui-language-html\"><code class=\"tui-language-html\">...\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>div</span> <span class=\"token attr-name\">class</span><span class=\"token attr-value\"><span class=\"token punctuation\">=</span><span class=\"token punctuation\">\"</span>code-html<span class=\"token punctuation\">\"</span></span><span class=\"token punctuation\">></span></span>\n  <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>div</span> <span class=\"token attr-name\">id</span><span class=\"token attr-value\"><span class=\"token punctuation\">=</span><span class=\"token punctuation\">\"</span>wrapper<span class=\"token punctuation\">\"</span></span><span class=\"token punctuation\">></span></span><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>div</span><span class=\"token punctuation\">></span></span>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>div</span><span class=\"token punctuation\">></span></span>\n...\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>script</span> <span class=\"token attr-name\">type</span><span class=\"token attr-value\"><span class=\"token punctuation\">=</span><span class=\"token punctuation\">\"</span>text/javascript<span class=\"token punctuation\">\"</span></span> <span class=\"token attr-name\">class</span><span class=\"token attr-value\"><span class=\"token punctuation\">=</span><span class=\"token punctuation\">\"</span>code-js<span class=\"token punctuation\">\"</span></span><span class=\"token punctuation\">></span></span><span class=\"token script\"><span class=\"token language-javascript\">\n  <span class=\"token function\">alert</span><span class=\"token punctuation\">(</span><span class=\"token string\">'Hello!'</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n</span></span><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>script</span><span class=\"token punctuation\">></span></span>\n...</code></pre></div>\n<h3>Running the Command</h3>\n<p>TOAST UI Doc provides a <code class=\"tui-language-text\">tuidoc</code> CLI, and running the following command will allow you to build your documentation based on the environment settings that you have configured above. First, the Gatsby, wrapped by TOAST UI Doc, is executed, and the <code class=\"tui-language-text\">--serv</code> flag can be used to preview the created documentation on your local machine.</p>\n<div class=\"gatsby-highlight\" data-language=\"sh\"><pre class=\"tui-language-sh\"><code class=\"tui-language-sh\">$ tuidoc --serv</code></pre></div>\n<p>When you are done verifying the local product, running <code class=\"tui-language-text\">tuidoc</code> command will create two folders, <code class=\"tui-language-text\">_latest</code> and <code class=\"tui-language-text\">_[SemVer]</code>, under the project root directory. These folders can be used to upload to a server.</p>\n<div class=\"gatsby-highlight\" data-language=\"sh\"><pre class=\"tui-language-sh\"><code class=\"tui-language-sh\">$ tuidoc</code></pre></div>\n<p>Or, you can add the commands as scripts to the project's <code class=\"tui-language-text\">package.json</code> file.</p>\n<div class=\"gatsby-highlight\" data-language=\"json\"><pre class=\"tui-language-json\"><code class=\"tui-language-json\"><span class=\"token punctuation\">{</span>\n  <span class=\"token property\">\"scripts\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">{</span>\n    <span class=\"token property\">\"doc:serve\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"tuidoc --serv\"</span><span class=\"token punctuation\">,</span>\n    <span class=\"token property\">\"doc\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"tuidoc\"</span>\n  <span class=\"token punctuation\">}</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<h2>🔧 Making a Pull Request</h2>\n<p>All TOAST UI products are open source. A Pull Request (PR) can be made upon fixing an issue or developing additional features to be implemented.</p>\n<h3>Install</h3>\n<p>To install, first fork the <code class=\"tui-language-text\">master</code> branch to your own personal repository. Then, clone the forked repository to your local machine, and install the following node module. Prior to development, first, make sure that the modules are properly installed.</p>\n<div class=\"gatsby-highlight\" data-language=\"sh\"><pre class=\"tui-language-sh\"><code class=\"tui-language-sh\">$ git clone https://github.com/{your-personal-repo}/toast-ui.doc.git\n$ cd toast-ui.doc\n$ npm install\n$ npm run test</code></pre></div>\n<h3>Development</h3>\n<p>Use your local machine for the development process. During the development process, you can use two types of <code class=\"tui-language-text\">tuidoc</code> scripts, and you can determine which script to use according to your situation.</p>\n<h4>Running the Dev Server</h4>\n<p>When the script is run, Gatsby initiates a webpack dev server. You can preview the changes you have made to any react components under <code class=\"tui-language-text\">src</code> folder in realtime. You can connect to the dev server by going to <code class=\"tui-language-text\">localhost:8000</code>.</p>\n<div class=\"gatsby-highlight\" data-language=\"sh\"><pre class=\"tui-language-sh\"><code class=\"tui-language-sh\">$ npm run tuidoc:dev</code></pre></div>\n<h4>Checking the Build Status</h4>\n<p>When the script is run, Gatsby begins the build as well as the server so that you can check that the created documentation performs properly. In order to check the status of the documentation before distribution, connect to <code class=\"tui-language-text\">localhost:9000</code>.</p>\n<div class=\"gatsby-highlight\" data-language=\"sh\"><pre class=\"tui-language-sh\"><code class=\"tui-language-sh\">$ npm run tuidoc:serve</code></pre></div>\n<h3>Pull Request</h3>\n<p>Finally, perform a final check in order to make sure that there are no problems with your before making a pull request. If none are found, commit, and push it to the repository.</p>\n<p>For more detailed explanation on making a PR, refer to the <strong>Contributing</strong> appendix below.</p>\n<h2>💬 Contributing</h2>\n<ul>\n<li><a href=\"https://github.com/nhn/toast-ui.doc/blob/master/CODE_OF_CONDUCT.md\">Code of Conduct</a></li>\n<li><a href=\"https://github.com/nhn/toast-ui.doc/blob/master/CONTRIBUTING.md\">Contributing guideline</a></li>\n<li><a href=\"https://github.com/nhn/toast-ui.doc/tree/master/.github/ISSUE_TEMPLATE\">Issue guideline</a></li>\n<li><a href=\"https://github.com/nhn/toast-ui.doc/blob/master/docs/COMMIT_MESSAGE_CONVENTION.md\">Commit convention</a></li>\n</ul>\n<h2>📜 License</h2>\n<p>This software is provided under <a href=\"https://github.com/nhn/toast-ui.doc/blob/master/LICENSE\">MIT License</a>. © <a href=\"https://github.com/nhn\">NHN</a>.</p>"}}]}},"pageContext":{}}}