Skip to content
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

CI workflow to generate the output #204

Open
probonopd opened this issue May 3, 2020 · 21 comments
Open

CI workflow to generate the output #204

probonopd opened this issue May 3, 2020 · 21 comments

Comments

@probonopd
Copy link
Contributor

Currently the output files are stored along with the source files inside the git repository. This is less than ideal.

Would you be interested in having a CI workflow that would generate the output (e.g., EPUB) from the source files automatically each time something was committed to master?

This could be realized e.g., using Travis CI.
Let me know if you'd like me to look into it.

@jrbastien
Copy link
Contributor

Yes, if you make sure all outputs are produced in every languages and that you find ways to adjust copyright dates automatically. The dates are on jpeg produced from an SVG template.

Also, I remember when I setup this procedure a few years ago that there was some manual adjustment needed to the PDF outputs before checking them back to GIT.

@probonopd
Copy link
Contributor Author

I would not check the output files into the git repository at all, but rather deploy them to the website (for HTML) and/or upload them to GitHub Releases (for EPUB, PDF etc.). Do you think this would work for this project?

@jrbastien
Copy link
Contributor

Yes, I did not mean to check in the output files but I meant that if you use the generation scripts provided, they create PDFs that are not deployment ready.

@probonopd
Copy link
Contributor Author

adjust copyright dates automatically

Which copyright dates (where) do you mean? Thanks.

@probonopd
Copy link
Contributor Author

probonopd commented May 3, 2020

So here is the first iteration, please do review carefully:
https://github.com/probonopd/designwithfontforge.com/releases/tag/continuous

This is how they are generated:
https://github.com/probonopd/designwithfontforge.com/blob/travis/.travis.yml

@probonopd
Copy link
Contributor Author

Maybe implement this?

@jrbastien
Copy link
Contributor

Not yet please. I just checked the PDFs. The overall process in Planning your project is a grey box and there is another grey box showing the page before. Also if you compare the actual version with the new one you generated, you will see that there is no image of the video in General Introduction.

Notice I'm not surprised, these were the things that I needed to manually fixed.

For the copyright, I'm referring to the cover page. We should see 2020. We could improved this by amending the svg template with variable that would get the timestamp and then generating the jpgs.

Copyright

And lastly, the file is 27% bigger than before. But it could be because someone added decoration images in the first chapter without optimizing them.

@probonopd
Copy link
Contributor Author

Thanks for reviewing the output.

Notice I'm not surprised, these were the things that I needed to manually fixed.

How do you fix something manually in an automatically generated PDF? Did you actually use an editor and literally edited the PDF by hand? Or did you do something manual prior to running ./create_books.sh?

@skef
Copy link

skef commented May 3, 2020

This is "not the place" but since multiple relevant parties are in discussion here I want to point out that my replacement Expand Stroke document wound up more or less buried among the old docs here: https://fontforge.org/docs/techref/stroke.html Some of the latter parts are probably too technical but the initial portion might be a good addition to designwithfontforge.

I also have a script to generate SVG figures like those in that doc, which are both more compact than images and don't have scaling issues. It takes an SFD, char, and scale factor as input.

@jrbastien
Copy link
Contributor

I edited the books with a PDF editor after generating them with the script. The cover page creation could definitely be added to the script. We would then get the proper date.

For the other problems, I never took the time to analyze what could be done to prevent them upfront. If you have time to do this, that would be great.

And @skef, your comment is really out of place!

@probonopd
Copy link
Contributor Author

@jrbastien yes I think the changes should be made prior to running ./create_books.sh. I will see what I can do.

@skef
Copy link

skef commented May 3, 2020

@jrbastien FontForge doesn't currently have reliable communication channels for this sort of thing. If you actually want me to open an issue about this, tell me so.

probonopd added a commit to probonopd/designwithfontforge.com that referenced this issue May 3, 2020
@probonopd
Copy link
Contributor Author

@skef

I also have a script to generate SVG figures like those in that doc, which are both more compact than images and don't have scaling issues. It takes an SFD, char, and scale factor as input.

Can you show me how to use it?

@skef
Copy link

skef commented May 3, 2020

@probonopd Sure -- I'll get a copy into a repo and point you to it.

@probonopd
Copy link
Contributor Author

probonopd commented May 3, 2020

I am puzzled @jrbastien. I am putting the current year into the Copyright into cover_template.svg which seems to work:

https://travis-ci.com/github/probonopd/designwithfontforge.com/builds/163574842#L1314-L1315

Still, the output doesn't reflect the change. Do you know where this cover image is coming from, if not from cover_template.svg?

@jrbastien
Copy link
Contributor

You are so fast! The jpgs were also manually created. We need to add the jpg creation to the create_books.sh now.

@probonopd
Copy link
Contributor Author

Wouldn't it be much nicer to have just a picture on the cover, and the copyright text on the next page as real (searchable, good-looking) text?

@skef
Copy link

skef commented May 4, 2020

@probonopd RE figures: take a look at https://github.com/skef/FFSVGFig and open up an issue there if/when you want to chat further. I did some work to get it in better shape than when I was using it for the stroke docs.

@jrbastien
Copy link
Contributor

Responding to the original issue here. Yes, having the copyright on the next page would make sense. We would have to design it though.

Since I don't have time to work on this now, I will let you do it. Or if you are patient enough, I could amend the script to regenerate the cover page from the updated svg template.

@probonopd
Copy link
Contributor Author

probonopd commented May 5, 2020

Over at skef/FFSVGFig#2 @skef and I have worked out a method to generate illustrations automatically which could be used as part of this server-side generation process.

Now we would now need to think about how to put the instructions ("recipe") for each illustration into the "source code" of the book - I guess I'll leave this discussion to the regulars of this project.

@ctrlcctrlv
Copy link
Member

Following the merger of #216, which accepts many of the issues raised here as ① inevitable or else ② fixable in time, this issue is now far easier to solve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants