-
Notifications
You must be signed in to change notification settings - Fork 189
mdbook-latex: Add mdBook backend script. #416
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
Conversation
Can pandoc itself generate PDFs? I thought it needed LaTeX available somewhere on the system. That's awesome! Since it's a bigger script, I don't see too much of an issue with running it separately. Will try it in a bit! |
Oh, sorry, no, i installed |
No problem! We should add these deps to the readme, then. |
PR updated with changes to README. |
Hmm I wonder if we could somehow append the markdown documents together instead... Besides the formatting issues you pointed out, the page numbers are a bit weird, and we don't have clickable links :/ |
@ericonr: Sure, i'll rework it to concatenate the .md files first; i imagine that would mean that Yeah, i'm not sure why there aren't internal links; maybe they need to be actively enabled via |
I'm afraid it might make weird things to the headers by concatenating everything. Let's see what happens! Have you tested the alternative mdbook backend for ebooks? Maybe we could print a PDF from that? I know it looked weird when I tried it, but idk if it was caused by foliate or by the backend. |
Btw, when you're done remember to add the generated files to |
No, the headers seem fine when concatenating the Markdown sources (as does the page numbering). The problem is that new sections don't appear on new pages, and inserting FF or FS characters in the Markdown don't work. i'm about to try converting to LaTeX, inserting LaTeX page breaks where appropriate, then running |
The reason I would consider the ebook backend is exactly that it would have already done the processing to split the pages where necessary as well as make the links work. But if you manage to make it work without that, all the better! |
Trying to put together a LaTeX file suitable for direct use by
:-( |
(If the EPUB stuff doesn't work out either, i can work on a Perl mdBook backend to generate the necessary LaTeX from the JSON representation - i've actually made an exploratory start on that.) |
Hmm I think rust-lang/mdBook#88 has some stuff, including software to collate the markdown files! |
https://github.com/cetra3/mdcollate this one seems quite interesting! |
Actually, my Perl backend is coming along nicely: here's an excerpt of the output it's producing. i'm in the middle of working out how to do internal links; once that's done, i can work on producing LaTeX lists and tables. If you have no objections, i'd like to focus on continuing to develop this, as it seems promising: this backend could give us total control over the output, with the ability to do things like create a nice ToC, use the |
I don't have any issues, and having full control is indeed very interesting! Good luck c: |
Okay, thanks. i've updated the PR to include the |
Oh, you're doing it the way we had discussed it a while ago, right? Using the JSON output of mdbook! Nice. |
PR updated. Running
in There are very obviously many visual issues still to address, and although external links are (i believe) working, internal links are not, though the infrastructure for that is now basically in place. |
Would you like to make this into a separate packaged project or should it be kept in-tree? I can see the case for making it a package with all the dependencies and then we could talk to @the-maldridge about deploying the pdf in the mirror as well, for people to download. |
It would also help with PATH issues, since it's complaining about not finding the latex backend. |
i was wondering about this also. My thinking has been that it should perhaps be kept in void-docs, as the code is (at least at this point) quite specific to the Void Handbook, and how we do things. Otoh, the arguments for a distinct repo under void-linux make sense as well. Re. the PATH issue, yes, i've just been adding the path to my local void-docs repo to PATH. Obviously if it's a separate package, this is not an issue, but if we keep it in-tree, we'll need to work out how to best address this issue. |
Checklist time:
This is pretty cool already, though! Thanks :D |
@ericonr: i believe i might have solved the codeblocks issue in general. :-D As a bonus, the style guide no longer requires special-casing overall (though i can spot at least one small issue). Could you please confirm? i've just pushed an update. |
That works, but I didn't know about it.
Yes, sorry. I should have made that clear. I guess it's no longer needed, though :D |
I'm guessing the upside down interrogation mark?
Indeed! I've just noticed that the index is a bit off, e.g. the Wayland section should be under Graphical Session, not on the same level. |
Yeah. i'll look into that.
Excellent! i'll remove the
i noticed something similar re. the "Hashboot" and "AppArmor" sections. i'll look into that too. So, other things still left to do:
Anything else? Have i forgotten anything? |
Not a blocker, I believe. For the build command:
In Oh, the default groups table is a bit screwed D: The Intel video acceleration one is too. |
Good point re. the Thanks for noting the other issues - i've added them to my TODO. :-) |
Fixed:
Re. the Tor mirrors table, the LaTeX looks fine; i don't understand what's going on. Would it be okay to leave it for now, and come back to it later, as with that "Hashboot" para? Re. the ToC. The issue is that the EDIT: Oh actually, i guess i could try to write code to create the ToC on the basis of the directory structure. So if this is indeed a blocker, that's the approach i'll try taking. |
I don't think any of these issues are blockers! So we can get to them in time. |
Okay. :-) So is there anything else that needs to be done, or do you think this might be ready to merge? |
I don't think so. Might want to wait a bit to see if anyone has any comments. I guess we could list the to-do items in #407 ? |
If anyone wants to try it out :D |
Closes: void-linux#416 [via git-merge-pr]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the only thing left to decide is regarding deployment, but this can be solved once we have deployment.
@ericonr: So do you think we should we wait longer for any feedback, or can we now merge? |
I asked @bobertlo to take a final look before merging, so it would be nice to wait for him. Could you open an issue with the issues that still need to be solved in the generated PDF? |
Sure.
i added them in a comment on #407, as you suggested here; do you think it would be better to have a distinct issue for them? |
You can see I was making this comment at 4 in the morning :P Yes, you did list them there, and yes, it is a great place to put them. Sorry for the noise! |
I don't see any blockers on this. I have opinions on improvements that I will put somewhere else but I'm really surprised at the quality of this after being away for so long. I want to print this and bind it! |
Addresses #407.
This script makes use of
pandoc
andpdfunite
, the latter being provided by thepoppler
package. There's some temporary special-casing to deal with issues that are addressed in #414 and #415The resulting PDF has some layout problems (e.g. on pp. 9 and 10).
i imagine we might want to incorporate this script into
build.sh
, but i've kept it separate for now, whilst it's in development. (We could, of course, keep it separate, and simply call it frombuild.sh
if/when required.)