• Stars
    star
    115
  • Rank 305,916 (Top 7 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

TOAST UI Doc

TOAST UI Doc is a documentation generator used with TOAST UI products that allows you to create documentations for any JavaScript library easily.

GitHub release npm GitHub license PRs welcome code with hearth by NHN

toastui-doc

๐Ÿšฉ Table of Contents

๐Ÿ“‘ What is TOAST UI Doc?

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 JSDoc comments with the example page. TOAST UI Doc uses the documentation.js and Gatsby. The layouts TOAST UI Doc is created with Gatsby to be a React component. Simply by configuring the options and running TOAST UI Doc, you can easily create documentations for any JavaScript library.

๐ŸŽจ Main Features

API Page

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).

  • MODULES
  • EXTERNALS
  • CLASSES
  • NAMESPACES
  • MIXINS
  • TYPEDEF

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.

  • EXTENDS
  • MIXES
  • STATIC PROPERTIES
  • STATIC METHODS
  • INSTANCE METHODS
  • EVENTS

Examples Page

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.

Search Feature

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.

Permalink

TOAST UI Doc provides a Github Permalink 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.

Customizable Layout Contents

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.

Simple Builds

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 Github Pages or onto a server, you can easily create your public API page.

๐Ÿพ Demo

๐Ÿ”จ Usage

Install

Use npm to install it globally.

$ npm install -g @toast-ui/doc

Adding Config Files

Add your config files to the root of your working directory. The config file must be in the form of tuidoc.config.json.

project/
โ”œโ”€ ...
โ”œโ”€ package.json
โ””โ”€ tuidoc.config.json

Setting Options in Config Files

The tuidoc.config.json 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 here.

Configuring the Header Area

[logo] / [text] [version] can be exposed sequentially.

Option Type Description
header.logo.src string Configures the path for the logo image source.
header.logo.linkUrl ?string Embeds a URL link onto the logo image. The default is set to be the root (/).
header.title object | boolean Determines whether or not to display a text to the right of the logo.
header.title.text ?string When displaying text, declares the value of the to be displayed text. The default is set to be the name value of the package.json.
header.title.linkUrl ?string When displaying text, configures a URL link onto the text. The default is set to be the github value of package.json.
header.version ?boolean Determines whether or not to display the module version. The default is set to be true, and the version value of package.json will be displayed.

Configuring the Footer Area

A list of product related links including company information can be displayed.

Option Type Description
footer[].title string Configures the link text.
footer[].linkUrl string Configures the link URL.

Configuring the Main Page

Option Type Description
main.filePath string Configures the file path to be displayed on the main page, and the file must be a markdown (*.md) file. The default is set to be the README.md file found in the project folder.

Configuring the API Page

Option Type Description
api.filePath string | array 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 string, and for individual files, use an array. Only JavaScript files (*.js) can be parsed.
api.permalink object | boolean Determines whether or not to use permalinks. If set to false, permalinks are hidden.
api.permalink.repository ?string If using permalinks, configures the Github repository URL. The default is set to be the github value of package.json.
api.permalink.ref ?string 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 v{SemVer}.

Configuring the Examples Page

Option Type Description
examples object | boolean Configures options to use the Examples page. If set to false, the Examples tab is hidden from the local navigation bar.
examples.filePath string Configures the file path to be displayed on the Examples page. Declare the folder with example files in string format.
examples.titles object Maps each example file to the menu name to be displayed on the local navigation bar. The configuration should be made in { [Example File Name]: [LNB Menu Name]} format.
examples.globalErrorLogVariable ?string | ?boolean 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 true, the default errorLogs is used.

Others

Option Type Description
pathPrefix string 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.

Configuring the Files for Examples Page

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 examples option, and has to be of HTML format. The code snippets found in JavaScript tab and HTML tab must be declared to be code-js and code-html class, respectively. For the basic template, see here.

...
<div class="code-html">
  <div id="wrapper"></div>
</div>
...
<script type="text/javascript" class="code-js">
  alert('Hello!');
</script>
...

Running the Command

TOAST UI Doc provides a tuidoc 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 --serv flag can be used to preview the created documentation on your local machine.

