Re: [Zim-wiki] URLs without domain do not get auto-hyperlinked

2021-06-26 Thread Jaap Karssenberg
Fixed in commit 010fd9 on the development branch.

Staying as close as possible to the GFM spec, if anything because it
specifies how to deal with brackets and corner cases. Also wanting to be
future compatible with MarkDown - it is still on my list :)

Regards,

Jaap


On Mon, May 17, 2021 at 4:19 PM Chuck Esterbrook 
wrote:

> Recognizing http://foo/bar/ isn't "lax", it's literally correct:
>
> https://www.w3.org/Addressing/URL/url-spec.txt
>
> Also, the context between GitHub and Zim Wiki is different (coding for
> what are often public projects vs. note taking).
>
> Furthermore, Zim Wiki syntax isn't markdown-based so I don't see any
> Markdown flavor as authoritative for Zim.
>
> I think 0.68 got it right.
>
> - Chuck
>
>
> On Wed, May 5, 2021 at 1:07 AM Jaap Karssenberg <
> jaap.karssenb...@gmail.com> wrote:
>
>> I think a fix could be implemented by making paste of a URL a special
>> case. What is happening here is that the URL is probably pasted as text
>> (you can check debug output to make sure) and therefore parsed using the
>> wiki syntax. If the URL were pasted as an URL data type it would always be
>> formatted as a link. Therefore we could make the copy-paste code use a more
>> lax URL regex and if pasted text looks like an URL, apply the same logic as
>> for the URL data type.
>>
>> Would not like to make the wiki syntax more lax, and it doesn't need to
>> be if the copy-paste logic properly understands the content as a link.
>>
>> Regards,
>>
>> Jaap
>>
>> On Tue, May 4, 2021 at 8:20 PM Steve Chadsey  wrote:
>>
>>> Hi Jaap,
>>>
>>> Thanks for the explanation. I understand that having a spec to follow
>>> can simplify things at the application code level. But for an end user like
>>> me, it does not provide any benefit and in fact the application is more
>>> tedious to use because of it. A good 60-75% of the URLs I paste into zim
>>> are copied from the browser's URL bar for an internal work-related website
>>> that never has a domain name in the URL. So, what was an automatic process
>>> of hyperlinking in v0.68 now takes extra steps. I would understand it more
>>> if it were some non standard scheme or something like that, but "
>>> https://site/path; seems a pretty common URL pattern for intranets.
>>>
>>> Would there be any chance that the URL matching could be expanded for
>>> this case in a future release? Or, if this behavior could be modified via a
>>> plugin, I could look into writing one.
>>>
>>> Thanks,
>>> -Steve
>>>
>>> On Thu, Apr 22, 2021 at 2:23 PM Jaap Karssenberg <
>>> jaap.karssenb...@gmail.com> wrote:
>>>
 Yes, this is intentional. Followed the Github Flavored Markdown spec on
 how to match valid URLs. Want to avoid too lax matching. You can still turn
 those URLs into links using Ctrl-L.

 Regards,

 Jaap

 On Thu, Apr 22, 2021 at 6:05 PM Steve Chadsey 
 wrote:

