-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple %VAR_ keynames to run script using different CSVs #204
Comments
Hello @chsdramaboosters, I'm not sure I understand the whole story of your needs & wishes. From what I gathered you want to generated a single document (pdf) that contains various sections, and most of these sections are either list-like or table-like sections with repeating attributes. If that's the case, for the sake of flexibility and ease of maintenance I think I would use a separate scribus (SLA) file for each section, containing just the title for that section and the template for a list or table layout with some %SG_NEXT-RECORD% as needed per your layout: cast.sla, crew.sla, heads.sla, bios.sla and adds.sla Similarly I'd have maybe 3 data (CSV or JSON) files with the relevant attributes: cast.csv, crew.csv, adds.csv I would then create a single batch file to generate all the needed sections into separate files, so that it's easy to update/correct one part without damaging or having to redo the rest:
then merge them in your preferred order using either scribus (graphically but manually file > import) or the script at https://github.com/aoloe/scribus-script-repository/tree/master/sla-import
Check it out and fine tune in Scribus, then export to pdf from within Scribus... or export directly from command line if you're happy with your workflow, using https://github.com/aoloe/scribus-script-repository/tree/master/sla-to-pdf But that's just my 2 cents and if you have any reasons you don't like this approach please kindly explain where it doesn't work so I can try to better understand it. |
Thank you, Berteh. The section by section approach is how I began. It is manageable, and the script to pull all sections back together is very helpful. The one piece Not addressed is that ad images are present across sections. I have 28 ad spaces mixed across all sections and am using %var_ for file paths and names. So even if broken into sections I’d need to keep the var_ ad(s) in the cast section separate from the var_ cast list with levels, which is just a mini version of what I’m already doing. |
Or you could maybe handle the adds with an 'hybrid' design that displays both a headshot and an add on top of each other (the order does not matter). Then only one of these 2 variables (set) is given values in the data entry, thus showing as a single add in the headshots section (for example). The SG script discards all unused variables by default, so the empty frames (headshot text and Pictures) are cleaned away. Such an approach seems much more flexible to me than multi levels variables... for which I don't see many uses aside from yours. It works especially great with the ability of scribus to manage text flow around objects. If you can share an example pdf (and opt sla + csv) i'd be happy to give it a try. I mainly want to avoid making the SG script too complex: exceptions and double loops introduce many chances to break things in the far away future when another improvement requires some code refactoring. On the other hand I'm very open+interested in new features with many usage possibilities. |
Sure. Have at it. Thanks! Final pdf too large so I split in half after generating. Curious.csv |
Hi,
I'm building a theater playbill which is comprised of several sections ideal for scribus generator. However, each set of lists is somewhat unique, and would be well suited to a different CSV file and different ScribusGenerator run. Examples of sections include:
Then, running throughout the playbill are advertising graphics, which too can be scribus-generator inserted based on a CSV with filenames.
Because of the linearity of ScribusGenerator, I've resorted to using Scribus levels to order the sections, then created a massive CSV with many headers and records ordered of by section. It works, but it's clumsy to manage several different sections within a single CSV file, as well as manage the levels in Scribus.
CSV looks something like this:
CastRole, CastActor, CrewRole, CrewMember, First, Last, HS-image, Class,Role, Bio
[cast list section]
Role1,Actor1,,,,,,,,
RoleN,ActorN,,,,,,,
[crew section]
,,Crew1,CrewM1,,,,,
,,CrewN,CrewMN,,,,,
[headshots section]
,,,,First1,Last1,HS-image1,,,
,,,,FirstN,LastN,HS-imageN,,,
[Who's Who section]
,,,,First1,Last1,,Class1, Role1, Bio1
,,,,FirstN,LastN,,ClassN, RoleN, BioN
Another method could be to expand the %VAR_ keyword to several. E.g., %VAR1_, %VAR2_, %VAR3_, etc, and tie %SG1_NEXT_RECORD% to %VAR1_ fields, and down the line.
I could then very likely ignore levels while running scribus-generator multiple times, pairing VAR1_ markings with csv1, VAR2 with csv2, etc. I'd have smaller, more managable csv files that themselves are easier to automate based on other data sources, and one master process to create the playbill section by section based on VAR-designator.
Is this possible? If so, how would I go about modifying the python scripts and CLI to support?
The text was updated successfully, but these errors were encountered: