Loading...
 
Features / Usability

Features / Usability


{code} colour options

posts: 14 England

Hello All,

Can someone please help me with the following question.

then I use the
 option (to place come onto my wiki page), I have the option to chose from a number of code types in order to help display it correctly on the pahge, e.g. html, PHP, Jave etc.


I do not see an option For PowerShell as as my blog is mainly about PowerShell this would be very useful. At the moment I am converting to HTML they uploading as HTML to get the PowerShell code to display correctly. However I would rather not have to go thought this additional step.

Is there a plugin available that will let you upload PowerShell code to a wiki page and have is display correctly?

if I just copy and paste the PowerShell code works link function are interpreted/miss-interpreted when view the page.

Thanks all
Ernie


posts: 14 England

Hi Ricks

Thanks for the reply, perhaps it will be supported in the next release/upgrade of Tiki. I am not a developer, do you know where I can post a suggested addition for tiki for developers to consider?

Thanks again
Ernie


posts: 14 England

OK sorry I understand now Rick, I will post the request over there.

Thanks again
Ernie



posts: 14 England

Thanks for the update Rick

I checked out the link there does not seem to be much in the way of instructions for this module/add-one (for want of a better word).

Do I simply need to copy the files into a particular directory/directories and upload to my existing Tiki site, or do I need to use the Add Module > Custom Module and copy and paste the code (if so html or js) into the data window?

Thanks again
Ernie


posts: 14 England

Hello All

I posted the question over at codemirror regarding the module found here

e.g. how do I implement this on my tiki site so I can insert PowerShell code on my wiki pages and it maintains the normal layout of PowerShell code (rather than miss-interpreting words like function, or without having the turn the PowerShell code into html in the first instance)

There response (which I do not fully understand, as I am new to wiki etc) is posted below. Can someone kindly help me further with this please as it would be great to be able to easily represent PowerShell code on a tiki-wiki page. Not just for me, but I am sure many others too.

Thank you all in advance

Hi Ernest,

On the CodeMirror side, simply loading a mode a setting an editors "mode" option to its name is all that's needed, but since you will want to use the Tiki language selection mechanism, I'm afraid I'm going to have to send you back to them (or to read the code) to figure out how that is done in the Tiki system.

Best,
Marijn


posts: 1542 Canada

Hi!

We moved from Geshi to CodeMirror because CodeMirror is realtime (so you can have coloring as you type) and the license permits us bundle in Tiki, instead of forcing end user to install.

Unfortunately, PowerShell is not by default in CM: http://codemirror.net/mode/index.html

I just tried this on 9.x:
http://demo.tiki.org/9x/PowerShell

I added the content of https://github.com/VapidWorx/powershell-cm-mode to lib/codemirror/mode/powershell

Seems to work. Can you try different syntax? Password is indicated on demo.tiki.org

If it works, next steps would be to get the folks behind https://github.com/VapidWorx/powershell-cm-mode to share the code to https://github.com/marijnh/CodeMirror/tree/master/mode and, then, it will be by default in Tiki.

In the mean time, you can fiddle with your local copy.

Best regards,

M ;-)


posts: 14 England

Hello, and thanks for your help so far.

I checked out the path above e.g.

lib/codemirror/mode

I do not have this path, I have a slighty path (using tikit-wiki 11.0)


lib/codemirror_tiki/mode

So I did the following
created a folder call powershell at the following location

lib/codemirror_tiki/mode/powershell

also created the folder structure

lib/codemirror/mode/powershell

I then copied the contents of
https://github.com/VapidWorx/powershell-cm-mode

to both of the above folders.

What do I need to do know please?
Do I need to go into the tiki admin control panel and approve a plugin or module for these newly copied code? if so how please?

or do I just need to use a particular syntax with the
 keyword e.g.

or



or some thing along these lines?

Thanks again, please advise

Ernie


posts: 1542 Canada
No need to approve code. I would not put powershell mode code twice. Try one place, the the other. You may need to clear cache. Usual syntax then applies as with any usage of PluginCode