Skip to content

Commit

Permalink
feat: 새 TIL 추가 및 불필요한 내용 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
leeari95 committed Jul 27, 2024
1 parent 897add8 commit 2e36ee1
Show file tree
Hide file tree
Showing 9 changed files with 99 additions and 138 deletions.
6 changes: 1 addition & 5 deletions Sources/AriNote/TIL.docc/Architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,4 @@
}


## Topics
- <doc:220324_디자인패턴_활동학습>
- <doc:220322_Flyweight,_Facade>
- <doc:220303_Clean_Architecture_MVVM,_async,_await>
- <doc:220301_MVVM,_프로젝트_설계>
## Topics
19 changes: 1 addition & 18 deletions Sources/AriNote/TIL.docc/CS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,4 @@ Computer Science
}

## Topics
- <doc:220523_API,_REST_API,_Array,_Set,_Tuple,_Library,_map>
- <doc:220310_OAuth,_Social_Login,_TLS,_대칭키,_비대칭키,_암호화,_복호화>
- <doc:220225_Greedy,_wholeNumberValue,_enumerated,_reduce>
- <doc:220113_Cache,_pagination>
- <doc:220110_NSCache>
- <doc:220104_multipart,_form-data,_aync_method_test,_의존성_주입,_Test_Doubles>
- <doc:211230_HTTP,_UDID,_UUID>
- <doc:211229_TCP_IP>
- <doc:211228_Race_Condition,_DispatchSemaphore,_HTTP>
- <doc:211223_POP,_delegate>
- <doc:211217_GCD>
- <doc:211216_sync,_async,_Parallel,_Concurrency,_GCD>
- <doc:211215_운영체제와_데이터베이스>
- <doc:211207_NSDataAsset,_오답노트,_Contents.JSON,_Framework,_Library,_API>
- <doc:211018_let,_var,_tool_bar,_Design_Patterns,_Architectures,_MVC,_Dictionary,_Downcasting,_Function_Types_as_Parameter_Types>
- <doc:210812_메모리_구조>
- <doc:210804_동적프로그래밍>
- <doc:210802_정수와_실수>
- <doc:210802_정수와_실수>
5 changes: 1 addition & 4 deletions Sources/AriNote/TIL.docc/Git.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,4 @@ Git 관련 지식
@TitleHeading("Overview")
}

## Topics
- <doc:220613_Github_Actions,_CI,_CD,_자동화>
- <doc:211005_Git,첫_팀프로젝트_시작>
- <doc:211004_사전과제,_짝프로그래밍,_Git기초>
## Topics
7 changes: 1 addition & 6 deletions Sources/AriNote/TIL.docc/Rx.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,4 @@ RxSwift를 활용한 비동기 프로그래밍
@TitleHeading("Overview")
}

## Topics
- <doc:220813_RxSwift,_Almofire,_URLProtocol,_Unit_Test>
- <doc:220314_MVVM,_Rx,_changed,_coordinator,_observable>
- <doc:220304_RxSwift,_Observable,_Subject>
- <doc:220218_RxSwift,_RxCocoa,_RxRelay,_MVVM>
- <doc:220217_Dropbox,_RxSwift,_SPM,_DispatchGroup>
## Topics
29 changes: 1 addition & 28 deletions Sources/AriNote/TIL.docc/Swift.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,4 @@
@TitleHeading("Overview")
}