$ tuidoc --serv

When you are done verifying the local product, running tuidoc command will create two folders, _latest and _[SemVer], under the project root directory. These folders can be used to upload to a server.

$ tuidoc

Or, you can add the commands as scripts to the project's package.json file.

{
  "scripts": {
    "doc:serve": "tuidoc --serv",
    "doc": "tuidoc"
  }
}

๐Ÿ”ง Making a Pull Request

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.

Install

To install, first fork the master 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.

$ git clone https://github.com/{your-personal-repo}/toast-ui.doc.git
$ cd toast-ui.doc
$ npm install
$ npm run test

Development

Use your local machine for the development process. During the development process, you can use two types of tuidoc scripts, and you can determine which script to use according to your situation.

Running the Dev Server

When the script is run, Gatsby initiates a webpack dev server. You can preview the changes you have made to any react components under src folder in realtime. You can connect to the dev server by going to localhost:8000.

$ npm run tuidoc:dev

Checking the Build Status

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 localhost:9000.

$ npm run tuidoc:serve

Pull Request

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.

For more detailed explanation on making a PR, refer to the Contributing appendix below.

๐Ÿ’ฌ Contributing

๐Ÿ“œ License

This software is provided under MIT License. ยฉ NHN Cloud.

More Repositories

1

tui.editor

๐Ÿž๐Ÿ“ Markdown WYSIWYG Editor. GFM Standard + Chart & UML Extensible.
TypeScript
16,941
star
2

tui.calendar

๐Ÿž๐Ÿ“…A JavaScript calendar that has everything you need.
TypeScript
11,682
star
3

tui.image-editor

๐Ÿž๐ŸŽจ Full-featured photo image editor using canvas. It is really easy, and it comes with great filters.
JavaScript
6,860
star
4

tui.chart

๐Ÿž๐Ÿ“Š Beautiful chart for data visualization.
TypeScript
5,328
star
5

tui.grid

๐Ÿž๐Ÿ”ก The Powerful Component to Display and Edit Data. Experience the Ultimate Data Transformer!
TypeScript
2,399
star
6

fe.javascript

FE DEV LAB
1,116
star
7

gpm.unity

A brand of NHN providing free services required for game development.
319
star
8

toast-ui.vue-editor

This repository is DEPRECATED! GO TO ๐Ÿ‘‰ https://github.com/nhn/tui.editor/tree/master/apps/vue-editor
JavaScript
229
star
9

toast-ui.vue-calendar

Toast UI Calendar for Vue
Vue
195
star
10

toast-ui.vue-image-editor

Toast UI Image Editor for Vue
Vue
187
star
11

tui.jsdoc-template

TUI JSDoc Template, Demo: https://nhnent.github.io/tui.jsdoc-template/latest/
JavaScript
176
star
12

toast-ui.react-calendar

TOAST UI Calendar wrapper for React.js
JavaScript
169
star
13

socket.io-client-unity3d

socket.io-Client for Unity3D, which is compatible with socket.io v1.x
C#
166
star
14

toast-ui.react-image-editor

TOAST UI ImageEditor wrapper for React.js
JavaScript
117
star
15

toast-haste.framework

TOAST Haste framework is a pure java implementation of asynchronous game server framework
Java
97
star
16

tui.date-picker

Component that selects specific date.
JavaScript
92
star
17

tui.code-snippet

Group of utility methods to make ease with developing javascript applications.
JavaScript
92
star
18

tui.tree

Component that displays data hierarchically.
JavaScript
91
star
19

tui.time-picker

Component that selects specific time.
JavaScript
57
star
20

tui.color-picker

Colorpicker component for web services.
JavaScript
57
star
21

toast-ui.vue-chart

Toast UI Chart for Vue
Vue
51
star
22

toast-ui.vue-grid

This repository is DEPRECATED! GO TO ๐Ÿ‘‰
Vue
51
star
23

tui.pagination

Component that automatically calculate and generate page numbers.
JavaScript
49
star
24

toast-ui.react-editor

This repository is DEPRECATED! GO TO ๐Ÿ‘‰ https://github.com/nhn/tui.editor/tree/master/apps/react-editor
JavaScript
46
star
25

tui.context-menu

Component that creates a menu when the right mouse button is clicked.
JavaScript
44
star
26

tui.app-loader

Component that installs a specific app by determining whether an app is installed on mobile devices.
JavaScript
43
star
27

eat

Json based scenario testing tool(which can have test for functional and non-functional)
Java
40
star
28

toast-ui.react-chart

Toast UI Chart for React
JavaScript
27
star
29

tui.ngx-calendar

TypeScript
26
star
30

tui.file-uploader

JavaScript
26
star
31

tui.eslint.config

ESLint Sharable Configuration for TUI Component
JavaScript
23
star
32

tui.auto-complete

TOAST UI Auto Complete
JavaScript
21
star
33

toast-ui.react-grid

This repository is DEPRECATED! GO TO ๐Ÿ‘‰
JavaScript
19
star
34

toast-ui.select-box

Component that selects an option in the drop-down list.
JavaScript
18
star
35

toast-haste.sdk.dotnet

This repo is .NET client for TOAST Haste framework.
C#
17
star
36

tui.rolling

Components that rotates and displays items such as a slideshow.
JavaScript
14
star
37

tui.virtual-keyboard

JavaScript
12
star
38

tui.virtual-scroll

JavaScript
12
star
39

tui.animation

Javascript animation library with ease
JavaScript
11
star
40

tui.layout

JavaScript
10
star
41

toast.gamebase.unity.sample

C#
10
star
42

tui.flicking

JavaScript
7
star
43

tui.placeholder

JavaScript
7
star
44

dooray.scrum

JavaScript
7
star
45

dooray.vote

JavaScript
7
star
46

adlib.android_media_app

Java
6
star
47

tui.gesture-reader

fe.component-gesture-reader
JavaScript
6
star
48

tui.floating-layer

JavaScript
6
star
49

toast-ui.detect-runtime-error-actions

๐Ÿง Detect Runtime Error with browserstack
JavaScript
6
star
50

tui.dom

DOM control library for TOAST UI Components
JavaScript
5
star
51

toastcloud.sdk

Objective-C
4
star
52

gameanvil.sample-game-server

Java
3
star
53

hands-on-labs.java.spring-boot-custom-starter

Python
3
star
54

gameanvil.sample-game-test

Java
3
star
55

nhncloud.ios.sdk

Objective-C
3
star
56

toast-ui.date

JavaScript
2
star
57

toast.gamebase.ios.sdk

2
star
58

toast.gamebase.unity.tools.setting-tool

2
star
59

hands-on-labs.java.mybatis-to-jpa

Java
2
star
60

hands-on-labs.gamebase.guest-auth-on-js

Python
2
star
61

hands-on-labs.toastui.calendar-timetable

Python
2
star
62

adlib.ios_media_app

Objective-C
2
star
63

gameanvil.agent

2
star
64

hands-on-labs.java.spring-boot-actuator

Makefile
1
star
65

hands-on-labs.gamebase.google-setting

Python
1
star
66

toast-ui.release-notes

Publish Github release note from a tag.
JavaScript
1
star
67

gameanvil.sample-game-client-unity

HTML
1
star
68

hands-on-labs.toastui.chart-dashboard

Python
1
star
69

hands-on-labs.gamebase.install-with-setting-tool

Python
1
star
70

k8s.oss-helm-packages

JavaScript
1
star
71

hands-on-labs.toastui.grid-account-book

Python
1
star
72

tui.webpack.safe-umd-plugin

Webpack plugin to handle optional dependencies safely when using libraryTarget: umd
JavaScript
1
star
73

hands-on-labs.java.jvmtop

Python
1
star
74

hands-on-labs.gamebase.guest-auth-on-unity

HTML
1
star
75

tui.component.calendar

JavaScript
1
star
76

terraform-provider-nhncloud

Terraform Provider for NHN Cloud
Go
1
star
77

ace.guide.script

์›น๋กœ๊ทธ๋ถ„์„ ์Šคํฌ๋ฆฝํŠธ ์„ค์น˜๊ฐ€์ด๋“œ
HTML
1
star
78

hands-on-labs.toastui.editor-ext

Python
1
star