ðŸ Archived View for geminiprotocol.net ⺠docs ⺠ja ⺠gemtext-specification.gmi captured on 2024-08-24 at 23:43:26. Gemini links have been rewritten to link to archived content
â¬ ïž Previous capture (2024-08-18)
-=-=-=-=-=-=-
ããŒãžã§ã³0.24.0
æ¬ææžã¯ä»¥äžã®æ¡é ã®ããšããããªãã¯ãã¡ã€ã³ã«çœ®ãããŸãã
Creative Commons CC0 1.0 Universal Public Domain Dedication
æ¬ææžã§ã¯ãgemtextããã€ããŒããã¹ã圢åŒãèŠå®ããŸããGemtextã®ç®çã¯ãGeminiãã¡ã€ã«è»¢éãããã³ã«ã®ãçæ¥ã®ãå¿ç圢åŒãšããŠããµãŒããŒããéãããããšã§ããHTMLãHTTP [RFC7230]ã®çæ¥ã®å¿ç圢åŒã§ããããšãšåæ§ã§ãããã ããçžå¿ãããã®ã§ããã°ãä»ã®ç®çã§ãå©çšã§ããŸããGemtextã¯æªç»é²ã®MIMEçš®å¥text/geminiã䜿ããGeminiãä»ããŠãµãŒããŒããéãããŸãã
Geminiã®ãããã¯ãŒã¯ãããã³ã«ã®ä»æ§ãåç §
æ¬ææžäžã®ããŒã¯ãŒããããªããã°ãªããªã (MUST)ããããŠã¯ãªããªã (MUST NOT)ããæ±ãããã (REQUIRED)ããããããšã«ãªã£ãŠãã (SHALL)ããããªãããšã«ãªã£ãŠãã (SHALL NOT)ãããã¹ã (SHOULD)ãããã¹ãã§ãªã (SHOULD NOT)ããå§ãã (RECOMMENDED)ããããŠããã (MAY)ããçãã (OPTIONAL)ã㯠[BCP14] äžã«èšèŒãããŠããéãã«è§£éãããŸãã
Gemtextã¯åäžã®é»åææžã«å¯Ÿå¿ããã¹ãèšèšãããŠããŸããä»ã®ãªã³ã©ã€ã³ã®è³æãšé¢é£ä»ããããå€çš®å€æ§ãªåœ¢ã倧ããã®ç»é¢ãæã€æ©åšã§ç°¡åãã€å¿«é©ã«èªããããã«è¡šç€ºã§ããŸããåºå®æ°æåã§ã匷åºã«æãè¿ããããçŽ ã®ããã¹ãïŒã¯ã©ã€ã¢ã³ãã®ç»é¢ã§ã¯é·éãããçéãããããŠå åãšã¯èšãé£ãå¯èœæ§ããããŸãïŒã«ãŸãããå©çšè äœéšããããããŸãããŸããçŽ ã®ããã¹ãã§ã¯å©çšè ãæäœæ¥ã§ææžããURLãã³ããŒãããŠãŒã¶ãŒãšãŒãžã§ã³ãã€ã³ã¿ãŒãã§ãŒã¹ã«è²Œãä»ããªããã°ãªããŸããã§ããã
圢åŒã¯ãæã§æžãäžã§åçŽã§ããããšãšãå®è·µã«ãããŠæ§æ解æãåçŽã§ããããšãåå°ã«èšèšãããŸãããgemtextææžã«æ¬ ãããªãæ§é ã®æ¡ä»¶ã¯ãéå±€çã§ãªããå¹³æ¿ãã€åäžã§ãããäžããäžã«æ£ããåŠçãèµ°ã£ãŠæ§æ解æãšå瀺ãè¡ãããšããã«ãããŸãã
圢åŒã¯ãææžã®è¡šç€ºã®ããããã«ã€ããŠãææžã®å·çè ã«ããã粟å¯ã§è€åå¯èœãªæ°Žæºã®å¶åŸ¡ã«åœ¹ç«ãŠãããããšãæå³ããŠããŸãããè£ é£Ÿã¯ãŠãŒã¶ãŒãšãŒãžã§ã³ãæ¯ã«å¶åŸ¡ãããŸãã
ãtextãæäžäœã¡ãã£ã¢çš®å¥ã®å¯çš®å¥ã§ãããtext/geminiãã¯ã[RFC2046] ã«å®çŸ©ãããŠãããcharsetãåŒæ°ãç¶æ¿ããŸããããããªãããGeminiãä»ããŠè»¢éããããtextãå 容ã®ãcharsetãã®æ¢å®å€ã¯ãUTF-8ãã§ãã
ãtext/geminiãå¯çš®å¥ã§åå¥ã«å®çŸ©ãããŠãããè¿œå ã®åŒæ°ã1ã€ãããŸããããã¯ãlangãåŒæ°ã§ãããlangãã®å€ã¯ãtext/geminiãææžã®ããã¹ãå 容ãæžãããŠããèªç¶èšèªã瀺ããã®ã§ãããlangãåŒæ°ã¯çããŸãããlangãåŒæ°ããããšãããã®è§£éã¯å®å šã«ã¯ã©ã€ã¢ã³ãã§å®çŸ©ãããŸããäŸãã°ã¯ã©ã€ã¢ã³ãã§ã¯ãlangãã®å€ã䜿ããå 容ã®çŽç©ãæ¹åããŠãæ§ããŸããããlangãåŒæ°ãç¡ãå Žåãäœãæ¢å®å€ã¯ä»®å®ãããŸãããïŒããã¹ãããé³å£°ãžã®å€æãè¡ãç»é¢èªã¿äžãåšãšãã£ãïŒå 容ãåŠçããããã«èšèªã®æ€ç¥ãå¿ èŠãªã¯ã©ã€ã¢ã³ãã§ã¯ããlangãåŒæ°ãæ¬ èœããŠããå Žåã«ãã©ã®ããã«åŠçãç¶ããã°è¯ãã決å®ãããããå©çšè ã®å ¥åã«é Œãã¹ãã§ãã
ãlangãåŒæ°ã®åŠ¥åœãªå€ã¯ [BCP47] ã«å®çŸ©ããã1ã€ä»¥äžã®èšèªæã®ã³ã³ãåºåã®ãªã¹ãã§ããäŸãã°ä»¥äžã§ãã
Gemtextã¯è¡æåã®åœ¢åŒã§ããææžã¯1è¡ä»¥äžãããªããŸãã6ã€ã®ç¬ç«ããè¡ã®çš®é¡ããããŸããåè¡ã¯æ確ã«1ã€ã®çš®é¡ã«å±ããè¡ã®æåã®3æåã調ã¹ãããšã§ããã®çš®é¡ãææ§ããªãå€å®ã§ããŸããè¡ã®çš®é¡ãšæ§æ解æã®ç¶æ ïŒåŸè¿°ïŒãåãããããšã§ãå©çšè ã«ã©ã®ããã«è¡šç€ºããããã決ããŸããç¹å®ã®è¡ã®çš®é¡ã«é¢é£ä»ããããã衚瀺ãå瀺ã®è©³çŽ°ã¯ãå³å¯ã«ååå¥ã®è¡ã®ç¯çã«ãããŠå¶éãããŸããgemtextææžã§ã¯åå¥ã«åè¡ãæ±ãããšã§ãæåããæåŸã®è¡ãŸã§1åéãããšã«ãããæ£ããæ§æ解æãšå瀺ãè¡ããŸãã
6ã€ã®çš®é¡ã¯ä»¥äžã®éãã§ãã
æ¬ä»æ§ã«æºæ ããäžã§ã¯ãgemtextææžãæ§æ解æãã衚瀺ãããœãããŠã§ã¢ã§ã¯ãããã¹ãè¡ããªã³ã¯è¡ãæžåŒååæ¿ãè¡ãã以äžã«èšè¿°ããéãã«æ±ããªããã°ãªããŸããããããã¯ãäžæ žã®ãè¡ã®çš®é¡ã§ãã
å©çšè ã®äœéšãåäžãããããã«ããœãããŠã§ã¢ã§ã¯è¿œå ã§èŠåºãè¡ãç®æ¡æžã®é ç®ãåŒçšè¡ãåŸè¿°ããéãã«æ±ã£ãŠãæ§ããŸããããããã®è¡ãèšè¿°ãããŠããéãã«æ±ããªããœãããŠã§ã¢ã¯ãããããããã¹ãè¡ã§ãããã®ããã«æ±ããªããã°ãªããŸããã
æºæ ããgemtextæ§æ解æåšã¯ãåäžãããã®å éšç¶æ ãä¿æããªããã°ãªããŸãããããã¯ãæ§æ解æåšããéåžžã¢ãŒãããšãæžåŒåæžã¿ã¢ãŒããã®ã©ã¡ããªã®ããå¶åŸ¡ãããæ§æ解æåšã®ç¶æ ã§ããæ§æ解æåšã®ç¶æ ã¯ãè¡ãã©ã®ããã«èªèããããè¡ããã®çš®é¡ã§ãã£ããšãã«ã©ãæ±ãããããå¶åŸ¡ããŸããæ§æ解æåšã¯ãææžã®æ§æ解æãéå§ããæç¹ã§ããéåžžã¢ãŒããã§ãªããã°ãªããŸãããæ§æ解æåšã¯ããã®ç¹å®ã®ç®çãäžããè¡ã®çš®é¡ã«ééãããšãã2ã€ã®ã¢ãŒãã®éãåãæ¿ããŸããææžã®æ«å°Ÿã§ã®æ§æ解æåšã®ç¶æ ã«ã¯ãäœãæå³ã¯ãªããçµæã«äœçšããããšããããŸããã
ããã¹ãè¡ã¯ãæ¢å®ãã®è¡ã®çš®é¡ã§ããããã¯ããã®ä»å šãŠã®è¡ã®çš®é¡ãç¹å®ã®èå¥çšã®æ¥é èŸããå§ãŸãç¹ã§èªèããããšããæå³ã§ãããã®ãããªæ¥é èŸããå§ãŸããªãããããªãè¡ãããã¹ãè¡ã§ããå žåçãªgemtextææžã§ã¯ãå€ãã®è¡ã¯ãã®ããã¹ãè¡ãšãªãããšã§ãããã
ããã¹ãè¡ã«ã¯äœãç¹å¥ãªæå³è«ãç¡ããäžè¬çãªèªã¿æ¹ãããäžã§ãèŠèŠçã«èŠãããããã«å©çšè ã«è¡šç€ºãããã¹ãã§ãã现ããæå³åãã«ã€ããŠã¯ã¯ã©ã€ã¢ã³ãåŽã«è£éããããšããããšã§ããäŸãã°å¯å€å¹ ã®ãã©ã³ãã䜿ãããŠãè¯ãã§ããã空çœãæ£èŠåãããŠãè¯ãã§ãããåèªéã®ç©ºçœããæã®éã®ç©ºçœãé·ããªãããã«ããŠãè¯ãããšãã£ãæãã§ã衚瀺äžã®å·¥å€«ãé©çšããã®ã¯æ§ããŸãããã¯ã©ã€ã¢ã³ãã§ã¯ãå©çšè ããã©ã³ãã®å€§ãããèæ¯è²ãªã©ãå€ããããããã«ããŠãããã¹ãè¡ã®èŠãç®ãç¬èªã®ãã®ã«ããŠãæ§ããŸãããèè ã¯ããã¹ãã®å 容ã«å°å¿µããããã¹ãè¡ã®ç²Ÿå¯ãªå瀺ã«ã€ããŠç®¡çã§ãããšã¯æããªãããšã§ãã
ã¯ã©ã€ã¢ã³ãã®æ©åšã®ç»é¢ã«åãŸãåããé·ãããã¹ãè¡ã¯ãåãŸãããã«ãæãè¿ããããã¹ãã§ããã€ãŸãé·ãè¡ã¯ãæ©åšã«å¯ŸããŠé©åãªå¹ ã®ãè€æ°ã®é£ç¶ããè¡ã«ïŒçæ³çã«ã¯ç©ºçœããã€ãã³ã®ãšããã§ïŒåå²ãããã¹ãã§ãããã®æãè¿ãã¯ãããã¹ãã®åè¡ã«ç¬ç«ããŠé©çšãããŸããããããã¯ã©ã€ã¢ã³ãã®æ©åšã®ç»é¢ããçããè€æ°ã®é£ç¶ããããã¹ãè¡ã¯ãããå°ãªãé·ãè¡ã«çµåãããã¹ãã§ã¯ãããŸãããGemtextææžäžã®åã ã®è¡ã¯ãç¬ç«ããå®äœãªã®ã§ãã
空è¡ã¯ããã¹ãè¡ã«å«ãŸããç¹å¥ãªæå³ã¯ãããŸãããããããã«ã€ããŠãåçŽãªç©ºã®ç©ºéãšããŠãç®ã«èŠããªã圢ã§å瀺ãããã¹ãã§ããé£ç¶ãã空çœè¡ã¯ãããå°ãªã空çœè¡ã«çž®ããã¹ãã§ã¯ãããŸããã
ã=>ãã®2æåããå§ãŸãå šãŠã®è¡ã¯ãªã³ã¯è¡ã§ãããªã³ã¯è¡ã§ã¯ãGemtextææžããä»ã®ãªã³ã©ã€ã³ã®è³æãžãªã³ã¯ã匵ãããšãã§ããŸãããã®è³æã«ã¯ä»ã®Gemtextææžãå«ãŸããŸãããªã³ã¯è¡ã®æ§æã¯ä»¥äžã§ãã
=>[<空çœ>]<URL>[<空çœ><å©çšè ã«èŠªãã¿ããããªã³ã¯ã®åå>]
ããã§ã次ã®éãã§ãã
以äžã®äŸã¯ãå šãŠæ£åœãªãªã³ã¯è¡ã§ãã
=> gemini://example.org/ => gemini://example.org/ ãªã³ã¯ã®äžäŸ => gemini://example.org/foo åããã¹ãã«ããå¥ã®ãªã³ã¯ã®äŸ => foo/bar/baz.txt çžå¯Ÿãªã³ã¯ => gopher://example.org:70/1 gopherã®ãªã³ã¯
ãªã³ã¯è¡å ã®URLã¯ãRFC 3986ã«ãããã£ãŠãäºçŽãããæåãšç©ºçœãããŒã»ã³ãæåã§ç¬Šå·åããªããã°ãªããŸããã
ã¯ã©ã€ã¢ã³ãã§ã¯ãã¯ã©ã€ã¢ã³ãã®èè ãæãéãã®ããæ¹ã§ãªã³ã¯ã衚瀺ã§ããŸãããããã¯ã©ã€ã¢ã³ãã¯ãã¹ããŒã ããããã¯ãŒã¯ãããã³ã«ã«å¯Ÿå¿ãããªã³ã¯ã®è¡šç€ºã«ããã£ãŠããããªããããã¯ãŒã¯æ¥ç¶ãèªåã§ããŠã¯ãªããŸããã
æåã®3æåãã```ãã§ããïŒã€ãŸãå é ã«ç©ºçœãªãã3ã€ã®é£ç¶ããéåŒçšç¬ŠãããïŒä»»æã®è¡ã¯ãè¡ã®åãæ¿ããå®æœããŸãããããã®è¡ã¯ãå©çšè ã«è¡šç€ºããå瀺ãããåºåã«å«ããã¹ãã§ã¯ãããŸããããã®ä»£ãããæ§æ解æåšããéåžžã¢ãŒãããããæžåŒåæžã¿ãã¢ãŒãã«åãæ¿ããŸãã
æžåŒåæžã¿åæ¿ãè¡ã®å é ã®ã```ã以éã®ããã¹ãã¯ãã¯ã©ã€ã¢ã³ãã§ã代æ¿ããã¹ãããšè§£éããŠæ§ããŸããããã®ããã¹ãã¯åœè©²åæ¿ãè¡ä»¥éã®ãæžåŒåæžã¿ããã¹ãè¡ã«ä»éãããã®ã§ãã代æ¿ããã¹ãã®äœ¿çšã¯ã¯ã©ã€ã¢ã³ãã®è£éã«ãããåçŽãªã¯ã©ã€ã¢ã³ãã§ã¯ç¡èŠããŠæ§ããŸããã代æ¿ããã¹ãã¯ãASCIIã¢ãŒããããã«é¡ããããã¹ãã§ãªãå 容ã«ä»ããããšããå§ãããŸããäŸãã°ãç»é¢èªã¿äžãåšãéããŠå瀺ãããéã«ãæå³ã®ãããã®ãšããŠæããããããšãç¡ãããã«ããããæ€çŽ¢ãšã³ãžã³ã«ãã玢åŒãšããŠæå¹æŽ»çšãããããã«ããããšããããšã§ãã代æ¿ããã¹ãã«ããã°ã©ãã³ã°èšèªãæå®ããŠãã³ã³ãã¥ãŒã¿ã®ãœãŒã¹ã³ãŒãã«äœ¿ããçºå±çãªã¯ã©ã€ã¢ã³ãã§æ§æ圩è²ã«äœ¿ããããã«ããŠãè¯ãã§ãããã
ã#ãããå§ãŸãè¡ã¯ãèŠåºãè¡ã§ããèŠåºãè¡ã¯1ã2ã3åã®é£ç¶ããã#ãæåããæ§æãããä»»æã§ç©ºçœãç¶ãããã®åŸãã«èŠåºãã®ããã¹ããæ¥ãŸãã#æåã®æ°ã¯èŠåºãã®ãæ°Žæºãã瀺ããŸãã#è¡ã¯èŠåºãã§ããã##è¡ã¯åèŠåºãã§ããã###è¡ã¯å«èŠåºãã§ãã
èŠåºãããã¹ãã®å 容ã¯å©çšè ã«è¡šç€ºãããã¹ãã§ãããã¯ã©ã€ã¢ã³ãã¯ç¹å¥ãªæžåŒã䜿ã£ãŠæ§ããŸãããäŸãã°èŠåºãã«ãªã£ãŠããããšã瀺ãããã«ããã倧ããã£ãã倪ãã£ãããããã©ã³ãã䜿ã£ãããéãè²ã䜿ã£ãããããªã©ã§ããããããèŠåºãè¡ã®äž»çŒã®ç®çã¯è£ 食ã®ããã§ãªããæå³è«çãªãã®ã§ãããå ·äœçã«ã¯ææžã®å éšæ§é ã®ãæ©æ¢°ã§èªã¿åããè¡šçŸãæäŸããããšã§ããçºå±çãªã¯ã©ã€ã¢ã³ãã¯ãã®æ å ±ã䜿ã£ãŠãäŸãã°é·ãææžã«ã€ããŠã¯ãç»é¢èã«éå±€çã«æžåŒåããããç®æ¬¡ããèªåçã«çæããŠè¡šç€ºããŠæ§ããŸããããããããšãå©çšè ã¯ç°¡åã«ç¹å®ã®ç¯ã«é£ã¶ããšãã§ããç¡éã«ã¹ã¯ããŒã«ããã«æžã¿ãŸãããã£ã¬ã¯ããªå ã®å šãŠã®gemtextææžã®äžèŠ§ãèªåçã«çæããããŒã«ããgemtextææžã®ãã£ã¬ã¯ããªçšã®Atom/RSSãã£ãŒããäœæããããŒã«ã«ã€ããŠã¯ããã¡ã€ã«äžã®èŠåºããã人éã«ãšã£ãŠèªã¿ãããé¡åãšããŠäœ¿ããŸãã
ã* ãããå§ãŸãè¡ã¯ãªã¹ãé ç®ã§ãããã®è¡ã®çš®é¡ã¯ãçŽç²ã«è£ 食äžã®çç±ããååšããŠããŸãã*ã¯çºå±çãªã¯ã©ã€ã¢ã³ãã§ã¯ç¹ã®èšå·ã§çœ®ãæããŠãæ§ããŸãããã* ãã®åŸã®ããã¹ãã¯ãããããããã¹ãè¡ã®ããã«å©çšè ã«è¡šç€ºãããã¹ãã§ããã€ãŸããç®ã«èŠããç¯å²ã«åãŸãããã«æãè¿ãããããæããã«æžåŒåããã®ã§ããçºå±çãªã¯ã©ã€ã¢ã³ãã§ã¯ãç¹ã®èšå·ã®ç©ºçœãèæ ®ã«å ¥ããŠãé·ããªã¹ãé ç®ãæãè¿ããšãã«ããã®é ç®ã«å¯Ÿå¿ããå šãŠã®è¡ãç»é¢ç«¯ããçããè·é¢ã§éã空ãããã«ããããšãã§ããŸãã
ã>ãããå§ãŸãè¡ã¯åŒçšè¡ã§ãããã®è¡ã®çš®é¡ãååšããŠããã®ã¯ãçºå±çãªã¯ã©ã€ã¢ã³ãã§ãèªè ãè£ é£Ÿãåºå¥ã§ããããã«ããããã§ããããããã¹ãã¯å€éšã®è³æããåŒçšããããã®ã ããšãããããªãéèŠãªæå³è«çãªæ å ±ãèªè ã«äŒãããŸããäŸãã°ãé·ãè¡ãç®ã«èŠããç¯å²ã«æãè¿ããšããçµæçã«è¡šç€ºãããåè¡ã«ã¯ãåæ¹ã«ã>ãèšå·ã眮ãããŠããŠãæ§ããŸããã
ã```ãã®3æåããå§ãŸããªãè¡ã¯ããã¹ãè¡ã§ããæžåŒåæžã¿ã¢ãŒãã§ã¯ãããã¹ãè¡ã¯å©çšè ã«å¯ŸããŠãäžç«ãã«è¡šç€ºãããã¹ãã§ããäžç«ãšã¯ã空çœã®å€æŽãè£ é£Ÿçãªæ¹åãªãã«ãåºå®å¹ ãã©ã³ãã䜿ããªã©ã§ããã°ã©ãã£ã«ã«ãªã¯ã©ã€ã¢ã³ãã¯ãã¯ã©ã€ã¢ã³ãã®ç®ã«èŠããç¯å²ãããé·ãæžåŒåæžã¿ããã¹ãè¡ã®è¡šç€ºã«ã€ããŠã¯ãæãè¿ãããã¯ãç»é¢ã¹ã¯ããŒã«ã®ä»çµã¿ã䜿ãã¹ãã§ããæžåŒåæžã¿ããã¹ãè¡ã衚瀺ããäžã§ãã¯ã©ã€ã¢ã³ãã§ã¯ASCIIã¢ãŒããã³ã³ãã¥ãŒã¿ã®ãœãŒã¹ã³ãŒãã®ãããªæŽ»çšäŸã念é ã«çœ®ãã¹ãã§ããå ·äœçã«ã¯ã空çœãéèŠãªèšèªã§æžããããœãŒã¹ã³ãŒãïŒäŸãã°PythonïŒã¯ãã¯ã©ã€ã¢ã³ãã§ãã¡ã€ã«ã«åã貌ãããŠãç¹ã«åé¡ãªã解éãã³ã³ãã€ã«ãã§ããããã«ãã¹ãã§ããã¯ã©ã€ã¢ã³ãã衚瀺ããããæ¹ã§ãåé¡ãèµ·ãããªãããã«ãã¹ãã§ãã
æåã®3æåãã```ãã§ããè¡ïŒã€ãŸãå é ã«ç©ºçœã®ãªã3ã€ã®é£ç¶ãᅵᅵéåŒçšç¬ŠïŒã¯ãæžåŒåæžã¿åæ¿ãè¡ã§ãããã®è¡ã¯ãå©çšè ã«è¡šç€ºãããå瀺ãããåºåã«å«ããã¹ãã§ã¯ãããŸããããã®ä»£ãããæ§æ解æåšã¯ãæžåŒåæžã¿ã¢ãŒãããããéåžžã¢ãŒããã«åãæ¿ãããŸãã
æžåŒåæžã¿åæ¿ãè¡ã®ãå é ã®ã```ãã«ç¶ãããã¹ãã¯ãã¯ã©ã€ã¢ã³ãã§ç¡èŠããªããã°ãªããŸããã
以äžã¯gemtextææžã®æ¡åŒµBNFä»æ§ã§ãã
gemtext-document = *1gemtext-line gemtext-line = text-line / link-line / preformat-toggle gemtext-line =/ heading / list-item / quote-line link-line = "=>" *SP URI-reference [1*SP 1*(SP / VCHAR)] *SP CRLF heading = ( "#" / "##" / "###" ) text-line list-item = "*" SP text-line quote-line = ">" text-line preformat-toggle = "```" text-line text-line = *(SP / VCHAR) CRLF ; URI-reference [STD66]ãã ; ; CRLF [STD68]ãã ; SP [STD68]ãã ; VCHAR [STD68]ãã