Not logged in. · Lost password · Register
Forum: General Help and Support Syntax and Usage RSS
How to Indent without creating a Code Block
Avatar
rogerjames #1
Member for 3 months · 15 posts
Group memberships: Members
Show profile · Link to this post
Subject: How to Indent without creating a Code Block
Is there a plugin for 2018-04-22 "Greebo" that will allow tabs, indents, non-breaking spaces, ect? I have a Word Visual Basic macro that converts the word documents into a wiki document and uploads them to my server. The problem is a lot of these documents has indent/tabs and extra spaces for aligning things in the documents so when you open the document in dokuwiki it ends up a lot of code blocks because of the indent/tabs and extra spaces.

So I was hoping if any one knows if there is a plugin that is compatible with 2018-04-22 "Greebo" that will allow for tabs, indents, non-breaking spaces or if there is something that can be edit to allow this?

I would hate to have to go into each document and edit every document to try to remove code blocks or add something to every document so it does not put code blocks all over the document because I have over 1000 word documents that I have to convert and that would be very long time to do this and would be very time consuming.

So if some one knows a way around this or a plugin or how to get it to work so you can have tabs, extra non-breaking spaces in your text file and not have it convert a ton of code blocks please let me know. I would be very grateful. Thanks in advance.
Avatar
LarsDW223 #2
Member since Sep 2014 · 398 posts · Location: Paderborn
Group memberships: Members
Show profile · Link to this post
Have a look at the wrap plugin, see https://www.dokuwiki.org/plugin:wrap.
Avatar
rogerjames #3
Member for 3 months · 15 posts
Group memberships: Members
Show profile · Link to this post
I have that plugin but it does not seem to help any. Is that not something you have to add <wrap> every where you have a indent, tab, extra non-breaking spaces? Because that would mean I would have to go in and add that to over 1000 documents. Thanks for your reply.
Avatar
LarsDW223 #4
Member since Sep 2014 · 398 posts · Location: Paderborn
Group memberships: Members
Show profile · Link to this post
Sorry, I haven't read carefully enough. Yes, with the wrap plugin you would need to insert wrap syntax tags all across your pages.
Avatar
rogerjames #5
Member for 3 months · 15 posts
Group memberships: Members
Show profile · Link to this post
Is there any other way to allow non-breaking spaces, tabs, indents with out having to go into every document/text file to add that wrap line in the document/text file? Having to do this to over 1000 documents would be very time consuming. Like can we add that some where so it does it automatic or something? Sorry I am not great with some of this stuff so any help would be appreciated. Thanks for the reply.
Avatar
pop #6
Member since Nov 2016 · 123 posts
Group memberships: Members
Show profile · Link to this post
I don't think there's much you can do once the files are in the wiki.

I would suggest to look at first at the visual basic script which does the conversion. Can't you change it to avoid leading spaces at all?

Secondly, there are text editors which are quite good at this sort of things. I recently detected Bluefish, a text editor which lets specify search and replace operations with Regular Expressions and which can apply the same set of changes to a great number of files at the same time. It's blindingly fast, and I used it to remove false line breaks and hyphenations to sets of fifty files at a time.

I would think that this kind of editor might be useful to either correct the wrong markup or to insert markup such as the wrap tags.
Avatar
rogerjames #7
Member for 3 months · 15 posts
Group memberships: Members
Show profile · Link to this post
I am using the Word2DokuWiki macro. I had a programmer end up fixing a lot of the issues with the macro with images, formatting, and a lot of other things and got it to upload the text and images to the server and got the rest of it working great.

The problem is, a lot of these documents has tab/indent and some times there are 2 tabs or 2 indents and when the macro uploads the text files and you load the page on the dokuwiki it ends up having these tabs/indents in a code block. So not sure how to have the macro fix this or add something so it does not load the code blocks. Hope this all makes sense. Any suggestions would be appreciated.
Avatar
pop #8
Member since Nov 2016 · 123 posts
Group memberships: Members
Show profile · Link to this post
It is part of the Dokuwiki syntax that any line beginning with spaces is rendered as a block of code. Hence, it would be best if you could ask the programmer who fixed the Word2DokuWiki macro to fix this as well.  Leading spaces in a line should, therefore, be translated into something else.

However, you should first decide what the macro is to do in this case.

You could simply drop all the leading spaces. This would cause your text to look like all the other text.

Or you could decide and indent the text starting with spaces. In this case, the Word2DokuWiki macro should wrap either each line or each group of lines with the same number of spaces in front into "<WRAP indent> .... </WRAP>
Avatar
turnermm (Moderator) #9
Member since Oct 2009 · 4629 posts · Location: Canada
Group memberships: Global Moderators, Members, Super Mods
Show profile · Link to this post
In reply to post #7
You might be able to use the batchedit plugin.  It would need someone who is familiar with regular expressions.
https://www.dokuwiki.org/plugin:batchedit
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
Avatar
rogerjames #10
Member for 3 months · 15 posts
Group memberships: Members
Show profile · Link to this post
So, any one know how the <wrap> command works with all the different <wrap> syntax? I tried searching online and there really is not much details on this.

So if I want to add 2 spaces I can add <wrap>text</wrap> ?

So if I want to add 3 space I can add <wrap>text</wrap> ?

So if I want to add a tab I can add <wrap indent>text</wrap> ?

So if I want to add 2 tabs I can add <wrap indent><wrap indent> text </wrap indent> ?

Would this how I would use the <wrap> commands? Or is there better <wrap> commands to use? Thanks for all the replies.
Avatar
turnermm (Moderator) #11
Member since Oct 2009 · 4629 posts · Location: Canada
Group memberships: Global Moderators, Members, Super Mods
Show profile · Link to this post
There is a plugin that inserts &nbsp; characters, and it also suggests using instead the conf/entities.local.conf file (create if it doesn't exist) to create an entity for replacement.  That sounds to me the simplest.
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2019-05-25, 19:26:44 (UTC +02:00)