## Topics
- <doc:220923_URLSession,_CachePolicy>
- <doc:220105_URLProtocolMock,_WWDC2018,_URLSession,_NetworkTest>
- <doc:211231_inout,_async,_await,_Thread_Sanitizer>
- <doc:211224_escapingClosure,_autoClosure,_weak,_wildcard,_naming>
- <doc:211121_OSLog>
- <doc:211112_Delegation,_NumberFormatter,_Finding_and_Refactoring_Code,_SnapKit>
- <doc:211111_Capture_List,_SOLID,_protocol,_split,_UML>
- <doc:211109_removeAll,_attribute,_commit,_Numeric,_FloatingPoint,_NaN,_where,_SourceTree>
- <doc:211108_Delegate,_weak,_ARC,_Element,_Queue,_Stack,_LinkeList>
- <doc:211020_KVC,_Notification,_NotificationCenter>
- <doc:211019_Nested_Type,_operator,_Dictionary,_Sequence,_LocalizedError,_Error_Handling>
- <doc:211013_Naming,_if-else,_switch,_반복문과_재귀함수,_reset,_reflog>
- <doc:211012_프로젝트,_Properties,_KeyPath,_KVC,_iOS,_HIG>
- <doc:211011_condition,_condition-list,_flow_chart,_일반화추상화은닉화캡슐화,_Ground_rules,_Daily_Scrum,_메소드명>
- <doc:211009_Optional,_Dictionary,_compactMap>
- <doc:211008_Destructuring,_commit,_branch,_Changes_requested,_refactoring,_전역변수를_잘안쓰는_이유,_naming,_reduce>
- <doc:211007_땅따먹기,싱글톤,KVO,compactMap,프로젝트>
- <doc:211006_첫팀프로젝트,lazy,가독성,성능고려,재사용성,고차함수와_반복문의_성능차이>
- <doc:210831_Result>
- <doc:210827_FileManger>
- <doc:210820_이니셜라이저,_궁금했던_키워드>
- <doc:210817_프로토콜>
- <doc:210816_접근제어>
- <doc:210811_Swift는_왜_let을_선호할까>
- <doc:210809_enum>
- <doc:210805_API_Design_Guidelines>
- <doc:210803_for-in_외_forEach>
## Topics
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# 240728 Swift DocC, Github Pages, Github Action

Documentation을 웹페이지로 변환하여 Github Pages로 배포하는 방법

7월 27일 (토)

# 학습내용

- Xcode로 만든 Documentation을 웹페이지로 변환하기
- 변환한 웹페이지를 Github Pages로 배포하기
- Github Action으로 웹페이지 배포 자동화하기

# 고민한 점 / 해결방법

#

## Xcode로 만든 Documentation을 웹페이지로 변환하기 (Pages)

`docc-plugin`을 사용하여 아래와 같이 커맨드를 수행한다.

```
$ swift package --allow-writing-to-directory {저장위치} \
generate-documentation --target {타겟이름} \
--disable-indexing \
--transform-for-static-hosting \
--hosting-base-path {레포지토리-이름} \
--output-path {저장위치}
```

그러면 아래와 같이 저장위치에 변환된 웹페이지 파일들이 생성된다.

