Not logged in. · Lost password · Register
Page:  1  2  3 ... 11  12  13  next 

All posts by MartinR (190)

topic: Import table from Wikipedia?  in the forum: General Help and Support Syntax and Usage
Avatar
MartinR #1
Member since Jul 2015 · 190 posts · Location: UK
Group memberships: Members
Show profile · Link to this post
You might be able to use a simple AWK script.  Assuming your table is laid out like:
{| class="wikitable"
|-
! Years       !! Name !! Alternative spellings !! Notes !! References
|-
| 1083 – ?    || Ordouvin         || Ordowinus || Possible first Prior before Ernulph || {{harvtxt|Hastead|1798}}
|-
|      – 1150 || Walter Boxley         || Philips || Boxley took his family name of Philips after the dissolution. || {{harvtxt|Hastead|1798}}
|}
You need to:
  • Drop the lines starting "{|" and "|}".
  • Drop lines with just a "|-"
  • Convert "!" at the start of a line to "^"
  • Convert "!!" to "^", likewise "||" to "|"
  • Add a "|" to the end of each line (including the title, it doesn't matter at the end of a line".

Something along the lines of (this is untested):
/{|/ {next}
/|}/ {next}
/|-/ {next}
/^!/ {$0 = "^" substr( $0, 2 )}
{
    gsub( /!!/, "^" )
    gsub( /||/, "|" )
    printf( "%s  |\n", $0 )
}
topic: Sortable tables and tablecalc  in the forum: General Help and Support General Stuff
Avatar
MartinR #2
Member since Jul 2015 · 190 posts · Location: UK
Group memberships: Members
Show profile · Link to this post
Subject: Sortable tables and tablecalc
I'm working on a small workshop project that involves a series of sizes in imperial and metric.  I need them to be strictly sortable, so will be converting the imperial into the metric column.  The whole table is wrapped in <sortable> tags.  Now being a lazy man at heart, I added in https://www.dokuwiki.org/plugin%3Atablecalc and set the blanks in the metric column to =round(25.4*cell(0,row()),1).  To make life really easy I also set up bureaucracy and pagemod to write the lines for me, using pipe syntax for the default:
@@Cmm|~~=round(25.4*cell(0,row()),1)~~@@

Now I started to get worried.  A hundred or two rows with up to three calculations per row to be parsed and performed each time the page is displayed!  For that matter, does hitting the sorting tabs cause a recalculation?  I've honestly no idea how much of a load that might be, I'm still at the development stage.  Does anyone have any ideas?

I have also had a play with either an inline or file-based CSV solution, but I don't think that gains me anything.

I did consider using a spreadsheet, but it requires something at the client side to interpret the .ods file, which I can't guarantee.
topic: Bureaucracy and debugging  in the forum: General Help and Support Features and Functionality
Avatar
MartinR #3
Member since Jul 2015 · 190 posts · Location: UK
Group memberships: Members
Show profile · Link to this post
In reply to post ID 68785
Right, that's one problem solved: PHP 5.4.16 (cli) (built: Nov  1 2019 16:04:20)  I run CentOS and my main machine is on CentOS 7.7.1908.  I have a virtual machine for test purposes running PHP 7.2.11 (cli) (built: Oct  9 2018 15:09:36) ( NTS ) so I'll try development there.

That sorts out why bureaucracy is having problems, any ideas on getting debuggin to work?

Thanks
topic: Bureaucracy and debugging  in the forum: General Help and Support Features and Functionality
Avatar
MartinR #4
Member since Jul 2015 · 190 posts · Location: UK
Group memberships: Members
Show profile · Link to this post
In reply to post ID 68608
Bump?
topic: Install permission error  in the forum: General Help and Support Installation and Configuration
Avatar
MartinR #5
Member since Jul 2015 · 190 posts · Location: UK
Group memberships: Members
Show profile · Link to this post
In reply to post ID 68692
Good point.  In Admin > Configuration I have "Directory for saving data:" /home/dokuwiki/data/ and not /home/dokuwiki/data/pages.  If the OP has ./data/pages then DW may be attempting to access ./data/pages/pages
topic: Install permission error  in the forum: General Help and Support Installation and Configuration
Avatar
MartinR #6
Member since Jul 2015 · 190 posts · Location: UK
Group memberships: Members
Show profile · Link to this post
In reply to post ID 68681
Just a quick thought - is this the dreaded SELinux catching you?

My data/pages is set to rwxrwxr-x. 10 apache apache     4096 May 23  2019 pages
topic: Replace a word on all DW pages  in the forum: General Help and Support Features and Functionality
Avatar
MartinR #7
Member since Jul 2015 · 190 posts · Location: UK
Group memberships: Members
Show profile · Link to this post
In reply to post ID 68631
Neat!  (@Birdy, note the warning under Page lookup about index updates.)
topic: Replace a word on all DW pages  in the forum: General Help and Support Features and Functionality
Avatar
MartinR #8
Member since Jul 2015 · 190 posts · Location: UK
Group memberships: Members
Show profile · Link to this post
In reply to post ID 68629
Run a sed recipe or awk script over all the relevant pages.  Something like (and this is untested):

$ find pages -name \*.txt | while read fname
do
  mv $fname ${fname.old}
  awk '{ gsub(/ship/, "Boat"); print }' < ${fname.old} > $fname
done
You'll need to remove the .old files later once you are happy with the changes.
topic: Bureaucracy and debugging  in the forum: General Help and Support Features and Functionality
Avatar
MartinR #9
Member since Jul 2015 · 190 posts · Location: UK
Group memberships: Members
Show profile · Link to this post
Subject: Bureaucracy and debugging
I'm trying to get an action script to run in bureaucracy and am having problems with both bureaucracy and debugging.

I copied the example from https://www.dokuwiki.org/plugin:bureaucracy#script_mode and put it in /var/www/html/dokuwiki/conf/plugin/bureaucracy/example.php.  Mode is 750, owner apache:apache, SELinux is Permissive.

I then added the example lines into my playground.  I see the box containing the textbox and the submission button.  When I write something and press the button I get a partial screen (Welcome notice and "you are here" line) but nothing else.

I have tried the following:
  • Adding ~~NOCACHE~~ to the page
  • Turned on ALLOWDEBUG in the configuration manager
  • Tried &do=debug and &httpdebug on the URL

I see nothing in the cache directory (or indeed anywhere else in the DW tree) resembling a debug log.  In the third case above I see lots of debugging information (but no error statement) displayed on the screen, not what I was expecting but probably correct.

I then turned to DW's accounting/audit log, but there was nothing of relevance.  Going to /var/log/httpd the access log has:
::1 - - [15/Mar/2020:15:09:00 +0000] "POST /dokuwiki/doku.php?id=playground:playground HTTP/1.1" 200 4273 "http://localhost/dokuwiki/doku.php?id=playground:playground" "Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0"
and the error log has:
[Sun Mar 15 15:09:00.592196 2020] [:error] [pid 31360] [client ::1:60242] PHP Parse error:  syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /var/www/html/dokuwiki/lib/plugins/bureaucracy/helper/actionscript.php on line 45, referer: http://localhost/dokuwiki/doku.php?id=playground:playground

I looked at line 45 of /var/www/html/dokuwiki/lib/plugins/bureaucracy/helper/actionscript.php and it contains
if (!is_a($handler, dokuwiki\plugin\bureaucracy\interfaces\bureaucracy_handler_interface::class)) {
so the error report makes some sense.

To sum up:
1) Is there a bug in bureaucracy that is stopping it from handling action scripts?
2) Is the documented example at fault?
3) How on earth do you get DW to give meaningful debug messages/log entries?

Thanks.
topic: How is Dokuwiki pronounced?  in the forum: General Help and Support General Stuff
Avatar
MartinR #10
Member since Jul 2015 · 190 posts · Location: UK
Group memberships: Members
Show profile · Link to this post
In reply to post ID 68590
I'd assume Document Wiki = Dokuwiki, so would pronounce it as "Docu" + "Wiki".
topic: Hi from New England in the US (Database of Drag Racing in the Northeast US)  in the forum: Community User Introductions
Avatar
MartinR #11
Member since Jul 2015 · 190 posts · Location: UK
Group memberships: Members
Show profile · Link to this post
In reply to post ID 68586
Just a couple of suggestions based on your description.

1) Use namespaces to separate fixed business pages from the Wiki ones - you don't want some vandal to ruin your company's image.
2) Once you have separated the namespaces, use the ACL management function to lock down your company stuff tight.

In my previous job I ran a Wiki for system management and used the Vector skin.  It looks more like Wikipedia (which users are familiar with) and has the talk/discussion page facility.  Users were given create access to the talk namespace (so that they could start discussions) but only read to the main pages.  I did not want carefully designed explanations and policy being modified without my knowledge!

If you want users to be able to contribute to actual pages then use a separate namespace again.

  • (top level) - protected, typically just your start page.
    • (company) - protected.  This is where you sell yourself.
    • (community) discussion pages
  • (talk top level) - nothing
    • (company talk) - open, any feedback on the company stuff.
    • (community talk) - talk about community pages.

HTH, regards, Martin
topic: Spam Alerts  in the forum: Offtopic Forum Help
Avatar
MartinR #12
Member since Jul 2015 · 190 posts · Location: UK
Group memberships: Members
Show profile · Link to this post
In reply to post ID 67991
https://forum.dokuwiki.org/thread/17567
topic: Automatic ACL for first page in namespace  in the forum: General Help and Support Syntax and Usage
Avatar
MartinR #13
Member since Jul 2015 · 190 posts · Location: UK
Group memberships: Members
Show profile · Link to this post
In reply to post ID 68489
Is it possible to automatically set the ACL for the first page in a new namespace
I'm not aware that this could be done automatically.

The start page should be visible to all.  The other pages will have their ACL set according to who should see them.
You need to set an ACE for the directory and another for the start page.  When access is considered and ACE on the start page will trump over the directory's (namespace's) ACL.

Or would it be easier to have all the "start" pages in their own namespace with links through to a per document name space?
I suspect that this will be much easier to maintain.

Can ACLs automatically be set on a page when they are created ?
This is a repeat of the first point.  You could set up a simple script to do this for you but otherwise the pages will be within the namespace and use the appropriate ACL.
topic: is it possible to connect dokuwiki with sphinx?  in the forum: General Help and Support Server Setup
Avatar
MartinR #14
Member since Jul 2015 · 190 posts · Location: UK
Group memberships: Members
Show profile · Link to this post
In reply to post ID 68344
Thanks Turner, I'd looked through the extensions for "restructured" and found nothing.  I would like to draw your attention though to the revision date (2015-10-07) and the note about a bug: "Appears to be broken with 2018-04-22b “Greebo” release. The <rst></rst> block doesn't generate an error but text in the block isn't rendered".
topic: is it possible to connect dokuwiki with sphinx?  in the forum: General Help and Support Server Setup
Avatar
MartinR #15
Member since Jul 2015 · 190 posts · Location: UK
Group memberships: Members
Show profile · Link to this post
In reply to post ID 68340
Just for interest I've been copying the examples from the restructuredtext primer into my playground.  The results are not pretty, see the attached. As far as I'm aware DW only understands DW markup unless a suitable extension can be found.  You might be able to use [[https://www.dokuwiki.org/plugin:mdpage]] but I've no experience of using it.

Edit: The board doesn't seem to accept PDFs.
Close Smaller – Larger + Reply to this post:
Special characters:
Page:  1  2  3 ... 11  12  13  next 
Special queries
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2020-04-04, 11:20:33 (UTC +02:00)