Bug 456375 - Invalid link to download the book
Summary: Invalid link to download the book
Status: RESOLVED FIXED
Alias: None
Product: Books
Classification: Applications
Component: Frameworks Cookbook (show other bugs)
Version: unspecified
Platform: Neon Linux
: NOR major
Target Milestone: ---
Assignee: Documentation Editorial Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-07-06 00:00 UTC by logicalwillow
Modified: 2022-07-11 18:19 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description logicalwillow 2022-07-06 00:00:26 UTC
SUMMARY
The link on the Community wiki to download the book is to share.kde.org, but the new address is collaborate.kde.org, so the download link doesn't work anymore.

STEPS TO REPRODUCE
1. Try to download the book using the link on the Community wiki

OBSERVED RESULT
The book doesn't download because of the invalid link

EXPECTED RESULT
The book downloads
Comment 1 Albert Astals Cid 2022-07-06 16:06:08 UTC
The community wiki is huge, can you please paste the address that contains the broken link?
Comment 2 logicalwillow 2022-07-06 16:48:33 UTC
https://community.kde.org/Books
Under the section "KDE Frameworks Cookbook"
Comment 3 David C. Bryant 2022-07-06 17:27:32 UTC
I think he's referring to this wiki page

https://community.kde.org/KDE_Documentation/KdeBooks

or maybe this one: https://community.kde.org/Books

I see that the source code for the book is in the Gitlab repo:
https://invent.kde.org/documentation/kf5book

But I'm not sure how to turn that into a .pdf file.
Comment 4 logicalwillow 2022-07-06 17:51:59 UTC
I remember that you used to be able to download the book by clicking on the "here" link, but because that link goes to a Nextcloud server that changed domains (share.k.o -> collaborate.k.o) the link doesn't work anymore.
Comment 5 Albert Astals Cid 2022-07-06 21:07:39 UTC
Valorie, do you remember who we created that book at all?
Comment 6 Albert Astals Cid 2022-07-06 21:07:49 UTC
s/who/how
Comment 7 David C. Bryant 2022-07-09 21:19:57 UTC
After a week of hard work, I have created a reasonable facsimile of the book. You can access it on my website: https://davidcbryant.net/kf5book/kf5book.pdf.

I converted the individual chapters (in .md format) and used a free on-line service to convert the markdown to TeX / LaTeX. Then I used Kile to string the whole thing  together, and compiled a .pdf file that way. I put the chapters in alphabetical order, except for the chapter about writing a new frameworks app, which I placed last.

There were a lot of broken hyperlinks. Most of those have been fixed, but I still need to proofread the whole thing one more time.
Comment 8 David C. Bryant 2022-07-10 23:26:48 UTC
I have been digging into the CMAKE files for project kf5book (https://invent.kde.org/documentation/kf5book). I finally got the .pdf file to generate using "kdesrc-build kf5book". I had to do several things to get it to go.

-- I had to install "pandocs" and also "snippetextractor". "pandocs" is part of my distro (Gentoo), so that was easy. "snippetextractor" is sort of obscure, so I had to clone the source for snippetextractor, after which "qmake -o Makefile snippetextractor.pro && make" generated the object program. I then moved the object program from the build directory into my PATH, so it woud be usable.

-- I had to change a command line in the CMakeLists.txt file:

add_custom_command(OUTPUT KDE-Frameworks-Cookbook.pdf
    COMMAND ${PANDOC} --toc --number-sections ${files} -o KDE-Frameworks-Cookbook.pdf
    --template=${CMAKE_SOURCE_DIR}/pdf-template.tex
    --chapters
    DEPENDS ${files} pdf-template.tex
)

The "pandocs" program no longer supports  a "--chapters" option. It works OK if "--chapters" is changed to "--top-level-division=chapter".

-- I had to add some customization to the "pdf-template.tex" file from the repo.
(add after line 131)
\providecommand{\tightlist}{%
  \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}

because "pandocs" throws a "\tightlist" command into every itemized list it generates, and \tightlist is not a standard LaTeX function.

-- With these changes, kdesrc-build can create an html file, and a pdf file. The "epub" command is still not working correctly. Maybe I can get that fixed tomorrow.
Comment 9 David C. Bryant 2022-07-11 16:21:51 UTC
I made a couple of commits in gitlab. "kdesrc-build kf5book" now creates a .pdf file, and an html file. The "epub" still dies:

gmake[2]: *** [CMakeFiles/epubbook.dir/build.make:85: KDE-Frameworks-Cookbook.epub] Error 6
gmake[1]: *** [CMakeFiles/Makefile2:139: CMakeFiles/epubbook.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
[ 86%] Built target htmlbook
[ 97%] Built target pdfbook

I can't figure that problem out. I checked the command syntax on line 85 of "build.make", and it looks OK to me. Albert, is it OK to load the .pdf file directly into the community wiki? Or is there some sort of auxiliary storage area where it ought to reside?
Comment 10 David C. Bryant 2022-07-11 18:19:29 UTC
I loaded the book into the new "collaborate" web site (https://collaborate.kde.org/apps/files/?dir=%2FCommunity+Notes%2FFrameworks&fileid=50425) and I fixed the broken hyperlink in https://community.kde.org/Books.