![](https://github.com/user-attachments/assets/59e67823-c7fc-4a69-8775-6e5359ed4aaa)

## 변환한 웹페이지를 Github Pages로 배포하는 방법

1. 앞서 변환한 웹페이지 파일들(docs)를 레포지토리에 푸쉬한다.
2. 그리고 레포지토리 Settings > Pages로 진입하여 아래와 같이 설정을 바꿔준다.
- 브랜치로 직접 배포하는 설정.
- 배포할 브랜치를 선택한 후 웹페이지가 포함된 디렉토리 docs를 루트로 선택해주었다.
![image](https://github.com/user-attachments/assets/d871ecd9-80c9-40e9-bb01-888b4c3ef8ea)
3. 이후 main 브랜치에 커밋이 푸시될 때마다 아래와 같이 Github Action이 동작하면서 배포가 된다.
![](https://github.com/user-attachments/assets/cf411b0a-0af7-48d8-99e6-5fdaa0398718)

# Trouble shooting

## 문서 구조 구성하기

### 원인
각 카테고리마다 하위 문서를 설정해주고 싶었다. 아래는 문서 구조가 잡히지 않는 상황이다.

![](https://github.com/user-attachments/assets/0e4f9707-697f-4204-acd3-9921e75e4fe2)

문서 구조를 설정해주려면, 각 파일에 `## Topics`를 추가하여 `- <doc:{파일이름}>`을 추가해주어야 한다.

![](https://github.com/user-attachments/assets/ebaac4e4-d531-4640-84d3-335fbeda13a6)

### 이유

근데 이걸 모두 수작업으로 하기엔 너무 번거롭다는 생각이 들었다.

그래서 swift로 스크립트를 짜서 문서 설정을 자동화하기로 했다.

### 해결

스크립트는 아래와 같은 조건으로 짜게 되었다.

1. `TIL.md` 파일을 제외한 나머지 `.md` 파일을 찾는다.
2. `.md` 파일들과 이름이 같은 디렉토리 경로를 찾는다.
3. 해당 디렉토리에 있는 파일 이름을 모두 찾아 내림차순으로 정렬하여, `.md`파일에 `## Topics` 섹션을 찾거나 추가한다.
4. 정렬된 파일 목록을 Topics 섹션에 양식에 맞게 추가하도록 했다. (양식: `- <doc:{파일이름}>`)

그리고 이 스크립트를 활용해서 Github Pages를 배포하는 것도 자동화하기 위해 브랜치가 아니라 Github Action으로 배포하도록 설정을 바꾸었다.

![](https://github.com/user-attachments/assets/1e7c9a54-f7a2-43e0-b6e2-29a621e1f1d0)

워크플로우는 다음과 같은 순서로 step을 구성했다.

1. 레포지토리 체크아웃
2. swift run 커맨드로 스크립트 수행하여 각 .md 파일 업데이트
3. docc-plugin으로 Documentation을 웹페이지로 변환
4. Github Pages 배포

> workflow: https://github.com/leeari95/TIL/blob/main/.github/workflows/update-markdown-files.yml
---

# 참고 링크

- https://www.swift.org/documentation/docc/adding-structure-to-your-documentation-pages
- https://www.swift.org/documentation/docc/
- https://swiftlang.github.io/swift-docc-plugin/documentation/swiftdoccplugin/publishing-to-github-pages/
6 changes: 1 addition & 5 deletions Sources/AriNote/TIL.docc/SwiftUI.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,4 @@
@TitleHeading("Overview")
}

## Topics
- <doc:220317_Widget,_Timeline,_Decorator_Pattern>
- <doc:220315_Memory_Leak,_RxSwift,_withUnretained,_Widget>
- <doc:220224_SwiftUI,_Property_Wrapper,_Divider,_List,_GeometryReader>
- <doc:220221_Localization,_퀴즈_오답노트,_SwiftUI_Tutorial>
## Topics
66 changes: 1 addition & 65 deletions Sources/AriNote/TIL.docc/UIKit.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,68 +3,4 @@
한몸이 되보자...


## Topics
- <doc:240227_PhotoKit,_PHPickerViewController,_PHPickerConfiguration,_PHAssetCollection>
- <doc:231201_AVPlayer,_waitingToPlayAtSpecifiedRate,_waitingToPlayAtSpecifiedRate>
- <doc:230915_UIImage_withTintColor_renderingMode>
- <doc:230911_openNotificationSettingsURLString>
- <doc:230904_keyboardLayoutGuide>
- <doc:230710_addSubview_ReferenceCount>
- <doc:220711_ARC,_dismiss,_popViewController,_memory_leak>
- <doc:220520_URLSession,_NSCache,_셀_재사용>
- <doc:220318_UIStoryboard,_Spell_checking_in_Xcode,_Quick_help>
- <doc:220307_High_Performance_Auto_Layout,_RxSwift,_Single,_DTO>
- <doc:220228_UserNotifications,_AppDelegate>
- <doc:220222_UISearchController>
- <doc:220215_Dropbox,_weak_self,_escaping,_Delayed_Deallocation,_performBatchUpdate,_setEditing>
- <doc:220214_Core_Animation,_CABasicAnimation,_append,_escaping,_UITableView-Crash,_UITextViewDelegate,_typingAttributes>
- <doc:220211_UIContextualAction,_UIAlertAction,_UIActivityViewController,_setSelected,_selectedBackgroundView,_actionSheet,_popoverPresentationController,_viewWillTransition>
- <doc:220210_Core_Graphics,_codegen,_returnsObjectsAsFaults,_NSFetchRequestResult,_Array_item_to_new_position>
- <doc:220208_reloadRows,_cancelsTouchesInView,_translatesAutoresizingMaskIntoConstraints,_Array_Safe_Access,_barButtonSystemItem,_UISplitViewControllerDelegate>
- <doc:220207_View_Drawing_Cycle,_UISplitViewController이론>
- <doc:220128_CoreData,_NSPredicate,_Relationship>
- <doc:220127_UITextField,_Animation,_MVVM,_Observable,_UINavigationBarAppearance,_Appearance>
- <doc:220125_UITapGestureRecognizer,_UICollectionView>
- <doc:220124_CoreData,_Dynamic_Type,_UIFontMetrics,_setCustomSpacing,_viewForZooming,_데이터베이스,_SQL>
- <doc:220121_selectedBackgroundView,_UIRefreshControl,_피드백,_paging>
- <doc:220120_UIAlertController,_KeyChain>
- <doc:220118_UITextField,_Keyboard,_UITextView,_ScrollView,_touchesBegan,_Recognizer,_UIImage>
- <doc:220117_스위프트의_성능_이해,_UIImagePickerController>
- <doc:220114_Implementing_Modern_Collection_Views_Custom>
- <doc:220110_FileManager,_iOS_File_System,_Multipart_form-data>
- <doc:220107_TableView,_CollectionViewListCell,_ContentOffset,_ContentInset>
- <doc:220106_UISegmentedControl,_오픈마켓PR1피드백>
- <doc:220103_UICollectionView,_HTTP,_URLSession>
- <doc:211227_Responder_Chain,_Touch_Event,_DispatchSemaphore>
- <doc:211226_associated_type,_Responder_Chain,_Touch_Event,_Run_Loop>
- <doc:211222_UICollectionViewFlowLayout,_POP>
- <doc:211221_CollectionView,_Unit_Test>
- <doc:211214_static,_Factory_Pattern,_visibleViewController>
- <doc:211210_loadviewifneeded,_Storyboard_Reference>
- <doc:211209_뷰의재사용,_TableView,_xib,_celldidSelect,_Select시_회색배경제거,_indexPathForSelectedRow>
- <doc:211208_Navigation_Bar,_UIImageView,_NSMutableAttributedString,_addAttribute>
- <doc:211206_TableView_활동학습,_JSON,_API>
- <doc:211203_TableView,_뷰의재사용>
- <doc:211126_App_Life_Cycle,_CFGetRetainCount,_README>
- <doc:211125_Auto_Layout,_View_Life_Cycle,_StaticString,_fork해온_repository_잔디적용법>
- <doc:211123_App_Life_Cycle,_UIView_init,_frame_vs_bounds,_IBOutlet_didSet,_updateViewConstraints>
- <doc:211122_ARC,_OSLog,_debugPrint,_assert,_initializer,_scrollRectToVisible,_CGRect>
- <doc:211119_viewDidLoad,_LocalizedError,_ScrollView_bar_hide,_addSubView,_IBInspectable,_cornerRadius,_viewWillLayoutSubviews,_private_extension>
- <doc:211118_Functional_Programming,_Higher-order_function,_Main_Run_Loop,_Update_Cycle,_UIView,_attribute>
- <doc:211116_Scroll_View,_Stack_View,_setContentOffset,_layoutIfNeeded,_setNeedsLayout>
- <doc:211105_Outlet_Collection,_extension,_험난한_협업_과정,_이유와_근거>
- <doc:211104_TDD,_Unit_Test,_@discardableResult,_Cell_Style,_dropLast(),_removeLast(),_popLast()>
- <doc:211103_TDD,_Unit_Test,_TableView>
- <doc:211102_loadViewIfNeeded,_adjustsFontForContentSizeCategory,_adjustsFontSizeToFitWidth,_UIButton,_NavigationViewController,_removearrangedsubview>
- <doc:211101_KVO,_Property_Observer,_prepare,_loadViewIfNeeded,_NSObject,_UML,_Auto_Layout>
- <doc:211030_Auto_Layout>
- <doc:211029_ViewController,_Life_Cycle,_NotificationCenter,_deinit,_Bundle,_preview>
- <doc:211028_UIStepper,_auto_layout,_prepare,_extension,_CustomStringConvertible,_NSBundle,_UIButton>
- <doc:211026_Device_Orientation,_NavigationViewController,_madal,_Gesture,_Naming>
- <doc:211025_UINavigationBar,_LocalizedError,_self,_Self,_protocol,_extension,_TypeCasting,_Optional,_dismiss>
- <doc:211023_Initialization,_MVC,_Notification_복습>
- <doc:211022_ViewController,_Navigation_Controller,_Life_cycle>
- <doc:211021_initalizer,_HIG,_Notification,_Alert,_Segue,_Storyboard>
- <doc:211014_HIG,_재귀함수,_반복문,_Thread,_Serial_Queue,_Xcode_debugging>
- <doc:210807_왕초보를_위한_IOS_앱개발>
- <doc:210806_왕초보를_위한_IOS_앱개발>
## Topics
8 changes: 1 addition & 7 deletions Sources/AriNote/TIL.docc/Xcode.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,4 @@
@TitleHeading("Overview")
}

## Topics
- <doc:240104_UserDefaults,_Xcode_Find_and_Replace_Regular_Expression>
- <doc:220321_App_Distribution,_Hashable>
- <doc:211220_의존성_관리도구,_오픈소스>
- <doc:211213_Accessibility,_Dynamic_Type,_Voice_over,_fatalError,_함수형_프로그래밍,_Vim>
- <doc:211115_LLDB,_Complie,_Build,_Link,_split,_components,_import,_get>
- <doc:211015_LLDB,_GCD,_Thread,_Serial_Queue,_Async>
## Topics

0 comments on commit 2e36ee1

Please sign in to comment.