# cats\_dogsã®Markdownå¦ç cats\_dogsããµãã¼ããã¦ããMarkdownã®æ¸å¼ã¯ã[CommonMark Spec](https://spec.commonmark.org/) ããã¼ã¹ã«Githubã¨ã®äºææ§ã¨Unicodeã§ã®å©ç¨ãèæ ®ãã¦ãæ¡å¼µããä»æ§ã«ãªã£ã¦ãã¾ãã æ¡å¼µããé¨åã®ä»æ§ã¯ã**markdown\_config**è¨å®ãã¡ã¤ã«ã§ãæå¹ç¡å¹ãåãæ¿ããnãã¨ãåºæ¥ã¾ãã 詳ããã¯å¾è¨ã®ã**markdown\_config**è¨å®ãã¡ã¤ã«ãã®é ç®ãåç §ãã¦ãã ããã Markdownã®ãã¼ãµã¼ã«ã¯ãCommonMarkäºæãª[yuin/goldmark](https://github.com/yuin/goldmark)ã¸æ©è½ã追å ãã[SYM01/htmlsanitizer](https://github.com/sym01/htmlsanitizer)ãã¤ãã£ã¦ãHTMLããµãã¿ã¤ãºãã¦å®å ¨æ§ãé«ãããã®ã使ã£ã¦ãã¾ãã GitHubã追å ãµãã¼ããããMathJaxå½¢å¼ã®æ°å¼ãmermaidå½¢å¼ã®å³ãGeoJSONã§ã®å°å³åãè¾¼ã¿ãªã©ã®æ©è½ãå®è£ ãã¦ãããGitHubã¨é«ãäºææ§ãå®ç¾ãã¦ãã¾ãã 対å¿ãã¦ããMarkdownæ¡å¼µã®åæ©è½ã«ã¤ãã¦ã¯ãå¾è¨ã®ã`[extension]`ã®è¦ç´ ãã®é ç®ãåç §ãã¦ãã ããã ## **markdown\_config**è¨å®ãã¡ã¤ã« Markdownã®å¦çãå¤æ´ãããå ´åã«å©ç¨ããè¨å®ãã¡ã¤ã«ã§ãã **cat\_mdview**ã**cat\_tmplview**ã®è¨å®ãã¡ã¤ã«ã®**markdown\_config**ãã©ã¡ã¼ã¿ã«æå®ãã¦å©ç¨ãã¾ãã ããã©ã«ãè¨å®ã§ã¯ãMarkdownã®æ¡å¼µæ©è½ãã»ã¨ãã©ç¡å¹ã«ãªã£ã¦ãã¾ããå¿ è¦ã«å¿ãã¦ã«ã¹ã¿ãã¤ãºãã¦ãã ããã ããã©ã«ãè¨å®ã®è©³ç´°ã«ã¤ãã¦ã¯[Markdownå¦çã®ããã©ã«ãè¨å®](default/markdown_conf.md)ãåç §ãã¦ãã ããã 以ä¸ã¯è¨å®ãµã³ãã«ã§ãã ``` [extension] table = true strikethrough = true task_list = true definition_list = true footnote = true cjk = true emoji = true autolinks = false math = true mermaid = true highlight = true geo_map = true embed = true [auto_ids] #type = "safe" type = "gfm" [footnote] backlink_html = "æ»ã" #[emoji] #mapping = "/xxx/etc/emoji_mapping.conf" #[embed] #rules = "/xxx/etc/embed_rules.conf" ``` ## `[extension]`ã®è¦ç´ `[extension]`ã§ã¯ã以ä¸ã®ãã©ã¡ã¼ã¿ã§ãMarkdownå¦çã®æ©è½ã®æå¹ç¡å¹ãæå®ãã¾ãã |ãã©ã¡ã¼ã¿å|æå³| | :--- | :--- | |**table**|Tablesæ¡å¼µã®æå¹ç¡å¹| |**strikethrough**|Strikethroughæ¡å¼µã®æå¹ç¡å¹| |**task\_list**|Task list itemsæ¡å¼µã®æå¹ç¡å¹| |**definition\_list**|Definition listæ¡å¼µ([PHP Markdownãã](https://michelf.ca/projects/php-markdown/extra/#def-list))ã®æå¹ç¡å¹| |footnote|Footnotesæ¡å¼µ(PHP Markdownãã)ã®æå¹ç¡å¹| |**cjk**|CJK対å¿æ©è½ã®æå¹ç¡å¹| |**emoji**|Emojiæ¡å¼µ([Emoji Chart Sheetãã](https://github.com/ikatyang/emoji-cheat-sheet/blob/master/README.md))ã®æå¹ç¡å¹(GitHub Custom Emoji種å¥ã®çµµæåã«ã¯ã対å¿ãã¦ãã¾ãã)| |**autolinks**|AutoLinksæ¡å¼µã®æå¹ç¡å¹| |**math**|MathJax表è¨(é«éåã®ããã[KaTeX](https://katex.org/)ãå©ç¨)ã®æå¹ç¡å¹| |**mermaid**|[Mermaid](https://mermaid-js.github.io/mermaid/)表è¨ã®æå¹ç¡å¹| |**highlight**|è¨èªãã©ã¼ãããã®ãã¤ã©ã¤ãæ©è½ã®æå¹ç¡å¹| |**geo\_map**|GeoJSON/TopoJSONã®å°å³è¡¨ç¤ºæ©è½ã®æå¹ç¡å¹| |**embed**|audio/video/iframeã¿ã°ã§ã®åãè¾¼ã¿è¡¨ç¤ºæ©è½ã®æå¹ç¡å¹(Markdownã®è¡¨è¨ã¯ãç»ååãè¾¼ã¿ã¨åãæ¸å¼ã§ãã)| GFMäºæã®Markdownæ¡å¼µã®å 容ã«ã¤ãã¦ã¯ã[GitHub Flavored Markdown Spec](https://github.github.com/gfm/)ãåç §ãã¦ãã ããã ## `[auto_ids]`ã®è¦ç´ `[auto_ids]`ã§ã¯ã以ä¸ã®ãã©ã¡ã¼ã¿ã§ãè¦åºãã®IDã®èªåçææ¹æ³ãæå®ãã¾ãã |ãã©ã¡ã¼ã¿å|æå³| | :--- | :--- | |**type**|IDçææ¹æ³ã®ç¨®å¥ãæå®ãã¾ãã`safe`ã¨`gfm`ãæå®ã§ãã¾ãã| **type**ã«æå®ã§ããIDçææ¹æ³ã®ç¨®å¥ã®æå³ã¯ä»¥ä¸ã®éãã§ãã |IDçææ¹æ³ã®ç¨®å¥|æå³| | :--- | :--- | |`safe`|è¦åºãã®ããã¹ãããHTML5ã«éåããªãç¯å²ã§ãåºæ¥ãã ãå ã®ããã¹ããæ®ããå½¢ã§IDãçæãã¾ãããã ããããã¹ããéè¤ããå ´åã¯ããã¤ãã³(`-`)ã¨æ°åã追å ãã¦éè¤ããªãããã«å å·¥ãã¾ãã(ããã©ã«ãã®åä½)| |`gfm`|GitHubé¡ä¼¼ãªIDçæããã¾ãã大æåå°æåãªã©ã®å¤æ| ## `[footnote]`ã®è¦ç´ 以ä¸ã®ãFootnotesæ¡å¼µã®ãã©ã¡ã¼ã¿ãè¨å®ãã¾ãã |ãã©ã¡ã¼ã¿å|æå³| | :--- | :--- | |**backlink\_html**|æ»ããªã³ã¯ã«ä½¿ãããHTMLã®è¡¨è¨| ## `[emoji]`ã®è¦ç´ Emojiæ¡å¼µã®å¤æã«ã¼ã«ãå¤æ´ãããã¨ãã«æå®ãã¾ãã **mapping**ã« çµµæåã®ãããã³ã°ãTOMLãã¡ã¤ã«ã§è¨è¿°ãããã¨ã§ãå®ç¾©ã§ãã¾ãã ããã©ã«ãã®è¨å®ããå¤æ´ãããå ´åã«ããã®TOMLãã¡ã¤ã«ã§è¨å®ãã¾ãã ããã©ã«ãè¨å®ã§ã¯GitHubã¨åçãªçµµæåã®å¤æã«ã¼ã«ãè¨å®ãããã¦ãã¾ãã(GitHubã®GitHub Custom Emojiã¯ç»åã§å®ç¾ãã¦ããã®ã§ã対å¿ãã¦ãã¾ããã) ããã©ã«ãè¨å®ã®è©³ç´°ã«ã¤ãã¦ã¯[çµµæåå¤æã®ããã©ã«ãè¨å®](default/emoji_mapping_conf.md)ãåç §ãã¦ãã ããã ä¾ãã°ãããã©ã«ãã§ã¯ã:+1:(`:+1:`)ã¯ã以ä¸ã®ããã«å®ç¾©ããã¦ãã¾ãã ``` ["thumbs up"] emoji = "ð" aliases = ["+1", "thumbsup"] ``` åãã©ã¡ã¼ã¿ã®æå³ã¯ä»¥ä¸ã®ã¨ããã§ãã |ãã©ã¡ã¼ã¿å|æå³| | :--- | :--- | |`"thumbs up"`|çµµæååã®é·ã表è¨| |**emoji**|çµµæåã®Unicodeã®æåå| |**aliases**|çç¥è¡¨è¨(short code)ã®ãªã¹ã| ãã®è¡¨è¨ã対å¿ãããçµµæåã®æ°ã ãè¨è¿°ãã¦å©ç¨ãã¾ãã GitHubã®ææ°ã®å¤æã«ã¼ã«ã欲ããã ãã®å ´åã¯ã[cat\_gen\_emoji\_mappingã³ãã³ã](cat_gen_emoji_mapping.md)ã§ãç°¡åã«çæã§ãã¾ãã(ããã©ã«ãã®è¨å®ããã®ã³ãã³ãã§çæããç©ã§ãã) ## `[embed]`ã®è¦ç´ `[embed]`ã§ã¯ã以ä¸ã®ãã©ã¡ã¼ã¿ã§ãé³å£°ãåç»ã®åãè¾¼ã¿æ¹æ³ãæå®ãã¾ãã - **rules** audio/video/Iframeã¸ã®å¤æã«ã¼ã«ãã¡ã¤ã«ãæå®ãã¾ãã ããã©ã«ãè¨å®ã§ã¯ã以ä¸ã®ãã¡ã¤ã«ã®åãè¾¼ã¿ã«å¯¾å¿ãã¦ãã¾ãã - ãã¼ã«ã«ã®åç»ãã¡ã¤ã«(`*.mp4`ã`*.m4v`ã`*.webm`) - ãã¼ã«ã«ã®é³å£°ãã¡ã¤ã«(`*.mp3`ã`*.m4a`ã`*.wav`ã`*.wave`ã`*.flac`) - YouTubeåç»(`www.youtube.com`ã`youtube.be`) - vimeoåç»(`vimeo.com`ã`player.vimeo.com`) ããã©ã«ãè¨å®ã®è©³ç´°ã«ã¤ãã¦ã¯[åãè¾¼ã¿å¦çã®ããã©ã«ãè¨å®](default/embed_rules_conf.md)ãåç §ãã¦ãã ããã ### audio/video/Iframeã¸ã®å¤æã«ã¼ã«ãã¡ã¤ã« 以ä¸ã¯ãaudio/video/Iframeã¸ã®å¤æã«ã¼ã«ãã¡ã¤ã«ã®å 容ã®ãµã³ãã«ã§ãã ``` video_ext = ["mp4", "m4v", "webm"] audio_ext = ["mp3", "m4a", "wav", "wave", "flac"] [[audio]] site_id="audio_site" host="www.example.com" path="/audio" regex="\\.webm$" [[video]] Gsite_id="video_site" host="www.example.com" path="/video" regex="\\.wave$" [[iframe]] site_id="youtube" host="www.youtube.com" type="query" query="v" path="/watch" player="https://www.youtube.com/embed/$0" [[iframe]] site_id="youtube" host="youtu.be" type="regex" regex='^/([^/]+)$' player="https://www.youtube.com/embed/$1" [[iframe]] site_id="youtube" host="www.youtube.com" type="path" path="/embed" player="https://www.youtube.com/embed/$0" ``` ### ã«ã¼ãè¦ç´ |ãã©ã¡ã¼ã¿å|æå³| | :--- | :--- | |**video\_ext**|videoã¿ã°ã«ãããã¡ã¤ã«ã®æ¡å¼µå| |**audio\_ext**|audioã¿ã°ã«ãããã¡ã¤ã«ã®æ¡å¼µå| ## `[[video]]`ã®è¦ç´ ã`[[audio]]`ã®è¦ç´ `[video]`ã¯videoã¿ã°ã`[audio]`ã¯audioã¿ã°ãä½ãæå®ã§ãã 以ä¸ã®è¦ç´ ã®æå®ã§ã§ã該å½ããURLãå¤å®ãã¾ãã |ãã©ã¡ã¼ã¿å|æå³| | :--- | :--- | |**site\_id**|CSSã§ã®ã«ã¹ã¿ãã¤ãºç¨ã®èå¥å| |**host**|å¦ç対象ã«ãããã¹ã| |**path**|å¦ç対象ã«ããURLãã¹ã®ãã£ã¬ã¯ããª| |**regex**|å¦ç対象ã«ããURLãã¹ã®æ£è¦è¡¨ç¾| ### `[[iframe]]`ã®è¦ç´ è¦ç´ ã®ä½¿ããæ¹ã¯ã**type**ã®å¤ã§å¦çæ¹æ³ãå¤ããã¾ãã ãã ã以ä¸ã®è¦ç´ ã¯ãã©ã®typeå¤ã§ãåãæå³ã«ãªãã¾ãã |ãã©ã¡ã¼ã¿å|æå³| | :--- | :--- | |**site\_id**|CSSã§ã®ã«ã¹ã¿ãã¤ãºç¨ã®èå¥å| |**host**|å¦ç対象ã«ãããã¹ã| ### **type**="path"ã®å ´å **path**ãURLãã¹ã®ããã£ã¬ã¯ããªé¨åã¨ä¸è´ããå ´åã«å¦çãè¡ãªããã¾ãã **player***ã®$0ãããã¡ã¤ã«åã«ç½®ãæãããã¦ãiframeã¿ã°ã«å¤æããã¾ãã ### **type**="query"ã®å ´å **path**ã¨URLãã¹ãä¸è´ããå ´åã«å¦çãè¡ãªããã¾ãã **query**ã«æå®ããqueryãã©ã¡ã¼ã¿åã®å¤ãåãåºãã¦ã **player***ã®$0ã¨ç½®ãæãããã¦ãiframeã¿ã°ã«å¤æããã¾ãã ### **type**="regex"ã®å ´å **regex**ã«æ¸ãããæ£è¦è¡¨ç¾ã¨URLãã¹ãä¸è´ããå ´åã«å¦çãè¡ãªããã¾ãã **player**ã®ã$0é¨åã**regex**ã®æ£è¦è¡¨ç¾ã«ãããããæååã¸ã$1ã$9é¨åãé¨åãããããæåå(æ£è¦è¡¨ç¾ã®`()`é¨å)ã¸ç½®ãæããå¾ãiframeã¿ã°ã«å¤æããã¾ãã ### ããã©ã«ãè¨å® ããã©ã«ãã®è¨å®ã¯ãä¸è¨ã®å 容ã§ãã Audio/Videoã®ããã¤ãã®æ¡å¼µåã¨ãYouTubeããã³vimeoã®ããã¤ãã®URLã®ãã¿ã¼ã³ã«å¯¾å¿ããè¨å®ã«ãªã£ã¦ãã¾ãã ``` video_ext = ["mp4", "m4v", "webm"] audio_ext = ["mp3", "m4a", "wav", "wave", "flac"] [[iframe]] site_id="youtube" host="www.youtube.com" type="query" query="v" path="/watch" player="https://www.youtube.com/embed/$0" [[iframe]] site_id="youtube" host="youtu.be" type="path" path="/" player="https://www.youtube.com/embed/$0" [[iframe]] site_id="youtube" host="www.youtube.com" type="path" path="/embed" player="" [[iframe]] site_id="vimeo" host="vimeo.com" type="path" path="/" player="https://player.vimeo.com/video/$0" [[iframe]] site_id="vimeo" host="player.vimeo.com" type="path" path="/video" player="" ``` ## twitterçã®å¤é¨ã¢ããªã®åã込㿠åãè¾¼ã¿ã«å¯¾å¿ããWebã¢ããªã®å ´åãJavaScriptã©ã¤ãã©ãªãå©ç¨ããä»çµã¿ã«ãªã£ã¦ããã¨ãå¤ãã§ãã ãã®ãããªWebã¢ããªãåãè¾¼ã¿ããå ´åã¯ãtemplateãã¡ã¤ã«ãå¤æ´ããJavaScriptã©ã¤ãã©ãªããã¼ããããå¿ è¦ãããã¾ãã ãã ããå¤é¨ã®JavaScriptã©ã¤ãã©ãªã®å©ç¨ã«ã¯ãªã¹ã¯ãããã¾ãã注æãã¦å©ç¨ãã¦ãã ããã ãã®æé ã¯ä»¥ä¸ã®éãã§ãã 1. JavaScriptã©ã¤ãã©ãªãã¼ãç¨ã®ãã³ãã¬ã¼ããã¡ã¤ã«ãä½æããã - 以ä¸ã¯twitterã®ä¾([enable\_twitter.tmpl](../lib/tmpl/enable_twitter.tmpl)ã®å 容) ``` {{if once "enable_twitter.tmpl" -}} {{end -}} ``` - ãã¼ãã¿ã¤ãã³ã°ã¯`defer`ãæå®ãã¦ãã ããã(ã³ã³ãã³ãã®èªã¿è¾¼ã¿ãå®äºããå¾ã§ãJavaScriptã©ã¤ãã©ãªãåä½ããå¿ è¦ãããããã§ãã) 1. JavaScriptã©ã¤ãã©ãªããã¼ããããã³ãã¬ã¼ããã¡ã¤ã«ãæå¹ã«ããã - ä½æãããã³ãã¬ã¼ããã¡ã¤ã«ã®æå®ãã[part\_head.tmpl](../lib/tmpl/part_head.tmpl)ã¸è¿½å ããã - 以ä¸ã¯ã`enable_twitter.tmpl`ãæå¹åããä¾ã§ãã ``` {{template "enable_twitter.tmpl" -}} ```