|
Cookbook /
WikiSh-TalkThis page is for discussion / feedback / input / questions / angry denunciations regarding the WikiSh recipe. (Obsolete issues have been removed. ) Is there a way to use the control panel to do a search and replace where the pattern spans more than one line? I'd like to join two lines by removing the newline from the first line: sed -vi 's/WishTheNextLineWereHereToo\n/NowItIs /g' - RandyB June 18, 2010, at 01:06 PM Not in the straightforward way you've suggested, I'm afraid. The real To accomplish this in wikish you could do something like this:
If you were pretty sure it would only occur once in the given text then a line-number-oriented solution could work as well...
Of course there should be logic in there to make sure the pattern doesn't occur on the first or last line, etc. It's a bit of a hassle, really... Probably no easy way to do it in wikish. Of course you could define your own markup expression and as long as you made use of the WikiShCompatible() (see MiscMX for examples of how this is used) then you will still have full capabilities of redirecting, taking input from pipes, etc. Does WikiSh work with a database as pagestore, e.g. SQLite? If so, can it be used to automatically move or convert all the existing flat file Wiki.d pages into the database? RandyB February 07, 2010, at 01:31 AM No, WikiSh does not know anything about SQLite. It could theoretically be another prefix (like TEXTFILE--, SESSION--, etc.) in the future, but I do not foresee that happening for a significant amount of time, if ever. Glancing through SQLite it appears that Petko has put together an experimental script to import all pages into the DB. However, the referenced page (MergeWikiLibDirs) no longer exists. I would suggest asking Petko since he's already done the development work on it... Meanwhile I've put some stub ideas there that may be helpful to you... (See MergeWikiLibDirs for the rest of the discussion.) I just noticed that I'm not sure as I have never used the httpvariables recipe. Can you describe what happens? (Note that Followup: I've now installed httpvariables and tried it out. The problem has to do with the order of rules. Both
I'll leave it up to you to report this to httpvariables author if you wish. If you see that I'm missing something and WikiSh is somehow culpable in this I'm willing to take a look at it again... As it stands I think WikiSh is "causing" the problem by doing totally "legal" things which change undefined behavior in rule ordering and so from a practical perspective is "innocent"... Prosecutor, your witness... :-) [later] Ah, I found the previous discussion for this same issue. You can see Martin's answer where he suggests my #2 suggestion as a change to httpvariables.php -- apparently this never made it into an official release of httpvariables... http://www.pmichaud.com/pipermail/pmwiki-users/2008-April/050176.html Here's where PM explained the undefined nature of the order of the rules: http://www.pmichaud.com/pipermail/pmwiki-users/2008-April/050177.html (Although he says the 1st over-rides the 2nd it appears to be the other way around in this particular context.) When I include SecLayer.php before I set SecLayer.php includes stdconfig.php for various technical reasons. For this reason SecLayer should be included late in the configuration. I will update the documentation now. Thanks for letting me know. --Peter Bowers November 20, 2009, at 01:52 AM Is WikiSh going to be capable of providing a unit-testing framework for PmWiki, for test-driven development? If so, that would be awesome! As you probably know, wikis began at Ward Cunningham's website in the 1990s as a way for programmers to share knowledge about programming patterns especially extreme programming and test driven development. Ironically, recipes to extend PmWiki are not easily tested. As a result, it's hard to make interesting recipes for PmWiki that satisfy the quality standards of major companies. I think PmWiki would get wider use and broader exposure (which would feed on itself) if automated unit testing were easier. WikiSh is primarily focused on manipulating/comparing page *source*. My understanding of unit testing is that it would need to be manipulating/comparing the final html. I use wikish to unit-test itself, but I'm not sure how broadly useful it would be to unit testing other recipes. (You could use WikiSh for populating pages with data, etc.) I'd be interested in tho'ts showing how it could be done... Or maybe just examples of desirable unit testing -- maybe I'm stuck in a rut in my thinking and not seeing it... Note that the comment "(in search of some testers to move to beta - it's solid in my scenarios but needs some whitehats))" in the recipe summary causes WikiSh to show up as a false hit on Cookbook.Searching. It would be nice if you could fix that - I'd do it myself, but as the recipe page announces that it gets overwritten regularly that fix could only be temporary. Thanks in advance! :-) --Henning August 19, 2009, at 10:43 AM; Then again, it also is categorized "Searching" so maybe it can be considered a true hit. The request for beta testers still appears out of place in the summary in my opinion. --Henning August 19, 2009, at 10:50 AM Yes, it is a very useful search tool - that's why it is in the Searching category. I've gotten rid of the "searching for ..." comment so it looks a little nicer on the Searching page -- upgraded to "Beta" at the same time since it's been a long time since I ran into any problems with WikiSh. --Peter Bowers August 19, 2009, at 11:01 AM |