> Hello,
>
> zim version0.73.5-t202104131839~ubuntu18.04.1 on Ubuntu 18.04.5 LTS,
> 4.15.0-140-generic, x86_64
>
> I've just updated from 0.68~rc1-2 to the above version. I have noticed
> that when I paste URLs that contain only a hostname (e.g.,
> https://site/path) into a page, they don't get auto-hyperlinked. When
> the hostname is fully qualified, the URLs do get auto-hyperlinked. Is this
> a known issue? Both URL types would get auto-hyperlinked in the 0.68
> version.
>
> Steps to reproduce:
> 1. Paste or type a URL into a zim page
> 2. Hit  or ctrl-R to refresh
>
> Test cases:
> Failing:
> http://site
> http://site/
> http://site/path
> https://site
> https://site/
> https://site/path
>
> Passing:
> http://site.test
> http://site.test/
> http://site.test/path
> https://site.test
> https://site.test/
> https://site.test/path
>
> Thanks,
> --
> Steve Chadsey 
> ___
> Mailing list: https://launchpad.net/~zim-wiki
> Post to : zim-wiki@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~zim-wiki
> More help   : https://help.launchpad.net/ListHelp
>

>>>
>>> --
>>> Steve Chadsey 
>>>
>> ___
>> Mailing list: https://launchpad.net/~zim-wiki
>> Post to : zim-wiki@lists.launchpad.net
>> Unsubscribe : https://launchpad.net/~zim-wiki
>> More help   : https://help.launchpad.net/ListHelp
>>
>
___
Mailing list: https://launchpad.net/~zim-wiki
Post to : zim-wiki@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zim-wiki
More help   : https://help.launchpad.net/ListHelp


Re: [Zim-wiki] Making indexing optional ?

2021-06-26 Thread Jaap Karssenberg
Hi Mario,

Just pushed a fix (29bdea) that improves how we check whether files are a
zim page or not. Now max 50 characters are being read at the start of the
file when indexing. If your large files are not "line based" (thus
resulting in a very long read when trying to read the first line) this
should fix the issue.

Regards,

Jaap


On Sat, Apr 24, 2021 at 10:06 AM Mario Bezzi <
subscriptions.mario.be...@gmail.com> wrote:

> Hi Jaap, thank you for your help on this.
>
> To give you some more details: Of the 3000+ files which size sums up to
> 2GB, the top 500 account for 1.6GB. Among these the average size is 3.5MB,
> and each of the top three is in the 250MB range.
>
> Please let me know if there is anything I can do to help testing your fix,
> mario
>
> On 4/23/21 2:55 PM, Jaap Karssenberg wrote:
>
> Hi Mario,
>
> That is not the result I hoped for :(   I will need to generate some
> random large text files to test & debug on my end.
>
> Regards,
>
> Jaap
>
>
> On Fri, Apr 23, 2021 at 12:59 PM Mario Bezzi <
> subscriptions.mario.be...@gmail.com> wrote:
>
>> I think I submitted my request circa 2014 under the previous bug tracking
>> system - was it hosted by Ubuntu-one? - but yes, the idea is similar.
>>
>> I just downloaded the development version, extracted it into a temporary
>> folder, and ran it via the ./zim.py command.
>>
>> Indexing took some 15 minutes. Below a snapshot of what top was saying
>> about the execution.
>>
>> top - 12:45:28 up 3 days, 16:12,  1 user,  load average: 1.87, 1.92, 2.48
>> Tasks: 356 total,   3 running, 353 sleeping,   0 stopped,   0 zombie
>> %Cpu(s): 13.0 us,  5.4 sy,  0.0 ni, 81.6 id,  0.0 wa,  0.0 hi,  0.0 si,
>> 0.0 st
>> MiB Mem :  31658.1 total,320.9 free,  19312.0 used,  12025.3
>> buff/cache
>> MiB Swap:976.0 total,  0.0 free,976.0 used.  10085.6 avail
>> Mem
>>
>> PID USER  PR  NIVIRTRESSHR S  %CPU  %MEM TIME+
>> COMMAND
>>
>>  159310 mario_b+  20   0  771220  80184  43420 R 100.0   0.2  *14:42.13
>> zim.py*
>>
>> Please let me know if there is more I can do.
>>
>> Thank you,
>> mario
>>
>> On 4/23/21 11:25 AM, Jaap Karssenberg wrote:
>>
>> Yes that explains, those large files will have a big impact on the
>> indexer.
>>
>> You are referring to this issue: Make indexer ignore text files that are
>> not zim pages · Issue #907 · zim-desktop-wiki/zim-desktop-wiki (github.com)
>>  which
>> is fixed in the development branch and will be in the next release.
>>
>> With that fix the indexer will read the first line of each file to decide
>> whether it is a zim file or not, and if not it will not try to access the
>> contents.
>>
>> Would be great if you have a chance to test the development branch and
>> see whether it works in practice for your case !
>>
>> -- Jaap
>>
>>
>> On Thu, Apr 22, 2021 at 7:32 PM Mario Bezzi <
>> subscriptions.mario.be...@gmail.com> wrote:
>>
>>> The folder contains 3118 ".txt" files, for a total of 2GB of data. Some
>>> large txt files are attachments. A long time ago I submitted a request to
>>> avoid indexing these. Not sure it has been fulfilled though.
>>>
>>> Thank you,
>>> mario
>>>
>>> On 4/8/21 7:32 PM, Jaap Karssenberg wrote:
>>>
>>> Can you indicate how big your notebook folder is? Either an extreme
>>> case, or some bug making it take much longer than needed.
>>>
>>> Op do 8 apr. 2021 15:59 schreef Mario Bezzi <
>>> subscriptions.mario.be...@gmail.com>:
>>>
 Thanks Jaap, I was not aware of this.

 To give you an idea, I just restarted Zim, and indexing kept a
 processor 100% busy for 13 minutes to come to an end.  It was nice if this
 could be avoided.

 Thank you,
 mario

 On 4/8/21 10:06 AM, Jaap Karssenberg wrote:

 The indexing is not used for searching alone, it is also needed to e.g.
 present the page tree in the side pane and to track links

 Op do 8 apr. 2021 09:34 schreef Mario Bezzi <
 subscriptions.mario.be...@gmail.com>:

> Hello,
>
> I may be the only one, but with my quite large notebooks I do find the
> search function impractical, and for this reason I never use it.
> Still,
> when it starts, Zim goes crazy for a long time indexing, and I came to
> the conclusion that this is normal.
>
> If this is the case, I would like to file a requirement to add the
> ability to make indexing optional.
>
> Thank you,
> mario
>
> ___
> Mailing list: https://launchpad.net/~zim-wiki
> Post to : zim-wiki@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~zim-wiki
> More help   : https://help.launchpad.net/ListHelp
>


>>>
>>
>
___
Mailing list: https://launchpad.net/~zim-wiki
Post to : zim-wiki@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zim-wiki
More help  

Re: [Zim-wiki] notebooks open in read-only mode

2021-06-26 Thread Jaap Karssenberg
That probably means the file and folder permissions are not set correctly.

Regards,

Jaap

Op za 26 jun. 2021 07:51 schreef rot3 :

> Hello,
>
> All of my notebooks open in read-only mode. I checked: *View --> Notebook
> Editable* and it is set in read-only mode *without* being able to switch
> to editable. I also uninstalled and reinstalled zim but no luck. I use Zim
> 0.73.5 in Kubuntu 18.04.
>
> Thanks,
>
> Antonis
> ___
> Mailing list: https://launchpad.net/~zim-wiki
> Post to : zim-wiki@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~zim-wiki
> More help   : https://help.launchpad.net/ListHelp
>
___
Mailing list: https://launchpad.net/~zim-wiki
Post to : zim-wiki@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zim-wiki
More help   : https://help.launchpad.net/ListHelp