Jeremy, thanks for discussion.

My conclusion: 

   1. percent-encoding is neither informative (human readable) nor elegant 
   for permalink use,
   2. percent-encoding makes serious restriction on the title length in 
   Cyrillic (about 6 times shorter than in Latin) in case of multiple static 
   file generation from TW5,
   3. a possible way out, what I personally would prefer, is in applying a 
   universal approach to permalink generation based on "title-to-slug" 
   conversion with transliteration use.
   
Meanwhile possible changes comes true many users like me would need sort of 
patch to cover the issue of "too long filename" during static multifile 
site generation.

So I'd be grateful for a concise instruction for such dummies like me of 
how to sort out the issue.

Sincerely
Olegh


субота, 19 листопада 2016 р. 19:10:48 UTC+2 користувач Jeremy Ruston 
написав:
>
> Hi Oleg
>
> I'd like to stress another point - there is a rationale in splitting the 
> generation of permalinks for tiddler by two cases:
>
>    1. for the TW environment (/#) and 
>    2. for multiple static files creation (https://goo.gl/JKjpnr).
>
> In the 2nd case conversion reprocicality is *not* necessary.
>
>
> That is true, and I’d certainly open to a fix that only worked for the 
> second case, but would much prefer an approach that we can use universally, 
> if that is possible.
>
> That is the very case where I've suggested transliteration as an option.
>
>
> It would be fairly straightforward to explore with a fork. You’d need to 
> expand the link widget to offer transliteration as one of the encoding 
> options:
>
>
> https://github.com/Jermolene/TiddlyWiki5/blob/master/core/modules/widgets/link.js#L83-L87
>
> Let me know if I can help,
>
> Best wishes
>
> Jeremy
>
> I'd be grateful for your consideration and advice.
>
> Olegh
>
> пʼятниця, 18 листопада 2016 р. 21:38:57 UTC+2 користувач Jeremy Ruston 
> написав:
>>
>> Hi Oleg
>>
>>
>> The problem is not something new. Namely, while generating a static html 
>> filename from TW5 having cyrillic titles in a result one can sort of this:
>>
>>    - 
>>    
>> http://127.0.0.1:8080/#%D0%9F%D0%BE%D1%81%D1%96%D0%B1%D0%BD%D0%B8%D0%BA%20%D0%BA%D0%BE%D1%80%D0%B8%D1%81%D1%82%D1%83%D0%B2%D0%B0%D1%87%D0%B0%20%D0%A2%D1%96%D0%B4%D0%BB%D1%96%D0%B2%D1%96%D0%BA%D1%96:%5B%5B%D0%9F%D0%BE%D1%81%D1%96%D0%B1%D0%BD%D0%B8%D0%BA%20%D0%BA%D0%BE%D1%80%D0%B8%D1%81%D1%82%D1%83%D0%B2%D0%B0%D1%87%D0%B0%20%D0%A2%D1%96%D0%B4%D0%BB%D1%96%D0%B2%D1%96%D0%BA%D1%96%5D%5D/
>>  
>>    
>> <http://www.google.com/url?q=http%3A%2F%2F127.0.0.1%3A8080%2F%23%25D0%259F%25D0%25BE%25D1%2581%25D1%2596%25D0%25B1%25D0%25BD%25D0%25B8%25D0%25BA%2520%25D0%25BA%25D0%25BE%25D1%2580%25D0%25B8%25D1%2581%25D1%2582%25D1%2583%25D0%25B2%25D0%25B0%25D1%2587%25D0%25B0%2520%25D0%25A2%25D1%2596%25D0%25B4%25D0%25BB%25D1%2596%25D0%25B2%25D1%2596%25D0%25BA%25D1%2596%3A%255B%255B%25D0%259F%25D0%25BE%25D1%2581%25D1%2596%25D0%25B1%25D0%25BD%25D0%25B8%25D0%25BA%2520%25D0%25BA%25D0%25BE%25D1%2580%25D0%25B8%25D1%2581%25D1%2582%25D1%2583%25D0%25B2%25D0%25B0%25D1%2587%25D0%25B0%2520%25D0%25A2%25D1%2596%25D0%25B4%25D0%25BB%25D1%2596%25D0%25B2%25D1%2596%25D0%25BA%25D1%2596%255D%255D%2F&sa=D&sntz=1&usg=AFQjCNFlUChehWFhbnPS9acCdPJs2JFPZw>
>>    
>> A single cyrillic letter is encoded to 6 (!) ASCII signs. Bearing in mind 
>> a typical path name length of 30-40 signs and limitation of many OS on 
>> filename length of say 255, one obtains the title length limit 
>> approximately around 35, which can be annoying.
>>
>> The point is when during static html generation the full 
>> path-and-filename length exceeds 255 the process accidently stops with 
>> error message sort of "Too long filename”.
>>
>>
>> That makes sense. TiddlyWiki5 already incorporates code to transliterate 
>> Cyrillic characters to their Latin equivalents, but it is only used within 
>> the file system adaptor for filename generation, and isn’t used for 
>> permalinks. Here’s the code:
>>
>>
>> https://github.com/Jermolene/TiddlyWiki5/blob/master/plugins/tiddlywiki/filesystem/filesystemadaptor.js#L78-L85
>>
>> Here’s the code that generates permalinks:
>>
>>
>> https://github.com/Jermolene/TiddlyWiki5/blob/master/core/modules/startup/story.js#L72-L79
>>
>> However, fixing the permalinks isn’t as simple as integrating the 
>> transliteration. The problem is that the conversion process for mapping 
>> tiddler titles needs to be bidirectional: we need to be able to recover the 
>> original, Cyrillic tiddler title from the encoded form used in the 
>> permalink.
>>
>> So, transliteration isn’t an option. It may be worth exploring whether 
>> there is a more efficient encoding mechanisms that we could use. And I 
>> guess it would be helpful to understand how other sites/apps deal with this 
>> problem, if at all.
>>
>> Best wishes
>>
>> Jeremy
>>
>>
>> I would be great to have a possibility of altering (sort of a checkbox in 
>> Settings) a static html filename encoding method in order to shorten 
>> filename length. It might be transliteration method, which, by the way, is 
>> used in generating ".tid" filenames under Node.js. Or at least altering a 
>> static html filename encoding method in JS source code.
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "TiddlyWiki" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at https://groups.google.com/group/tiddlywiki.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/tiddlywiki/2bd639e4-56a7-4ffd-b273-840f8befb638%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/tiddlywiki/2bd639e4-56a7-4ffd-b273-840f8befb638%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "TiddlyWiki" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] <javascript:>.
> To post to this group, send email to [email protected] 
> <javascript:>.
> Visit this group at https://groups.google.com/group/tiddlywiki.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/tiddlywiki/cbf0f7f9-e6b1-4193-a6e5-39547494353b%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/tiddlywiki/cbf0f7f9-e6b1-4193-a6e5-39547494353b%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/47321888-3b50-40d8-832c-fc20d21007c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to