The default behaviour is to have the page title highlighted in the text. The 
bot always extracts the page title in this way.
Sample:
'''Wikipedia''' is a free [[online encyclopedia]] with the aim to allow anyone 
to edit
extracts Wikipedia as page title

I proposed in T155356 to implement the opposite way if -titlestart and 
-titleend is given.
Sample:
-titlestart:::
-titleend:":: "
::Wiki:: #redirect [[Wikipedia]]
extracts Wiki as the title. In this case the -notitle option could be set to 
True by default imho. But currently you have to use -no title to exclude all 
text between  -titlestart and -titleend. Please also refer the -help doc string.

Best
Xqt

> Am 29.04.2018 um 20:00 schrieb Merlijn van Deen (valhallasw) 
> <[email protected]>:
> 
> Hi Etienne,
> 
> The -notitle flag should be able to help you do this. If you have an input 
> file like this:
> 
> {{-start-}}
> '''page title'''
> actual contents of the page
> {{-stop-}}
> {{-start-}}
> '''next page title'''
> contents
> of
> the
> next
> page
> {{-stop-}}
> 
> and then run
> 
> pwb.py pagefromfile -file:test.txt -notitle
> 
> the bot will create two pages: one named 'page title' with contents 'actual 
> contents of the page', and one named 'next page title' with several lines of 
> contents, starting with 'contents'.
> 
> Best regards,
> Merlijn
> 
> 
> 
>> On 29 April 2018 at 18:11, Etienne Ruedin <[email protected]> wrote:
>> Dear list members
>>  
>> I used pywikibot several times in the last six years for little helps on a 
>> minority language wikipedia (ln). Now, I am failling with pagefromfile.py
>>  
>> 1. What works:
>> I can log in and upload one ore more than one article with {{-start-}} and 
>> {{-stop-}}.
>>  
>> 2. What does not work
>> If the title should be something other than the first word(s) between ''' 
>> ''', I can us the -titlestart and -titleend comands.
>> I tried it in different manners , f.eg. in the txt file before or after the 
>> article text. It failed always and the ''' ''' word became the title of the 
>> article.
>> I was in contact with people from als.wikipedia. The managed it that way, 
>> that they changed it afterwards manually.
>> Question: How to use the title functions from pagefromfile.py? Is there a 
>> more detailed manual somewhere (not only the few information on mediawiki) 
>> or can someone give me a working example?
>>  
>> 3. Configuration: I create the txt files with leafpad utf-8 on ubuntu. I run 
>> python with the LXterminal on ubuntu.
>>  
>> Best regards
>> Etienne
>> 
>> _______________________________________________
>> pywikibot mailing list
>> [email protected]
>> https://lists.wikimedia.org/mailman/listinfo/pywikibot
>> 
> 
> _______________________________________________
> pywikibot mailing list
> [email protected]
> https://lists.wikimedia.org/mailman/listinfo/pywikibot
_______________________________________________
pywikibot mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot

Reply via email to