Export code to pdf

Something you want to see in a LiveCode product? Want a new forum set up for a specific topic? Talk about it here.

Moderator: Klaus

Post Reply
Adrien
Posts: 26
Joined: Fri Jan 09, 2015 9:55 am

Export code to pdf

Post by Adrien » Tue Apr 07, 2015 11:00 am

Hello all,

Something I could make a good use of, would be a "export code to pdf" option (or text..).

With everything neatly organized, like new card = new chapter, with all the controls scripts on that card in the chapter, you get to pick which chapters you export, ...

It can be a pain to open each and every control on a heavily populated card..

Yes/no, maybe? Too gadget?


Cheers,



Adrien

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10043
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Export code to pdf

Post by FourthWorld » Tue Apr 07, 2015 3:33 pm

LC includes a PDF print external, so if you really want this you could have it this afternoon with a little bit of work.

But I'm curious: What would you do with the PDF?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

Re: Export code to pdf

Post by dunbarx » Tue Apr 07, 2015 3:53 pm

I suppose the OP just wants to be able to create a complete report of all scripts, to peruse and reference at leisure.

But as Richard points out, you likely want this in a format that satisfies your own style. The best way to do that is to write your own.

Craig Newman

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10043
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Export code to pdf

Post by FourthWorld » Tue Apr 07, 2015 4:17 pm

dunbarx wrote:I suppose the OP just wants to be able to create a complete report of all scripts, to peruse and reference at leisure.
I guess I'm poking around the edges of another question: what if we had a tool that made is just as leisurely to read scripts in place?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Adrien
Posts: 26
Joined: Fri Jan 09, 2015 9:55 am

Re: Export code to pdf

Post by Adrien » Tue Apr 07, 2015 4:20 pm

All,

The uses I would have for such a pdf include but are not limited to:
- working on the algorythms when I'm on the move (printed out or not..)
- print some sheets, lay some on a big table, pin others to the wall, draw on them, ..
- share algorythms and logic with LC-less advisors or techs
- have a clearer view on the relationships between controls and cards (solopreuneur's budget and 15" laptop screen)
- ..

Having an option in some LC drop-down menu would be a fast (maybe furious) way to get that done on command!
I haven't explored the marvelous world of LC externals yet, I was just dropping the idea in there :)

Cheers,


Adrien

edit: and yes, the focus point would be on having everything neatly, logically organized and also being able to pick exactly what you need, like "everything on that stack", "that card and all of its controls", "every handler with x y conditions in that stack", ...

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10043
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Export code to pdf

Post by FourthWorld » Tue Apr 07, 2015 5:13 pm

Adrien wrote:All,

The uses I would have for such a pdf include but are not limited to:
- working on the algorythms when I'm on the move (printed out or not..)
- print some sheets, lay some on a big table, pin others to the wall, draw on them, ..
- share algorythms and logic with LC-less advisors or techs
- have a clearer view on the relationships between controls and cards (solopreuneur's budget and 15" laptop screen)
Excellent list - thanks.

I have some code review tools in progress which may help some day, but they're in a very early stage at this time. One of the things that holds me back from finishing them is that aside from a few things I very rarely use I've found the Project Browser very satisfying, providing a nicely nested view of objects with quick access to not only their own scripts but also any behavior scripts they may use. When I find a particularly complex script I can print that, but most of the time I find perusing things in the PB very useful, esp. since my code sometimes changes frequently, so any printout I made last week won't represent what I'm working with this week.

Have you explored the Project Browser?

Would other export formats like RTF and/or HTML be useful for sharing with others?

Would it be useful to share hypermedia representations of the code in a free application that could be easily shared with others? There may be some nice things we can do easily in LC which may be more difficult to do in HTML or PDF.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Adrien
Posts: 26
Joined: Fri Jan 09, 2015 9:55 am

Re: Export code to pdf

Post by Adrien » Tue Apr 07, 2015 6:42 pm

FourthWorld wrote:share hypermedia representations of the code
Do you mean - like a graphical layout of the code? Would this be similar to a database representation with controls (within cards) instead of tables and handler messages instead of relations?


I've been using the project / application browsers yeah, but some of my cards are really heavily populated, some of my logic can be confusing after some time (and yes, I do comment my code), hence the idea of a 1-clic 1-ask export.

And my application browser got SWARMED with "revidelibrary", "revMenuBar", "revprintlibrary", "reveverythingaboutthisworld" and so on, no idea how so, why so, and how to get back to only see my own stacks.


Cheers,

Adrien

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10043
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Export code to pdf

Post by FourthWorld » Tue Apr 07, 2015 6:56 pm

Adrien wrote:
FourthWorld wrote:share hypermedia representations of the code
Do you mean - like a graphical layout of the code? Would this be similar to a database representation with controls (within cards) instead of tables and handler messages instead of relations?
That would be cool, and there are algos for those sorts of graph diagrams. That's beyond the scope of what I'm working on now, but perhaps down the road it would be nice to add. For now I'm working on a simple tree view, though it will include Calls In and Calls Out, with popup lists of where those calls originate.
And my application browser got SWARMED with "revidelibrary", "revMenuBar", "revprintlibrary", "reveverythingaboutthisworld" and so on, no idea how so, why so, and how to get back to only see my own stacks.
That's governed by a Preferences setting - in Prefs see the "General" section, and uncheck the checkbox labeled "LiveCode UI elements appear in lists of stacks".
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Adrien
Posts: 26
Joined: Fri Jan 09, 2015 9:55 am

Re: Export code to pdf

Post by Adrien » Wed Apr 08, 2015 8:51 am

FourthWorld wrote:That's governed by a Preferences setting - in Prefs see the "General" section, and uncheck the checkbox labeled "LiveCode UI elements appear in lists of stacks".
Thanks, that was it.
FourthWorld wrote:That's beyond the scope of what I'm working on now
This is also far, far away from my reach, considering my already limited time.. hence dropping the idea in the request forum :mrgreen:


Cheers,


Adrien

ThomasFireheart
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 48
Joined: Sat May 24, 2008 2:27 pm

Re: Export code to pdf

Post by ThomasFireheart » Mon May 04, 2015 8:57 pm

Personally, I was hoping that something like 'Script Reporter' [ http://www.createchsol.com/ScriptReporter/ ] would do the trick - as I also desire the ability to export/print all the code for a stack, but it doesn't seem like it works with Livecode 7. Maybe someone with more knowledge than I can take a look at it and figure out what is going wrong with it.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Export code to pdf

Post by Simon » Mon May 04, 2015 9:26 pm

Hi Thomas,
Not sure if this will solve your problem but

Code: Select all

if  item 6 line i of fld Display = "" then next repeat
Just under the switch at line 258 of stack script of Script Reporter.

Is that where it was breaking for you?

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

ThomasFireheart
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 48
Joined: Sat May 24, 2008 2:27 pm

Re: Export code to pdf

Post by ThomasFireheart » Fri May 29, 2015 1:11 pm


Post Reply