gnosygnu / xowa

xowa offline wiki application
Other
375 stars 41 forks source link

Xtn.Page: Do not show missing pages in subpages bread-crumb trail (also, proper-case titles) (subtitle breadcrumb) #626

Open desb42 opened 4 years ago

desb42 commented 4 years ago

when looking at fr.wikisource.org/wiki/La_Petite_Dorrit/Tome_1/Préface for #624 I noticed a difference in the subtitle breadcrumbs xowa: subt1 mediawiki: subt2

a rather more substantial effect is the page en.wikipedia.org/wiki/Module:Sandbox/KleptomaniacViolet/Language_families/Data/Je–Tupi–Carib_languages/alpha/0 xowa: subt3 mediawiki: subt4

I believe that this is due to the existence (or not) of the intermediate subdirectories

I have tracked down the java responsible in Xoh_subpages_bldr.java

Attached is my attempt at a solution Xoh_subpages_bldr.zip

However, there is one issue outstanding with my logic In the above wikipedia link, if that request is changed to en.wikipedia.org/wiki/module:Sandbox/KleptomaniacViolet/Language_families/Data/Je–Tupi–Carib_languages/alpha/0 That is, a lowercase 'm' for 'module' The links (and text) show up as module:, it should be Module: This is due to the fact that the string being used is ttl.Raw() I am not certain which method/function of class Xoa_ttl will provide the appropriate text

gnosygnu commented 4 years ago

Hey, thanks for the commit! I incorporated it into the patch above. I added a bunch of comments and renamed some variables, but it's essentially the same as yours.

One minor reply to the comment below. Otherwise, let me know if anything else. Thanks!


This is due to the fact that the string being used is ttl.Raw() I am not certain which method/function of class Xoa_ttl will provide the appropriate text

Xoa_ttl has a bunch of helper methods (which aren't part of MW). In this case, you want .Full_txt. The abbreviations are cryptic, but here are the significant ones

There are also corresponding modifiers

desb42 commented 4 years ago

I have just rebuilt xowa using xowa_get_and_make.sh and the second example gives subt5

which is not correct

gnosygnu commented 4 years ago

Sorry about that. Should have checked the second example

Fixed with the above commits. More details below.

Thanks for spotting my oversight!


The 1st commit has 2 changes:

Meanwhile 2nd commit has a trivial refactoring to rename one of the methods to "Full_ttl"

Tested with the links below

fr.wikisource.org/wiki/La_Petite_Dorrit/Tome_1/Préface
en.wikipedia.org/wiki/module:Sandbox/KleptomaniacViolet/Language_families/Data/Je–Tupi–Carib_languages/alpha/0
en.wikisource.org/wiki/Les_Misérables/Volume_1/Book_First/Chapter_1
en.wikisource.org/wiki/A_Critical_Examination_of_Dr_G._Birkbeck_Hills_"Johnsonian"_Editions/The_Preface_and_Dedication
desb42 commented 4 years ago

Meanwhile 2nd commit has a trivial refactoring to rename one of the methods to "Full_ttl"

The commit refers to Full_ttl but the coding change is Full_txt - is that intended?

gnosygnu commented 4 years ago

The commit refers to Full_ttl but the coding change is Full_txt - is that intended?

Oops. Amended commit message. Thanks!

desb42 commented 3 years ago

Found another issue fr.wikisource.org/wiki/Wikisource_:_Projet_Québec/Canada/Entête

First note the extra 'spaces' around the colon - which will be the subject of another issue

subtitle1 Note the | pipe character

For this issue, fr.wikisource.org/wiki/Wikisource:Projet_Québec does not exist Because it unexpectedly does not exist, the code is getting confused

A fix is Xoh_subpages_bldr.zip