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

HTML version of the manual #697

Merged
merged 10 commits into from Jan 17, 2019
Merged

Conversation

lornajane
Copy link
Contributor

This PR contains a (very minor!) amendment to the manual, and some scripts and supporting code to enable us to produce an HTML version (probably to then include in the website repo, but all the work is done by files in this repo). You can see how things are looking here: http://web.lornajane.net/manual.html

Fixes rst2pdf/rst2pdf.github.io#2

Copy link
Member

@akrabat akrabat left a comment

Choose a reason for hiding this comment

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

Fantastic to see this work. Thanks.

Do you have any ideas on how to we can automate getting this into the docs site?

doc/manual.css Outdated Show resolved Hide resolved
doc/manual.rst Show resolved Hide resolved
@akrabat
Copy link
Member

akrabat commented Nov 2, 2018

Note: We'll need to think about images too when publishing to the website as the HTML generated for the biohazard image is this:

<img alt="biohazard" src="../rst2pdf/tests/input/images/biohazard.png">

@lornajane
Copy link
Contributor Author

I think it might be worth moving the manual source, styles and other assets such as images to their own directory.

@akrabat
Copy link
Member

akrabat commented Nov 2, 2018

I think it might be worth moving the manual source, styles and other assets such as images to their own directory.

Agreed. Do you want to do that as part of this PR or do you want me to merge this and then work on the next one?

@lornajane
Copy link
Contributor Author

I'm not really clear how we're publishing it yet so I'm not clear on how to automate the publishing

@lornajane
Copy link
Contributor Author

I can move the assets if you think we're close enough. What relies on the path to the existing manual?

@ralsina
Copy link
Contributor

ralsina commented Nov 14, 2018

Let's merge it and then iterate with it already merged? No point in having PRs hanging for so long when they are this nice.

@akrabat
Copy link
Member

akrabat commented Nov 16, 2018

I can move the assets if you think we're close enough. What relies on the path to the existing manual?

I think that the next step is to make both manuals build to a self-contained directory and then work out how to get them onto the website.

I think that the path to the existing PDF manual is only relied on in the sense that it's all over Google.

@lornajane
Copy link
Contributor Author

I moved the files, but it breaks the roles/directives that I made and I'm not sure why. Pushing the branch for now and hoping that either someone has advice for me or this all just makes more sense another day! Definitely don't merge this one :)

@lornajane
Copy link
Contributor Author

OK, try this! Run the doc/gen_docs.sh script and observe the HTML, PDF and manpage(?) versions arriving in doc/output. The main manual source is still in doc/ but the styles, images and other ingredients are in doc/assets so it's obvious what's decoration and what's source.

I also rebased as github was showing some conflict warnings.

@akrabat
Copy link
Member

akrabat commented Dec 9, 2018

Was your rst2man installed via apt? I don't have it, but I do have rst2man.py when I did pip install docutils.

@akrabat
Copy link
Member

akrabat commented Dec 9, 2018

I get an error message about a missing file with the rst2pdf call:

$ ./gen_docs.sh
[ERROR] image.py:112 Missing image file: /Users/rob/Projects/python/rst2pdf/doc/assets/biohazard.png

This assets/biohazard.png file is also used in the generated HTML:

<p>This <img alt="biohazard" src="assets/biohazard.png" /> means you have to run.</p>

From what I can tell, this is the only external dependency we have in the HTML file that'll need to be transferred to the website.

@lornajane
Copy link
Contributor Author

I don't know what rst2man is or what we use it for, it was already there. I think it creates something that is used to generate the command output listing in the manual (and indeed on the command line)

@ralsina
Copy link
Contributor

ralsina commented Dec 16, 2018 via email

@lornajane
Copy link
Contributor Author

Ah, I know about man pages but I didn't know we had one! Is that also what's used in creating the "Command line options" section of the manual? Does anything else use that output apart from this process? I'm not sure if I'm breaking things by moving files.

@lornajane
Copy link
Contributor Author

I've added the missing image, and split the outputs into a subfolder per format in an attempt to make it obvious which things we need to copy for which format. For PDF, it's self-contained, for HTML we need the "assets" folder too that I've added there and the build script copies the image in.

Known bug: I've broken the coverpage on the PDF version. The document has picked up the right title but the coverpage doesn't seem to know what to do and shows {{title}} - I can easily hardcode it though as it's the last thing that I know will block us accepting this PR.

Different installations use either rst2man or rst2man.py, so look for
either to ensure that we can build the manpage.
@akrabat
Copy link
Member

akrabat commented Dec 16, 2018

This is great. No errors and the biohazard image is displayed in the HTML output in my browser.

I've raised a PR against your branch to make rst2man work when it's installed via pip.

Interestingly, {{title}} on the PDF cover page works for me when I build locally. Does the test_custom_cover test work for you?

@akrabat
Copy link
Member

akrabat commented Dec 16, 2018

man rst2pdf doesn't do anything on my machine. Does it do something when rst2pdf is installed using a Linux package manager?

@ralsina
Copy link
Contributor

ralsina commented Dec 17, 2018 via email

@lornajane
Copy link
Contributor Author

No, the test_custom_cover doesn't work for me. I thought I had a passing test suite though so I'm not sure what happened

@lornajane
Copy link
Contributor Author

On my local platform the test was working (but the hash isn't known as good) until c263dec when it looks like we fixed something but it caused the templates to stop working ... only on my platform though if the main build isn't failing and @ralsina clearly thought he had fixed it! I am not sure what to do next as this is now the only thing blocking this issue (I think?)

@lornajane lornajane changed the title [WIP] HTML version of the manual HTML version of the manual Jan 12, 2019
@akrabat akrabat merged commit 347256a into rst2pdf:master Jan 17, 2019
akrabat added a commit that referenced this pull request Jan 17, 2019
@akrabat akrabat added this to the 0.94 milestone Jan 17, 2019
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.

None yet

3 participants