LDraw.org Discussion Forums
Idea for a program to generate instructions - Printable Version

+- LDraw.org Discussion Forums (https://forums.ldraw.org)
+-- Forum: LDraw Programs (https://forums.ldraw.org/forum-7.html)
+--- Forum: LDraw File Processing and Conversion (https://forums.ldraw.org/forum-22.html)
+--- Thread: Idea for a program to generate instructions (/thread-9041.html)



Idea for a program to generate instructions - Nicola - 2013-05-14

In the last few days i've been toying with an idea for an Lpub like program to generate and paginate instructions.
The problem with these kind of programs is that all code to layout stuff is tedious and bug prone (all calculations on margin and alignement and relative positioning and stuff).
The idea is to use something that already does this job and i thought, why not HTML+CSS?
We can put all rendering images into div boxes, giving each box his css class like "assembly", "part list", "step num" etc, and building the appropriate CSS to handle positioning. CSS has plenty of options for this. CSS could be used also for font size, face and placement. One could customize his own CSSs and reuse them (instead of reentering his setup for each file as in LPub).
The generated html+css+images could be used by itself, or better with an integrated renderer we could generate png images just like LPub. It could also be postprocessed with any WYSIWYG html editor.
CSS has some advanced rules to control pagination.
Rendering of images could of course be handed off to LDView or another renderer just like LPub does.

What do you think ?


Re: Idea for a program to generate instructions - Tim Gould - 2013-05-15

I think it's a great idea in principle. And I say 'in principle' because CSS implementations often only follow the rules 'in principle' so I suspect that you will save little or no work in dealing with pagination and all that. But I'd be happy to give it a go if you get it up and running.

You might want to talk to Remi Gagne (or at least look at his code) who has already done a lot of work on GUI instruction generation in Lic.

Tim


Re: Idea for a program to generate instructions - Willy Tschager - 2013-05-15

Lic does a fine job but is too much automatized. I found it hard to tweak the pages I like them and turned back to LPub.

w.


Re: Idea for a program to generate instructions - Gerald Lasser - 2013-05-15

Basically you could try your idea as LPUB produces all the images you need. Take a small model and do the HTML/CSS for it.

I am also toying around with thoughts on LPUB and making it better, see my post a few days ago.

I agree with you that at first LPUB is strange. But then you can tweak it, if you do the process step by step you end up with a clean file. You can keep your standard settings for assembly/steps/fonts etc and copy it into every LPUB doc you do.
LPUB tends to mix up the META commands it adds to the file, but once you know how it is parsing you can remove additional lines. Especially with some positioning changes, LPUB is not always cleaning up the original setting. Leaving fragments of meta-commands in effectively voiding your change. This need to be changed manually. I think a small cleanup routing to keep steps /call-outs tidy would do wonders!

I would nevertheless love to see how an alternative would do the job.

Gerald


Re: Idea for a program to generate instructions - Nicola - 2013-05-15

Gerald Lasser Wrote:Basically you could try your idea as LPUB produces all the images you need. Take a small model and do the HTML/CSS for it.

Yeah i did exacly that, here are the results.. They where just hacked quickly and there's much room for improvements:

Demo with table
Demo with div

As i said, it would be relatively trivial for a program to generate the HTML portion, while the css would be hand crafted once.

About LPub, i've been using it a lot, it's great, but all its limitations are starting to annoy me. I think the bug you report is quite serious imho. Having to manually clean old lines is bad, and you have first to understand which ones are the old lines.. And there are other bugs.. I'll probably keep using it but it's far from optimal Smile

Btw are you the developer of LPub ?


Re: Idea for a program to generate instructions - Gerald Lasser - 2013-05-15

No, I am not. The developer of LPub is Kevin Clague.

I wish I could code a bit more to do some patches myself. I am looking into the code of LPub to learn, but that is still a long way to go.


Gerald


Re: Idea for a program to generate instructions - Willy Tschager - 2013-06-15

Stai ancora lavorando su questo?

w.


Re: Idea for a program to generate instructions - Nicola - 2013-06-15

Willy Tschager Wrote:Stai ancora lavorando su questo?

w.

No sorry, it was just an experiment.. if you want to develop it, go ahead Smile


parli italiano tu ? Smile


Re: Idea for a program to generate instructions - Willy Tschager - 2013-06-15

Nicola Wrote:No sorry, it was just an experiment.. if you want to develop it, go ahead Smile

Peccato, ci servirebbe un nuovo generatore d'istruzioni - o almeno qualcuno che ha tempo a disposizione ad aggiustare l'attuale!

Nicola Wrote:parli italiano tu ? Smile

No, what makes you think of this?

w.


Re: Idea for a program to generate instructions - Michael Heidemann - 2013-06-16

Willy, if you would have your wish to become true it would be better to use english language, as I suppose that not all people will use a translator to understand italian language Smile


Re: Idea for a program to generate instructions - Nicola - 2014-11-13

Some time ago i went a little forward with this project. I tought i could as well share my results.
Basically the program now correctly parses ldraw files and call LDView to render everything. It then build an "instruction tree" that is used to create a skeleton HTML.

Here's a couple of examples:

http://www.lugato.net/brigl/instructions/coinop/test.html
http://www.lugato.net/brigl/instructions/friendsinspace/test.html

My idea was to use css to drive the layout, here are two examples of the same html with two different css to modify the part list appearance:

http://www.lugato.net/brigl/instructions/car/test.html
http://www.lugato.net/brigl/instructions/car/test2.html

Ideally in my mind there should be a GUI which hides the innard css with some "presets" functions (like general aligns, positions etc) while still letting you change the css manually for fine tuning. I made some study with Javafx and it shows promising results, expecially for the powerful and very easy to manipulate webview component.


Re: Idea for a program to generate instructions - Philippe Hurbain - 2014-11-13

It looks pretty good so far, something it's missing (as far as I can tell!) is a page notion (html is pretty unreliable for printing/PDFing).
Quote:Ideally in my mind there should be a GUI which hides the innard css with some "presets" functions (like general aligns, positions etc) while still letting you change the css manually for fine tuning.
A philosophy that suits me...

...I like the Friends in space model Wink


Re: Idea for a program to generate instructions - Willy Tschager - 2014-11-13

Doesn't look that bad. Just as an input I would say that a good BI generator distinguishes itself from the rest in how cleaver it handles subfiles and their inclusion in the main model - apart from the GUI.

w.

Also like the friends in space, my 5 year old would point out that there isn't enough PINK, PINK, PINK! :-D


Re: Idea for a program to generate instructions - Nicola - 2014-11-13

Philippe Hurbain Wrote:It looks pretty good so far, something it's missing (as far as I can tell!) is a page notion (html is pretty unreliable for printing/PDFing).

Yes pagination is not included. The program should in theory output the images directly (beside the html), eventually using html pagination.

Willy Tschager Wrote:Doesn't look that bad. Just as an input I would say that a good BI generator distinguishes itself from the rest in how cleaver it handles subfiles and their inclusion in the main model - apart from the GUI.

Indeed i have some troubles in deciding what exacly a BI generator should do. Or the degree of freedom left to the user. How do you think it should handle the subfiles?


Thanks for the model, i made it for a competition on Rebrick but didn't win Smile i'd loved to use more "friends colors" but hadn't the right parts Smile


Re: Idea for a program to generate instructions - Steffen - 2014-11-14

sweet!


Re: Idea for a program to generate instructions - Jason Smith - 2014-12-03

I like this project, I can see it being very useful and fun.