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

Migrate pdf format #135

Merged
merged 25 commits into from
Apr 22, 2020
Merged

Migrate pdf format #135

merged 25 commits into from
Apr 22, 2020

Conversation

hirotnk
Copy link
Collaborator

@hirotnk hirotnk commented Apr 18, 2020

This PR is an attempt to improve maintainability by introducing the usage of asciidoctor-pdf instead of dblatex to generate pdf file. Since both asciidoctor and asciidoctor-pdf are under the same project, it's easier to use both together, and they are actively maintained, and easy to customize a variety of features.

Alongside the migration of pdf generator, this PR introduced/improved the following items:

  • Usage of ditaa instead of shaape to generate diagram image from ascii art. This was made because shaape is not maintained since 2014.
  • Use Unicode characters directly in asciidoc documents - since asciidoctor and asciidoctor-pdf both understand UTF-8, no need for extra work for both tools(asciidoc and dblatex) to deal with Unicode character sets. I think this would make it easier to resolve issues like HTML Entity for * (*) is not rendered properly #124
  • Introduce new Admonition VERSION to indicate version info of OTP for each sections, related to Suggestion: Make explicit the version of Erlang in the book #77
  • Update header/footer in pdf
  • Fix Appendix structure

This is still WIP, and I'd like to get some feedback to work further.

Also, I appreciate my current employer TubiTV for allowing me to work on this for 2 days as part of our second annual "oss-a-thon" event.

It was not considered to be appendices in pdf.
When we use asciidoctor-pdf, UTF-8 is supported.
- :partnums: Book parts are assigned roman numerals when the attribute partnums is set.
- :sectnums: If set, numbers sections to depth specified by sectnumlevels(default 3).
- :sectlinks: Turns section titles into self-referencing links.
- :!compat-mode: use the new Asciidoctor syntax
Using asciidoctor-pdf it would be easier to generate differnt formats of
documents with single source. For example, pdf file generation can use
its' own custom settings, and still benefits the same foundation of
asciidoc.

This change mainly includes improvement of pdf file generation.
- Header/Footer
- TOC
- Appendix
- Admonition icon is now available in pdf

NOTE: This is still WIP, so keeping old commands in Makefile
shaape is not maintained since 2014.
ditaa looks to be still maintained, and more popular.
Need to use a font that has circled number.
- VERSION to indicate version info inside sections. When further
  descriptions are needed, authors can use this admonition.
- Create style directory and put config files in it.
- Adjust Makefile
This is still WIP, but added/update new installation info about
asciidoctor.
@happi
Copy link
Owner

happi commented Apr 20, 2020

First impression: Nice!

Copy link
Owner

@happi happi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mention rouge in install instructions in Readme.

Copy link
Owner

@happi happi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dir "images" should either be checked in or be created by make.

@happi
Copy link
Owner

happi commented Apr 20, 2020

The new style and format of the PDF looks really nice, especially the new diagrams are nice.
I think the compiler passes figure, Figure 6, would look better without bold for the lables, they are a bit to close vertically.

@happi
Copy link
Owner

happi commented Apr 20, 2020

Figure 25(Port Communication) might need some changes to work nicely with ditaa.

@happi
Copy link
Owner

happi commented Apr 20, 2020

All in all much needed improvements.

@happi
Copy link
Owner

happi commented Apr 20, 2020

While you are at it, a list of instructions for installing build tools for linux might be a good idea. If you don't have access to a Linux/Ubuntu system I can fix that after merge.

@hirotnk
Copy link
Collaborator Author

hirotnk commented Apr 20, 2020

@happi Thank you for your feedback, I will work on your comments and update here once I'm done.

- for pdf, ./images
- for html, ./site/images
- Update README for the list of install/requirements
- Update Makefile to build beam-book.pdf using new build tools
- Removed "scale" option of diita
- Adjusted the diagrams so that it looks better when there are multiple
  boxes
- Fix equal sign rendered by diita, by using arrow symbol instead of
  equal sign
- Port communication diagram
- Entities on Erlang Node diagram
It makes link macros not working.
- Makefile should use commands available in the container
- Update travis config accordingly
@hirotnk
Copy link
Collaborator Author

hirotnk commented Apr 22, 2020

@happi Updated:

  • README to include rouge syntax highlighter, and other instructions. For Linux, I don't have access right now but it won't be much trouble since we have the asciidoctor public docker image
  • Figures - Compiler passes and Figure 25(Port Communication)
  • Makefile
  • Fix links to AP-xxx
  • .travis.yml (not sure if it will work yet)

I'm sure there are still lots of errors, please let me know if you want to fix something.

@hirotnk hirotnk changed the title [WIP] Migrate pdf format Migrate pdf format Apr 22, 2020
@happi
Copy link
Owner

happi commented Apr 22, 2020

Great work!

@happi happi merged commit 7f2d905 into happi:master Apr 22, 2020
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

Successfully merging this pull request may close these issues.

2 participants