Jump to content




[Editor] WYSIwrite


21 replies to this topic

#1 nitrogenfingers

    Lua Professor

  • Members
  • 551 posts
  • LocationAustralia

Posted 11 February 2015 - 11:41 AM

Posted Image

Stable: http://pastebin.com/3MqtuS9P

Latest: http://pastebin.com/RSyhCjqv


What is it: WYSIwrite is a text editor for computercraft specifically designed for writing documents that will be printed out. It is a WYSIWYG editor in a similar style to Microsoft Word, Libre Office and other document writing programs; the way your document looks in the program is almost identical to how it will appear when it is printed out. WYSIwrite is deliberately feature-light and simple to use, and is aimed at those using computercraft on a server or to share with friends to get a little more utility and ease of use out of printers.

WYSIwrite is supported on advanced computers and, surprisingly, advanced pocket computers.

Screenshots:
Spoiler

Usage: The pastebin link above contains the standalone executable.
As this program is sort of designed as a companion to other programs, I've included it in a resource pack and a treasure disk, links for which I've included here:

Resource pack: http://www.mediafire...iteResource.zip
Treasure disk: https://www.mediafir...urccdd99z29c7wx

Beyond that, the code is free for repurposing and modification, such as the paginateOverflow and paginateUnderflow functions that can be used in your own programs to format your text to fit neatly into a window or page. But it's pretty messy, and I expect you could write a cleaner and more efficient function with a bit of elbow grease.

Comments and bug reports always welcome as messages or in the comments.
-NF

Edited by nitrogenfingers, 14 April 2015 - 12:23 PM.


#2 InDieTasten

  • Members
  • 357 posts
  • LocationGermany

Posted 11 February 2015 - 03:08 PM

It's him again D:

Don't know whether it's intended, but your resource and treasure links direct to the same file fixed

Edited by InDieTasten, 15 February 2015 - 10:30 AM.


#3 biggest yikes

  • Members
  • 573 posts

Posted 13 February 2015 - 09:50 PM

Best. GUI. Ever.

#4 Geforce Fan

  • Members
  • 846 posts
  • LocationMissouri, United States, America, Earth, Solar System, Milky Way, Universe 42B, Life Street, Multiverse, 4th Dimension

Posted 15 February 2015 - 07:00 AM

This has been needed for a VERY long time.
Thank you.

#5 nitrogenfingers

    Lua Professor

  • Members
  • 551 posts
  • LocationAustralia

Posted 05 March 2015 - 02:06 PM

Spurred by some other stuff I added one or two little modifications and interface niceties; a more detailed print menu and a few warning messages. Makes sense for a program about printing...

I've also made edit mode available. You can get to this right now by adding tab (later it will be a menu option) and it shows spaces and newlines if you're trying to format your document nicely.

Spoiler

This isn't a terribly exciting project I know, but I might keep pecking away at it, possibly adding a few format features like justifying, bullet points, margins and other things to make this a bit more interesting.

-NF

Edited by nitrogenfingers, 05 March 2015 - 02:17 PM.


#6 GopherAtl

  • Members
  • 888 posts

Posted 05 March 2015 - 02:28 PM

View Postnitrogenfingers, on 05 March 2015 - 02:06 PM, said:

This isn't a terribly exciting project I know, but I might keep pecking away at it, possibly adding a few format features like justifying, bullet points, margins and other things to make this a bit more interesting.

it may be a niche program, but for those people wanting to use cc printers to make in-game books, it's a very useful one! Beats the heck out of the guesswork involved in trying to lay out pages in a normal editor, and spares you the waste of paper, ink, and time involved in testing said page layouts.

#7 LDDestroier

  • Members
  • 1,095 posts
  • LocationACDC Town

Posted 05 March 2015 - 02:34 PM

This looks really cool! Does it have anything that Ink doesn't though?

#8 GopherAtl

  • Members
  • 888 posts

Posted 05 March 2015 - 02:53 PM

View PostLDDestroier, on 05 March 2015 - 02:34 PM, said:

This looks really cool! Does it have anything that Ink doesn't though?

Well, lets see. I just installed the latest release (non-beta) version of OneOS so I could compare.
Ranty results inside....
Spoiler

:edit: Sorry for going all attitude here, it just... this sort of thing is a pet peeve of mine. You cannot judge a program, much less compare two programs, based on screenshots and posted feature lists. You have to actually use them. Even my minimal attempt to use ink reveals it has bugs that make it completely unusable. My few minutes with WYSIwrite revealed no bugs.

Edited by GopherAtl, 05 March 2015 - 03:01 PM.


#9 nitrogenfingers

    Lua Professor

  • Members
  • 551 posts
  • LocationAustralia

Posted 05 March 2015 - 02:54 PM

View PostGopherAtl, on 05 March 2015 - 02:28 PM, said:

<snip>
Cheers Gopher :) I kind of hope it will see more use as a treasure disk, where it's probably more useful.

View PostLDDestroier, on 05 March 2015 - 02:34 PM, said:

This looks really cool! Does it have anything that Ink doesn't though?
I'm actually not familiar with Ink, and given I've tried to keep this pretty feature light I doubt it :P

Edit: Ohh that's really embarrasing, they look identical! I was not familiar with the program before I started writing it....

Edited by nitrogenfingers, 05 March 2015 - 03:06 PM.


#10 bear5567

  • Members
  • 12 posts

Posted 05 March 2015 - 07:04 PM

now if only someone could make a program like this for quick fancy monitor sign making

#11 Dahknee

  • Members
  • 1,808 posts
  • Location/home/da

Posted 09 March 2015 - 11:45 AM

View PostGopherAtl, on 05 March 2015 - 02:53 PM, said:

- snip -

This is true, Ink has so many issues, including performance and the fact the cursor doesn't always update when you click it, it also doesn't like the enter key and doesn't always work, this program I have to say is clean as clean could be, maybe add it and make it something as a text editor where you can highlight text and a little more? But this is awesome.

#12 nitrogenfingers

    Lua Professor

  • Members
  • 551 posts
  • LocationAustralia

Posted 09 March 2015 - 03:30 PM

Thanks :) I did an awful lot of unit testing to get it workable; took about 10 times as long to debug the functions as it did to write them. WYSIwrite has instilled the fear of the underflow paginate in me...

I've got a few features planned;
- Page breaks, so you can break your page
- Section breaks and nl-section conversion so formatting can be changed from one section to the next
- Left, right and center alignment within sections
- Bullet points with indenting
- Color highlighting stored in-line (and support for printer when a printer peripheral comes out)
- A file format to preserve all this stuff, as well as a way to convert between that and plaintext

#13 nitrogenfingers

    Lua Professor

  • Members
  • 551 posts
  • LocationAustralia

Posted 13 March 2015 - 05:11 AM

Well that was easy...
Spoiler

Sadly everything else on my list is not so easy. Fs doesn't recognize form feeds as newlines so I'm having to put in a thousand and one exceptions to get page breaks working smoothly and nowhere near so far. Maybe in a few more days...

#14 cdel

  • Banned
  • 496 posts
  • LocationMelbourne, Australia

Posted 13 March 2015 - 11:59 AM

View Postnitrogenfingers, on 13 March 2015 - 05:11 AM, said:

Well that was easy...
Spoiler

Sadly everything else on my list is not so easy. Fs doesn't recognize form feeds as newlines so I'm having to put in a thousand and one exceptions to get page breaks working smoothly and nowhere near so far. Maybe in a few more days...

Looks good!

#15 _removed

  • Members
  • 262 posts

Posted 15 March 2015 - 11:08 PM

Always pleased wih what you produce NF, because it is always functional and 99.99% have no bugs!

#16 willwac

  • Members
  • 182 posts

Posted 22 March 2015 - 07:39 PM

View Postnitrogenfingers, on 09 March 2015 - 03:30 PM, said:

- Page breaks, so you can break your page
*Takes axe to paper*
On a more serious note, this looks very cool!

#17 nitrogenfingers

    Lua Professor

  • Members
  • 551 posts
  • LocationAustralia

Posted 14 April 2015 - 12:30 PM

Another update here, I've made listed it above as "latest" because bug tracking is a bit difficult with this iteration and this one isn't stable.

http://pastebin.com/RSyhCjqv

A few features added to this version with more to come:
- You can 'test' the alignment options here, center right and left available. Right doesn't work well (I have to hide the right margin) so comments welcome.
- Page breaks, which are pretty buggy and have had a lot of issues with pagination.
- Undo and redo. It's not quickly accessible sadly but does have effectively infinite range and a little trick to mean you don't need to do it too often
- A recover feature, that will restore your last version of the document if there's a program crash. This is saved as a hidden file on root.

Comments welcome as always :). I'm considering adding a prefs file as I don't like saving those hidden files but that'd itself probably have to be a hidden file or something similar, so if anyone has any suggestions on this that'd be great too.

-NF

Edited by nitrogenfingers, 14 April 2015 - 12:34 PM.


#18 Dahknee

  • Members
  • 1,808 posts
  • Location/home/da

Posted 14 April 2015 - 12:36 PM

View Postnitrogenfingers, on 14 April 2015 - 12:30 PM, said:

Another update here, I've made listed it above as "latest" because bug tracking is a bit difficult with this iteration and this one isn't stable.

http://pastebin.com/RSyhCjqv

A few features added to this version with more to come:
- You can 'test' the alignment options here, center right and left available. Right doesn't work well (I have to hide the right margin) so comments welcome.
- Page breaks, which are pretty buggy and have had a lot of issues with pagination.
- Undo and redo. It's not quickly accessible sadly but does have effectively infinite range and a little trick to mean you don't need to do it too often
- A recover feature, that will restore your last version of the document if there's a program crash. This is saved as a hidden file on root.

Comments welcome as always :)/>. I'm considering adding a prefs file as I don't like saving those hidden files but that'd itself probably have to be a hidden file or something similar, so if anyone has any suggestions on this that'd be great too.

-NF

Nice update, I like, I would say though maybe add some way of making some text aligned and some not? and a huge feature that would be awesome is text highlighting and being able to highlight text and simply delete it etc, that would be awesome but nice update!

#19 nitrogenfingers

    Lua Professor

  • Members
  • 551 posts
  • LocationAustralia

Posted 14 April 2015 - 12:39 PM

Yep first thing planned once I've got this one bug-fixed will be section breaks; that'll allow alignment differences, coloured text etc.

#20 Dahknee

  • Members
  • 1,808 posts
  • Location/home/da

Posted 14 April 2015 - 01:00 PM

View Postnitrogenfingers, on 14 April 2015 - 12:39 PM, said:

Yep first thing planned once I've got this one bug-fixed will be section breaks; that'll allow alignment differences, coloured text etc.
Awesome can't wait.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users