├── CNAME ├── gitbook ├── rouge │ ├── igor_pro.css │ ├── monokai_sublime.css │ ├── bw.css │ ├── base16.css │ ├── gruvbox.css │ ├── pastie.css │ ├── colorful.css │ ├── tulip.css │ ├── magritte.css │ ├── thankful_eyes.css │ ├── molokai.css │ ├── github.css │ └── monokai.css ├── images │ ├── favicon.ico │ └── apple-touch-icon-precomposed-152.png ├── fonts │ └── fontawesome │ │ ├── FontAwesome.otf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.ttf │ │ ├── fontawesome-webfont.woff │ │ └── fontawesome-webfont.woff2 ├── gitbook-plugin-search │ ├── search.css │ ├── search-engine.js │ ├── search.js │ └── lunr.min.js ├── gitbook-plugin-search-pro │ ├── search.css │ ├── search.js │ └── jquery.mark.min.js ├── gitbook-plugin-lunr │ ├── search-lunr.js │ └── lunr.min.js ├── gitbook-plugin-sharing │ └── buttons.js └── gitbook-plugin-fontsettings │ ├── fontsettings.js │ └── website.css ├── .gitignore ├── res ├── 19-debug.png ├── 16-eslint.png ├── 5-deadlock.jpeg ├── manhwakyung.jpg ├── 13-type-fixed.png ├── 10-productivity.png ├── 15-log-printed.png ├── 17-exact-type-1.png ├── 18-exact-type-2.png ├── 9-ioc-containers.png ├── 3-original-diagram.gif ├── 1-package-hexagonal.jpg ├── 12-no-exported-types.png ├── 14-go-to-definition.png ├── 2-dependency-diagram.jpg ├── 11-super-massive-node-modules.webp ├── 6-circular-dependency.svg ├── 7-avoid-cycle-1.svg ├── 8-avoid-cycle-2.svg └── rush.svg ├── robots.txt ├── _pages ├── 010-react-native.md ├── 007-on-web-browser-with-react.md ├── 011-review-monorepo.md ├── 008-separating-into-frontend-and-backend.md ├── 009-persistence.md ├── 000-tech-as-tool-not-goal.md ├── 001-cli-application.md └── 003-application-context.md ├── Gemfile ├── _includes ├── search.html ├── metadata-post.json.tpl ├── metadata-home.json.tpl ├── footer.html ├── body.html ├── toc-date.html ├── head.html ├── metadata.json.tpl └── toc.html ├── 404.html ├── README.md ├── _layouts ├── home.html └── post.html ├── _config.yml ├── Gemfile.lock ├── search_plus_index.json ├── index.md └── LICENSE /CNAME: -------------------------------------------------------------------------------- 1 | nodejs.myeongjae.kim -------------------------------------------------------------------------------- /gitbook/rouge/igor_pro.css: -------------------------------------------------------------------------------- 1 | unknown theme: igor_pro 2 | -------------------------------------------------------------------------------- /gitbook/rouge/monokai_sublime.css: -------------------------------------------------------------------------------- 1 | unknown theme: monokai_sublime 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | _site/ 2 | _draft/ 3 | .jekyll-cache/ 4 | .idea 5 | .DS_Store 6 | -------------------------------------------------------------------------------- /res/19-debug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myeongjae-kim/nodejs-tutorial/HEAD/res/19-debug.png -------------------------------------------------------------------------------- /res/16-eslint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myeongjae-kim/nodejs-tutorial/HEAD/res/16-eslint.png -------------------------------------------------------------------------------- /res/5-deadlock.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myeongjae-kim/nodejs-tutorial/HEAD/res/5-deadlock.jpeg -------------------------------------------------------------------------------- /res/manhwakyung.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myeongjae-kim/nodejs-tutorial/HEAD/res/manhwakyung.jpg -------------------------------------------------------------------------------- /robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Allow: / 3 | 4 | Sitemap: http://nodejs.myeongjae.kim/sitemap.xml 5 | -------------------------------------------------------------------------------- /res/13-type-fixed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myeongjae-kim/nodejs-tutorial/HEAD/res/13-type-fixed.png -------------------------------------------------------------------------------- /res/10-productivity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myeongjae-kim/nodejs-tutorial/HEAD/res/10-productivity.png -------------------------------------------------------------------------------- /res/15-log-printed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myeongjae-kim/nodejs-tutorial/HEAD/res/15-log-printed.png -------------------------------------------------------------------------------- /res/17-exact-type-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myeongjae-kim/nodejs-tutorial/HEAD/res/17-exact-type-1.png -------------------------------------------------------------------------------- /res/18-exact-type-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myeongjae-kim/nodejs-tutorial/HEAD/res/18-exact-type-2.png -------------------------------------------------------------------------------- /res/9-ioc-containers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myeongjae-kim/nodejs-tutorial/HEAD/res/9-ioc-containers.png -------------------------------------------------------------------------------- /gitbook/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myeongjae-kim/nodejs-tutorial/HEAD/gitbook/images/favicon.ico -------------------------------------------------------------------------------- /res/3-original-diagram.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myeongjae-kim/nodejs-tutorial/HEAD/res/3-original-diagram.gif -------------------------------------------------------------------------------- /res/1-package-hexagonal.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myeongjae-kim/nodejs-tutorial/HEAD/res/1-package-hexagonal.jpg -------------------------------------------------------------------------------- /res/12-no-exported-types.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myeongjae-kim/nodejs-tutorial/HEAD/res/12-no-exported-types.png -------------------------------------------------------------------------------- /res/14-go-to-definition.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myeongjae-kim/nodejs-tutorial/HEAD/res/14-go-to-definition.png -------------------------------------------------------------------------------- /res/2-dependency-diagram.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myeongjae-kim/nodejs-tutorial/HEAD/res/2-dependency-diagram.jpg -------------------------------------------------------------------------------- /res/11-super-massive-node-modules.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myeongjae-kim/nodejs-tutorial/HEAD/res/11-super-massive-node-modules.webp -------------------------------------------------------------------------------- /gitbook/fonts/fontawesome/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myeongjae-kim/nodejs-tutorial/HEAD/gitbook/fonts/fontawesome/FontAwesome.otf -------------------------------------------------------------------------------- /gitbook/fonts/fontawesome/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myeongjae-kim/nodejs-tutorial/HEAD/gitbook/fonts/fontawesome/fontawesome-webfont.eot -------------------------------------------------------------------------------- /gitbook/fonts/fontawesome/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myeongjae-kim/nodejs-tutorial/HEAD/gitbook/fonts/fontawesome/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /gitbook/fonts/fontawesome/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myeongjae-kim/nodejs-tutorial/HEAD/gitbook/fonts/fontawesome/fontawesome-webfont.woff -------------------------------------------------------------------------------- /gitbook/fonts/fontawesome/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myeongjae-kim/nodejs-tutorial/HEAD/gitbook/fonts/fontawesome/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /gitbook/images/apple-touch-icon-precomposed-152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myeongjae-kim/nodejs-tutorial/HEAD/gitbook/images/apple-touch-icon-precomposed-152.png -------------------------------------------------------------------------------- /_pages/010-react-native.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: (작성예정) 10. 리액트 네이티브 3 | author: Myeongjae Kim 4 | date: 2022-04-07 5 | category: Tutorial 6 | layout: post 7 | --- 8 | 9 | To Be Developed... 10 | -------------------------------------------------------------------------------- /_pages/007-on-web-browser-with-react.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: (작성예정) 7. 웹 브라우저로 (with React) 3 | author: Myeongjae Kim 4 | date: 2022-04-07 5 | category: Tutorial 6 | layout: post 7 | --- 8 | 9 | To Be Developed... 10 | -------------------------------------------------------------------------------- /_pages/011-review-monorepo.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: (작성예정) 11. 모노레포 되돌아보기 3 | author: Myeongjae Kim 4 | date: 2022-04-07 5 | category: Tutorial 6 | layout: post 7 | --- 8 | 9 | To Be Developed... 10 | 11 | 이것이 제 꿈과 희망의 프론트엔드 아키텍처입니다. 이 구조로 얼마나 큰 비즈니스까지 감당할 수 있을까요? 12 | -------------------------------------------------------------------------------- /_pages/008-separating-into-frontend-and-backend.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: (작성예정) 8. 프론트엔드와 백엔드의 분리 (with Express) 3 | author: Myeongjae Kim 4 | date: 2022-04-07 5 | category: Tutorial 6 | layout: post 7 | --- 8 | 9 | To Be Developed... 10 | 11 | 심화로 inversify-express-utils 적용해봐도 좋음. 12 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | source "https://rubygems.org" 4 | 5 | git_source(:github) { |repo_name| "https://github.com/#{repo_name}" } 6 | gem 'jekyll' 7 | gem 'jekyll-feed' 8 | gem 'jekyll-sitemap' 9 | gem 'jemoji' 10 | gem 'webrick' 11 | 12 | # gem "rails" 13 | -------------------------------------------------------------------------------- /_pages/009-persistence.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: (작성예정) 9. 영속성 3 | author: Myeongjae Kim 4 | date: 2022-04-07 5 | category: Tutorial 6 | layout: post 7 | --- 8 | 9 | To Be Developed... 10 | 11 | 웹 브라우저의 로컬 스토리지. 12 | 13 | 백엔드에서는 파일시스템. 14 | 15 | 심화: docker로 MySQL띄워서 TypeORM 적용해봐도 되고. 16 | -------------------------------------------------------------------------------- /_includes/search.html: -------------------------------------------------------------------------------- 1 |
Page not found :(
23 |The requested page could not be found.
24 |
15 |
16 | ').html(content);
65 |
66 | $link.appendTo($title);
67 | $title.appendTo($li);
68 | $content.appendTo($li);
69 | $li.appendTo($searchList);
70 | });
71 | }
72 |
73 | function launchSearch(q) {
74 | // Add class for loading
75 | $body.addClass('with-search');
76 | $body.addClass('search-loading');
77 |
78 | // Launch search query
79 | throttle(gitbook.search.query(q, 0, MAX_RESULTS)
80 | .then(function(results) {
81 | displayResults(results);
82 | })
83 | .always(function() {
84 | $body.removeClass('search-loading');
85 | }), 1000);
86 | }
87 |
88 | function closeSearch() {
89 | $body.removeClass('with-search');
90 | $bookSearchResults.removeClass('open');
91 | }
92 |
93 | function launchSearchFromQueryString() {
94 | var q = getParameterByName('q');
95 | if (q && q.length > 0) {
96 | // Update search input
97 | $searchInput.val(q);
98 |
99 | // Launch search
100 | launchSearch(q);
101 | }
102 | }
103 |
104 | function bindSearch() {
105 | // Bind DOM
106 | $searchInput = $('#book-search-input input');
107 | $bookSearchResults = $('#book-search-results');
108 | $searchList = $bookSearchResults.find('.search-results-list');
109 | $searchTitle = $bookSearchResults.find('.search-results-title');
110 | $searchResultsCount = $searchTitle.find('.search-results-count');
111 | $searchQuery = $searchTitle.find('.search-query');
112 |
113 | // Launch query based on input content
114 | function handleUpdate() {
115 | var q = $searchInput.val();
116 |
117 | if (q.length == 0) {
118 | closeSearch();
119 | }
120 | else {
121 | launchSearch(q);
122 | }
123 | }
124 |
125 | // Detect true content change in search input
126 | // Workaround for IE < 9
127 | var propertyChangeUnbound = false;
128 | $searchInput.on('propertychange', function(e) {
129 | if (e.originalEvent.propertyName == 'value') {
130 | handleUpdate();
131 | }
132 | });
133 |
134 | // HTML5 (IE9 & others)
135 | $searchInput.on('input', function(e) {
136 | // Unbind propertychange event for IE9+
137 | if (!propertyChangeUnbound) {
138 | $(this).unbind('propertychange');
139 | propertyChangeUnbound = true;
140 | }
141 |
142 | handleUpdate();
143 | });
144 |
145 | // Push to history on blur
146 | $searchInput.on('blur', function(e) {
147 | // Update history state
148 | if (usePushState) {
149 | var uri = updateQueryString('q', $(this).val());
150 | history.pushState({ path: uri }, null, uri);
151 | }
152 | });
153 | }
154 |
155 | gitbook.events.on('page.change', function() {
156 | bindSearch();
157 | closeSearch();
158 |
159 | // Launch search based on query parameter
160 | if (gitbook.search.isInitialized()) {
161 | launchSearchFromQueryString();
162 | }
163 | });
164 |
165 | gitbook.events.on('search.ready', function() {
166 | bindSearch();
167 |
168 | // Launch search from query param at start
169 | launchSearchFromQueryString();
170 | });
171 |
172 | function getParameterByName(name) {
173 | var url = window.location.href;
174 | name = name.replace(/[\[\]]/g, '\\$&');
175 | var regex = new RegExp('[?&]' + name + '(=([^]*)|&|#|$)', 'i'),
176 | results = regex.exec(url);
177 | if (!results) return null;
178 | if (!results[2]) return '';
179 | return decodeURIComponent(results[2].replace(/\+/g, ' '));
180 | }
181 |
182 | function updateQueryString(key, value) {
183 | value = encodeURIComponent(value);
184 |
185 | var url = window.location.href;
186 | var re = new RegExp('([?&])' + key + '=.*?(&|#|$)(.*)', 'gi'),
187 | hash;
188 |
189 | if (re.test(url)) {
190 | if (typeof value !== 'undefined' && value !== null)
191 | return url.replace(re, '$1' + key + '=' + value + '$2$3');
192 | else {
193 | hash = url.split('#');
194 | url = hash[0].replace(re, '$1$3').replace(/(&|\?)$/, '');
195 | if (typeof hash[1] !== 'undefined' && hash[1] !== null)
196 | url += '#' + hash[1];
197 | return url;
198 | }
199 | }
200 | else {
201 | if (typeof value !== 'undefined' && value !== null) {
202 | var separator = url.indexOf('?') !== -1 ? '&' : '?';
203 | hash = url.split('#');
204 | url = hash[0] + separator + key + '=' + value;
205 | if (typeof hash[1] !== 'undefined' && hash[1] !== null)
206 | url += '#' + hash[1];
207 | return url;
208 | }
209 | else
210 | return url;
211 | }
212 | }
213 | });
214 |
--------------------------------------------------------------------------------
/gitbook/gitbook-plugin-fontsettings/fontsettings.js:
--------------------------------------------------------------------------------
1 | require(['gitbook', 'jquery'], function(gitbook, $) {
2 | // Configuration
3 | var MAX_SIZE = 4,
4 | MIN_SIZE = 0,
5 | BUTTON_ID;
6 |
7 | // Current fontsettings state
8 | var fontState;
9 |
10 | // Default themes
11 | var THEMES = [
12 | {
13 | config: 'white',
14 | text: 'White',
15 | id: 0
16 | },
17 | {
18 | config: 'sepia',
19 | text: 'Sepia',
20 | id: 1
21 | },
22 | {
23 | config: 'night',
24 | text: 'Night',
25 | id: 2
26 | }
27 | ];
28 |
29 | // Default font families
30 | var FAMILIES = [
31 | {
32 | config: 'serif',
33 | text: 'Serif',
34 | id: 0
35 | },
36 | {
37 | config: 'sans',
38 | text: 'Sans',
39 | id: 1
40 | }
41 | ];
42 |
43 | // Return configured themes
44 | function getThemes() {
45 | return THEMES;
46 | }
47 |
48 | // Modify configured themes
49 | function setThemes(themes) {
50 | THEMES = themes;
51 | updateButtons();
52 | }
53 |
54 | // Return configured font families
55 | function getFamilies() {
56 | return FAMILIES;
57 | }
58 |
59 | // Modify configured font families
60 | function setFamilies(families) {
61 | FAMILIES = families;
62 | updateButtons();
63 | }
64 |
65 | // Save current font settings
66 | function saveFontSettings() {
67 | gitbook.storage.set('fontState', fontState);
68 | update();
69 | }
70 |
71 | // Increase font size
72 | function enlargeFontSize(e) {
73 | e.preventDefault();
74 | if (fontState.size >= MAX_SIZE) return;
75 |
76 | fontState.size++;
77 | saveFontSettings();
78 | }
79 |
80 | // Decrease font size
81 | function reduceFontSize(e) {
82 | e.preventDefault();
83 | if (fontState.size <= MIN_SIZE) return;
84 |
85 | fontState.size--;
86 | saveFontSettings();
87 | }
88 |
89 | // Change font family
90 | function changeFontFamily(configName, e) {
91 | if (e && e instanceof Event) {
92 | e.preventDefault();
93 | }
94 |
95 | var familyId = getFontFamilyId(configName);
96 | fontState.family = familyId;
97 | saveFontSettings();
98 | }
99 |
100 | // Change type of color theme
101 | function changeColorTheme(configName, e) {
102 | if (e && e instanceof Event) {
103 | e.preventDefault();
104 | }
105 |
106 | var $book = gitbook.state.$book;
107 |
108 | // Remove currently applied color theme
109 | if (fontState.theme !== 0)
110 | $book.removeClass('color-theme-'+fontState.theme);
111 |
112 | // Set new color theme
113 | var themeId = getThemeId(configName);
114 | fontState.theme = themeId;
115 | if (fontState.theme !== 0)
116 | $book.addClass('color-theme-'+fontState.theme);
117 |
118 | saveFontSettings();
119 | }
120 |
121 | // Return the correct id for a font-family config key
122 | // Default to first font-family
123 | function getFontFamilyId(configName) {
124 | // Search for plugin configured font family
125 | var configFamily = $.grep(FAMILIES, function(family) {
126 | return family.config == configName;
127 | })[0];
128 | // Fallback to default font family
129 | return (!!configFamily)? configFamily.id : 0;
130 | }
131 |
132 | // Return the correct id for a theme config key
133 | // Default to first theme
134 | function getThemeId(configName) {
135 | // Search for plugin configured theme
136 | var configTheme = $.grep(THEMES, function(theme) {
137 | return theme.config == configName;
138 | })[0];
139 | // Fallback to default theme
140 | return (!!configTheme)? configTheme.id : 0;
141 | }
142 |
143 | function update() {
144 | var $book = gitbook.state.$book;
145 |
146 | $('.font-settings .font-family-list li').removeClass('active');
147 | $('.font-settings .font-family-list li:nth-child('+(fontState.family+1)+')').addClass('active');
148 |
149 | $book[0].className = $book[0].className.replace(/\bfont-\S+/g, '');
150 | $book.addClass('font-size-'+fontState.size);
151 | $book.addClass('font-family-'+fontState.family);
152 |
153 | if(fontState.theme !== 0) {
154 | $book[0].className = $book[0].className.replace(/\bcolor-theme-\S+/g, '');
155 | $book.addClass('color-theme-'+fontState.theme);
156 | }
157 | }
158 |
159 | function init(config) {
160 | // Search for plugin configured font family
161 | var configFamily = getFontFamilyId(config.family),
162 | configTheme = getThemeId(config.theme);
163 |
164 | // Instantiate font state object
165 | fontState = gitbook.storage.get('fontState', {
166 | size: config.size || 2,
167 | family: configFamily,
168 | theme: configTheme
169 | });
170 |
171 | update();
172 | }
173 |
174 | function updateButtons() {
175 | // Remove existing fontsettings buttons
176 | if (!!BUTTON_ID) {
177 | gitbook.toolbar.removeButton(BUTTON_ID);
178 | }
179 |
180 | // Create buttons in toolbar
181 | BUTTON_ID = gitbook.toolbar.createButton({
182 | icon: 'fa fa-font',
183 | label: 'Font Settings',
184 | className: 'font-settings',
185 | dropdown: [
186 | [
187 | {
188 | text: 'A',
189 | className: 'font-reduce',
190 | onClick: reduceFontSize
191 | },
192 | {
193 | text: 'A',
194 | className: 'font-enlarge',
195 | onClick: enlargeFontSize
196 | }
197 | ],
198 | $.map(FAMILIES, function(family) {
199 | family.onClick = function(e) {
200 | return changeFontFamily(family.config, e);
201 | };
202 |
203 | return family;
204 | }),
205 | $.map(THEMES, function(theme) {
206 | theme.onClick = function(e) {
207 | return changeColorTheme(theme.config, e);
208 | };
209 |
210 | return theme;
211 | })
212 | ]
213 | });
214 | }
215 |
216 | // Init configuration at start
217 | gitbook.events.bind('start', function(e, config) {
218 | var opts = config.fontsettings;
219 |
220 | // Generate buttons at start
221 | updateButtons();
222 |
223 | // Init current settings
224 | init(opts);
225 | });
226 |
227 | // Expose API
228 | gitbook.fontsettings = {
229 | enlargeFontSize: enlargeFontSize,
230 | reduceFontSize: reduceFontSize,
231 | setTheme: changeColorTheme,
232 | setFamily: changeFontFamily,
233 | getThemes: getThemes,
234 | setThemes: setThemes,
235 | getFamilies: getFamilies,
236 | setFamilies: setFamilies
237 | };
238 | });
239 |
240 |
241 |
--------------------------------------------------------------------------------
/_includes/toc.html:
--------------------------------------------------------------------------------
1 | {% capture tocWorkspace %}
2 | {% comment %}
3 | Copyright (c) 2017 Vladimir "allejo" Jimenez
4 |
5 | Permission is hereby granted, free of charge, to any person
6 | obtaining a copy of this software and associated documentation
7 | files (the "Software"), to deal in the Software without
8 | restriction, including without limitation the rights to use,
9 | copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the
11 | Software is furnished to do so, subject to the following
12 | conditions:
13 |
14 | The above copyright notice and this permission notice shall be
15 | included in all copies or substantial portions of the Software.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
19 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24 | OTHER DEALINGS IN THE SOFTWARE.
25 | {% endcomment %}
26 | {% comment %}
27 | Version 1.1.0
28 | https://github.com/allejo/jekyll-toc
29 |
30 | "...like all things liquid - where there's a will, and ~36 hours to spare, there's usually a/some way" ~jaybe
31 |
32 | Usage:
33 | {% include toc.html html=content sanitize=true class="inline_toc" id="my_toc" h_min=2 h_max=3 %}
34 |
35 | Parameters:
36 | * html (string) - the HTML of compiled markdown generated by kramdown in Jekyll
37 |
38 | Optional Parameters:
39 | * sanitize (bool) : false - when set to true, the headers will be stripped of any HTML in the TOC
40 | * class (string) : '' - a CSS class assigned to the TOC
41 | * id (string) : '' - an ID to assigned to the TOC
42 | * h_min (int) : 1 - the minimum TOC header level to use; any header lower than this value will be ignored
43 | * h_max (int) : 6 - the maximum TOC header level to use; any header greater than this value will be ignored
44 | * ordered (bool) : false - when set to true, an ordered list will be outputted instead of an unordered list
45 | * item_class (string) : '' - add custom class(es) for each list item; has support for '%level%' placeholder, which is the current heading level
46 | * submenu_class (string) : '' - add custom class(es) for each child group of headings; has support for '%level%' placeholder which is the current "submenu" heading level
47 | * base_url (string) : '' - add a base url to the TOC links for when your TOC is on another page than the actual content
48 | * anchor_class (string) : '' - add custom class(es) for each anchor element
49 | * skip_no_ids (bool) : false - skip headers that do not have an `id` attribute
50 |
51 | Output:
52 | An ordered or unordered list representing the table of contents of a markdown block. This snippet will only
53 | generate the table of contents and will NOT output the markdown given to it
54 | {% endcomment %}
55 |
56 | {% capture newline %}
57 | {% endcapture %}
58 | {% assign newline = newline | rstrip %}
59 |
60 | {% capture deprecation_warnings %}{% endcapture %}
61 |
62 | {% if include.baseurl %}
63 | {% capture deprecation_warnings %}{{ deprecation_warnings }}{{ newline }}{% endcapture %}
64 | {% endif %}
65 |
66 | {% if include.skipNoIDs %}
67 | {% capture deprecation_warnings %}{{ deprecation_warnings }}{{ newline }}{% endcapture %}
68 | {% endif %}
69 |
70 | {% capture jekyll_toc %}{% endcapture %}
71 | {% assign orderedList = include.ordered | default: false %}
72 | {% assign baseURL = include.base_url | default: include.baseurl | default: '' %}
73 | {% assign skipNoIDs = include.skip_no_ids | default: include.skipNoIDs | default: false %}
74 | {% assign minHeader = include.h_min | default: 1 %}
75 | {% assign maxHeader = include.h_max | default: 6 %}
76 | {% assign nodes = include.html | strip | split: '
').html(content);
76 |
77 | $link.appendTo($title);
78 | $title.appendTo($li);
79 | $content.appendTo($li);
80 | $li.appendTo($searchList);
81 | });
82 | $('.body-inner').scrollTop(0);
83 | }
84 |
85 | function escapeReg(keyword) {
86 | //escape regexp prevserve word
87 | return String(keyword).replace(/([\*\.\?\+\$\^\[\]\(\)\{\}\|\/\\])/g, '\\$1');
88 | }
89 |
90 | function query(keyword) {
91 | if (keyword == null || keyword.trim() === '') return;
92 |
93 | var results = [],
94 | index = -1;
95 | for (var page in INDEX_DATA) {
96 | if ((index = INDEX_DATA[page].body.toLowerCase().indexOf(keyword.toLowerCase())) !== -1) {
97 | results.push({
98 | url: page,
99 | title: INDEX_DATA[page].title,
100 | body: INDEX_DATA[page].body.substr(Math.max(0, index - 50), MAX_DESCRIPTION_SIZE).replace(new RegExp('(' + escapeReg(keyword) + ')', 'gi'), '$1')
101 | });
102 | }
103 | }
104 | displayResults({
105 | count: results.length,
106 | query: keyword,
107 | results: results
108 | });
109 | }
110 |
111 | function launchSearch(keyword) {
112 | // Add class for loading
113 | $body.addClass('with-search');
114 | $body.addClass('search-loading');
115 |
116 | function doSearch() {
117 | query(keyword);
118 | $body.removeClass('search-loading');
119 | }
120 |
121 | throttle(doSearch)();
122 | }
123 |
124 | function closeSearch() {
125 | $body.removeClass('with-search');
126 | $('#book-search-results').removeClass('open');
127 | }
128 |
129 | function bindSearch() {
130 | // Asynchronously load the index data
131 | {
132 | var url = state.basePath + "/search_plus_index.json";
133 | $.getJSON(url).then(function(data) {
134 | INDEX_DATA = data;
135 | handleUpdate();
136 | });
137 | }
138 |
139 | // Bind DOM
140 | var $body = $('body');
141 |
142 | // Launch query based on input content
143 | function handleUpdate() {
144 | var $searchInput = $('#book-search-input input');
145 | var keyword = $searchInput.val();
146 |
147 | if (keyword.length == 0) {
148 | closeSearch();
149 | } else {
150 | launchSearch(keyword);
151 | }
152 | }
153 |
154 | $body.on('keyup', '#book-search-input input', function(e) {
155 | if (e.keyCode === 13) {
156 | if (usePushState) {
157 | var uri = updateQueryString('q', $(this).val());
158 | history.pushState({
159 | path: uri
160 | }, null, uri);
161 | }
162 | }
163 | handleUpdate();
164 | });
165 |
166 | $body.on('click', '#book-search-input input', function(e) {
167 | if (Object.keys(INDEX_DATA).length === 0) {
168 | var url = state.basePath + "/search_plus_index.json";
169 | $.getJSON(url).then(function(data) {
170 | INDEX_DATA = data;
171 | handleUpdate();
172 | });
173 | }
174 | });
175 |
176 | // Push to history on blur
177 | $body.on('blur', '#book-search-input input', function(e) {
178 | // Update history state
179 | if (usePushState) {
180 | var uri = updateQueryString('q', $(this).val());
181 | history.pushState({
182 | path: uri
183 | }, null, uri);
184 | }
185 | });
186 | }
187 |
188 | gitbook.events.on('start', function() {
189 | bindSearch();
190 | showResult();
191 | closeSearch();
192 | });
193 |
194 | // 高亮文本
195 | var highLightPageInner = function(keyword) {
196 | $('.page-inner').mark(keyword, {
197 | 'ignoreJoiners': true,
198 | 'acrossElements': true,
199 | 'separateWordSearch': false
200 | });
201 |
202 | setTimeout(function() {
203 | var mark = $('mark[data-markjs="true"]');
204 | if (mark.length) {
205 | mark[0].scrollIntoView();
206 | }
207 | }, 100);
208 | };
209 |
210 | function showResult() {
211 | var keyword, type;
212 | if (/\b(q|h)=([^&]+)/.test(location.search)) {
213 | type = RegExp.$1;
214 | keyword = decodeURIComponent(RegExp.$2);
215 | if (type === 'q') {
216 | launchSearch(keyword);
217 | } else {
218 | highLightPageInner(keyword);
219 | }
220 | $('#book-search-input input').val(keyword);
221 | }
222 | }
223 |
224 | gitbook.events.on('page.change', showResult);
225 |
226 | function getParameterByName(name) {
227 | var url = window.location.href;
228 | name = name.replace(/[\[\]]/g, '\\$&');
229 | var regex = new RegExp('[?&]' + name + '(=([^]*)|&|#|$)', 'i'),
230 | results = regex.exec(url);
231 | if (!results) return null;
232 | if (!results[2]) return '';
233 | return decodeURIComponent(results[2].replace(/\+/g, ' '));
234 | }
235 |
236 | function updateQueryString(key, value) {
237 | value = encodeURIComponent(value);
238 |
239 | var url = window.location.href.replace(/([?&])(?:q|h)=([^&]+)(&|$)/, function(all, pre, value, end) {
240 | if (end === '&') {
241 | return pre;
242 | }
243 | return '';
244 | });
245 | var re = new RegExp('([?&])' + key + '=.*?(&|#|$)(.*)', 'gi'),
246 | hash;
247 |
248 | if (re.test(url)) {
249 | if (typeof value !== 'undefined' && value !== null)
250 | return url.replace(re, '$1' + key + '=' + value + '$2$3');
251 | else {
252 | hash = url.split('#');
253 | url = hash[0].replace(re, '$1$3').replace(/(&|\?)$/, '');
254 | if (typeof hash[1] !== 'undefined' && hash[1] !== null)
255 | url += '#' + hash[1];
256 | return url;
257 | }
258 | } else {
259 | if (typeof value !== 'undefined' && value !== null) {
260 | var separator = url.indexOf('?') !== -1 ? '&' : '?';
261 | hash = url.split('#');
262 | url = hash[0] + separator + key + '=' + value;
263 | if (typeof hash[1] !== 'undefined' && hash[1] !== null)
264 | url += '#' + hash[1];
265 | return url;
266 | } else
267 | return url;
268 | }
269 | }
270 | window.addEventListener('click', function(e) {
271 | if (e.target.tagName === 'A' && e.target.getAttribute('data-need-reload')) {
272 | setTimeout(function() {
273 | location.reload();
274 | }, 100);
275 | }
276 | }, true);
277 | });
--------------------------------------------------------------------------------
/gitbook/gitbook-plugin-fontsettings/website.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Theme 1
3 | */
4 | .color-theme-1 .dropdown-menu {
5 | background-color: #111111;
6 | border-color: #7e888b;
7 | }
8 | .color-theme-1 .dropdown-menu .dropdown-caret .caret-inner {
9 | border-bottom: 9px solid #111111;
10 | }
11 | .color-theme-1 .dropdown-menu .buttons {
12 | border-color: #7e888b;
13 | }
14 | .color-theme-1 .dropdown-menu .button {
15 | color: #afa790;
16 | }
17 | .color-theme-1 .dropdown-menu .button:hover {
18 | color: #73553c;
19 | }
20 | /*
21 | * Theme 2
22 | */
23 | .color-theme-2 .dropdown-menu {
24 | background-color: #2d3143;
25 | border-color: #272a3a;
26 | }
27 | .color-theme-2 .dropdown-menu .dropdown-caret .caret-inner {
28 | border-bottom: 9px solid #2d3143;
29 | }
30 | .color-theme-2 .dropdown-menu .buttons {
31 | border-color: #272a3a;
32 | }
33 | .color-theme-2 .dropdown-menu .button {
34 | color: #62677f;
35 | }
36 | .color-theme-2 .dropdown-menu .button:hover {
37 | color: #f4f4f5;
38 | }
39 | .book .book-header .font-settings .font-enlarge {
40 | line-height: 30px;
41 | font-size: 1.4em;
42 | }
43 | .book .book-header .font-settings .font-reduce {
44 | line-height: 30px;
45 | font-size: 1em;
46 | }
47 | .book.color-theme-1 .book-body {
48 | color: #704214;
49 | background: #f3eacb;
50 | }
51 | .book.color-theme-1 .book-body .page-wrapper .page-inner section {
52 | background: #f3eacb;
53 | }
54 | .book.color-theme-2 .book-body {
55 | color: #bdcadb;
56 | background: #1c1f2b;
57 | }
58 | .book.color-theme-2 .book-body .page-wrapper .page-inner section {
59 | background: #1c1f2b;
60 | }
61 | .book.font-size-0 .book-body .page-inner section {
62 | font-size: 1.2rem;
63 | }
64 | .book.font-size-1 .book-body .page-inner section {
65 | font-size: 1.4rem;
66 | }
67 | .book.font-size-2 .book-body .page-inner section {
68 | font-size: 1.6rem;
69 | }
70 | .book.font-size-3 .book-body .page-inner section {
71 | font-size: 2.2rem;
72 | }
73 | .book.font-size-4 .book-body .page-inner section {
74 | font-size: 4rem;
75 | }
76 | .book.font-family-0 {
77 | font-family: Georgia, serif;
78 | }
79 | .book.font-family-1 {
80 | font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
81 | }
82 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal {
83 | color: #704214;
84 | }
85 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal a {
86 | color: inherit;
87 | }
88 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h1,
89 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h2,
90 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h3,
91 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h4,
92 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h5,
93 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h6 {
94 | color: inherit;
95 | }
96 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h1,
97 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h2 {
98 | border-color: inherit;
99 | }
100 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h6 {
101 | color: inherit;
102 | }
103 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal hr {
104 | background-color: inherit;
105 | }
106 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal blockquote {
107 | border-color: inherit;
108 | }
109 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre,
110 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code {
111 | background: #fdf6e3;
112 | color: #657b83;
113 | border-color: #f8df9c;
114 | }
115 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal .highlight {
116 | background-color: inherit;
117 | }
118 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal table th,
119 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal table td {
120 | border-color: #f5d06c;
121 | }
122 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal table tr {
123 | color: inherit;
124 | background-color: #fdf6e3;
125 | border-color: #444444;
126 | }
127 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal table tr:nth-child(2n) {
128 | background-color: #fbeecb;
129 | }
130 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal {
131 | color: #bdcadb;
132 | }
133 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal a {
134 | color: #3eb1d0;
135 | }
136 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h1,
137 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h2,
138 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h3,
139 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h4,
140 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h5,
141 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h6 {
142 | color: #fffffa;
143 | }
144 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h1,
145 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h2 {
146 | border-color: #373b4e;
147 | }
148 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h6 {
149 | color: #373b4e;
150 | }
151 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal hr {
152 | background-color: #373b4e;
153 | }
154 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal blockquote {
155 | border-color: #373b4e;
156 | }
157 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre,
158 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code {
159 | color: #9dbed8;
160 | background: #2d3143;
161 | border-color: #2d3143;
162 | }
163 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal .highlight {
164 | background-color: #282a39;
165 | }
166 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal table th,
167 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal table td {
168 | border-color: #3b3f54;
169 | }
170 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal table tr {
171 | color: #b6c2d2;
172 | background-color: #2d3143;
173 | border-color: #3b3f54;
174 | }
175 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal table tr:nth-child(2n) {
176 | background-color: #35394b;
177 | }
178 | .book.color-theme-1 .book-header {
179 | color: #afa790;
180 | background: transparent;
181 | }
182 | .book.color-theme-1 .book-header .btn {
183 | color: #afa790;
184 | }
185 | .book.color-theme-1 .book-header .btn:hover {
186 | color: #73553c;
187 | background: none;
188 | }
189 | .book.color-theme-1 .book-header h1 {
190 | color: #704214;
191 | }
192 | .book.color-theme-2 .book-header {
193 | color: #7e888b;
194 | background: transparent;
195 | }
196 | .book.color-theme-2 .book-header .btn {
197 | color: #3b3f54;
198 | }
199 | .book.color-theme-2 .book-header .btn:hover {
200 | color: #fffff5;
201 | background: none;
202 | }
203 | .book.color-theme-2 .book-header h1 {
204 | color: #bdcadb;
205 | }
206 | .book.color-theme-1 .book-body .navigation {
207 | color: #afa790;
208 | }
209 | .book.color-theme-1 .book-body .navigation:hover {
210 | color: #73553c;
211 | }
212 | .book.color-theme-2 .book-body .navigation {
213 | color: #383f52;
214 | }
215 | .book.color-theme-2 .book-body .navigation:hover {
216 | color: #fffff5;
217 | }
218 | /*
219 | * Theme 1
220 | */
221 | .book.color-theme-1 .book-summary {
222 | color: #afa790;
223 | background: #111111;
224 | border-right: 1px solid rgba(0, 0, 0, 0.07);
225 | }
226 | .book.color-theme-1 .book-summary .book-search {
227 | background: transparent;
228 | }
229 | .book.color-theme-1 .book-summary .book-search input,
230 | .book.color-theme-1 .book-summary .book-search input:focus {
231 | border: 1px solid transparent;
232 | }
233 | .book.color-theme-1 .book-summary ul.summary li.divider {
234 | background: #7e888b;
235 | box-shadow: none;
236 | }
237 | .book.color-theme-1 .book-summary ul.summary li i.fa-check {
238 | color: #33cc33;
239 | }
240 | .book.color-theme-1 .book-summary ul.summary li.done > a {
241 | color: #877f6a;
242 | }
243 | .book.color-theme-1 .book-summary ul.summary li a,
244 | .book.color-theme-1 .book-summary ul.summary li span {
245 | color: #877f6a;
246 | background: transparent;
247 | font-weight: normal;
248 | }
249 | .book.color-theme-1 .book-summary ul.summary li.active > a,
250 | .book.color-theme-1 .book-summary ul.summary li a:hover {
251 | color: #704214;
252 | background: transparent;
253 | font-weight: normal;
254 | }
255 | /*
256 | * Theme 2
257 | */
258 | .book.color-theme-2 .book-summary {
259 | color: #bcc1d2;
260 | background: #2d3143;
261 | border-right: none;
262 | }
263 | .book.color-theme-2 .book-summary .book-search {
264 | background: transparent;
265 | }
266 | .book.color-theme-2 .book-summary .book-search input,
267 | .book.color-theme-2 .book-summary .book-search input:focus {
268 | border: 1px solid transparent;
269 | }
270 | .book.color-theme-2 .book-summary ul.summary li.divider {
271 | background: #272a3a;
272 | box-shadow: none;
273 | }
274 | .book.color-theme-2 .book-summary ul.summary li i.fa-check {
275 | color: #33cc33;
276 | }
277 | .book.color-theme-2 .book-summary ul.summary li.done > a {
278 | color: #62687f;
279 | }
280 | .book.color-theme-2 .book-summary ul.summary li a,
281 | .book.color-theme-2 .book-summary ul.summary li span {
282 | color: #c1c6d7;
283 | background: transparent;
284 | font-weight: 600;
285 | }
286 | .book.color-theme-2 .book-summary ul.summary li.active > a,
287 | .book.color-theme-2 .book-summary ul.summary li a:hover {
288 | color: #f4f4f5;
289 | background: #252737;
290 | font-weight: 600;
291 | }
292 |
--------------------------------------------------------------------------------
/res/rush.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
--------------------------------------------------------------------------------
/_pages/003-application-context.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 3. 애플리케이션 컨텍스트
3 | author: Myeongjae Kim
4 | date: 2022-03-12
5 | category: Tutorial
6 | layout: post
7 | ---
8 |
9 | ## 의존관계 그래프
10 |
11 | 애플리케이션 컨텍스트는 말 그대로 애플리케이션을 실행하기 위한 맥락입니다. 제가 작성한 `ApplicationByStateManager` 클래스를 인스턴스화 하려면
12 | 생성자 매개변수로 `StateManager`, `ArticleQueryViewController`, `ArticleCommandViewController`의 인스턴스를 전달해야 합니다.
13 | 이 3개의 인스턴스를 만드려면 또 필요한 인스턴스들이 있고, 그 인스턴스들을 만들기 위해 더 필요한 인스턴스들이 있고... 자료구조를 공부하셨다면 이쯤에서 아마
14 | '그래프' 자료구조가 생각이 나실 수도 있습니다.
15 |
16 |
19 |
20 |
npx depcruise --exclude \"^node_modules\" --ts-pre-compilation-deps --output-type dot src/index.ts | dot -T svg -o dependencies.svg
23 |
37 |
45 |
echo "digraph { A -> B \n B -> A}" | dot -Tsvg > circular-dependency.svg
63 |
64 |
echo "digraph { C -> A \n C -> B}" | dot -Tsvg > avoid-cycle-1.svg
echo "digraph { C <- A \n C <- B}" | dot -Tsvg > avoid-cycle-2.svg