ðŸ Archived View for geminiprotocol.net ⺠docs ⺠ja ⺠gemtext-specification.gmi captured on 2024-06-16 at 12:50:08. Gemini links have been rewritten to link to archived content
â¬ ïž Previous capture (2024-03-21)
â¡ïž Next capture (2024-07-08)
-=-=-=-=-=-=-
èš»èšïŒäœæ¥äžã§ããæçµçã«åºãŸããŸã§å ¬åŒã®ä»æ§ã§ã¯ãããŸãããå ¬åŒã®ãã®ã¯ä»¥äžã®å¥ã®å Žæã«ãããŸãã
çŸåšã®å ¬åŒãã€èŠç¯çãªGeminiã®ä»æ§
æ¬ææžã¯ãgemtextããã€ããŒããã¹ã圢åŒãæå®ããŸããGemtextã¯Geminiãã¡ã€ã«è»¢éãããã³ã«ã®ãçæ¥ã®ãå¿ç圢åŒãšããŠãµãŒããŒããéãããããšãç®çãšããŠããŸããHTMLãHTTP [RFC7230]ã®çæ¥ã®å¿ç圢åŒã§ããããšãšåæ§ã§ãããã ãçžå¿ãããã®ã§ããã°ä»ã®ç®çã§ãå©çšã§ããŸããGemtextã¯æªç»é²ã®MIMEçš®å¥text/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/ ãªã³ã¯ã®äžäŸ An example link => gemini://example.org/foo åããã¹ãã«ããå¥ã®ãªã³ã¯ã®äŸ => foo/bar/baz.txt çžå¯Ÿãªã³ã¯ => gopher://example.org:70/1 gopherã®ãªã³ã¯
ãªã³ã¯è¡å ã®URLã¯RFC 3986ã«ãããã£ãŠäºçŽãããæåãšç©ºçœã¯ããŒã»ã³ãæåã§ç¬Šå·åãããªããã°ãªããŸããã
ã¯ã©ã€ã¢ã³ãã¯ã¯ã©ã€ã¢ã³ãã®èè ãæãéãã®ããæ¹ã§ãªã³ã¯ã衚瀺ã§ããŸãããããã¯ã©ã€ã¢ã³ãã¯ã¹ããŒã ããããã¯ãŒã¯ãããã³ã«ã«å¯Ÿå¿ãããªã³ã¯ïŒäŸãã°gemini://ãgopher://ãhttps://ãftp://ãªã©ããå§ãŸããªã³ã¯ïŒã®è¡šç€ºã«ããã£ãŠãããªãèªåçãªãããã¯ãŒã¯æ¥ç¶ãããŠã¯ãªããŸããã
æåã®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]ãã