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

feature suggest: best practices with .pdf export #198

Open
nbehrnd opened this issue Oct 21, 2022 · 2 comments
Open

feature suggest: best practices with .pdf export #198

nbehrnd opened this issue Oct 21, 2022 · 2 comments
Labels
build: sphinx Related to building the page with sphinx section: learn Relevant for the learn section on the webpage

Comments

@nbehrnd
Copy link

nbehrnd commented Oct 21, 2022

Though the content likely is equally available via GitHub, I would like to suggest that the compilation of «Fortran Best Practices» equally becomes available as export to .pdf. This is an option seen e.g., with «normal» entries in the Wikipedia, as well as for their wikibooks:

2022-10-21_fortran_lang_suggest

(screenphoto of https://en.wikibooks.org/wiki/Fortran/Printable_version)

The example of wikipedia demonstrates that the already present discern between the documentation per sé and snippets of code -- including syntax highlighting -- may be preserved.

@awvwgk
Copy link
Member

awvwgk commented Oct 21, 2022

Sphinx can export to LaTeX and subsequently to PDF, most of the styling features, like bootstrap CSS, however won't be available there, but we are not using many fancy directives in the learn section. Also, I believe it would export the whole page as one PDF by default, so we would have to exclude everything but the learn section if we are using the PDF backend (similar in idea in #173 to append to the exclude list based on the builder).

@awvwgk awvwgk added build: sphinx Related to building the page with sphinx section: learn Relevant for the learn section on the webpage labels Oct 21, 2022
@nbehrnd
Copy link
Author

nbehrnd commented Oct 25, 2022

I just recognize pandoc and (g)roff might be used to generate .pdf out of .md (an example). The syntax highlighting (pandoc --list-highlighted-languages) offered has got separate entries fortranfixed and fortranfree, so per sé one could imagine something in line of

#!/usr/bin/bash

for file in *.md;
do
  base=$(basename "$file");
  output=${base//\.md/};
  echo 'work on file' "$file";

  pandoc -Tpdf -t ms "$file" -o "$output".pdf;
done

To build a .pdf as e.g., the .zip below about the .md of section «best_practices». True, there however are at least two points already seen which would require improvement:

  • instead of a concatenation of individual .pdf (e.g., pdftk), I would like to merge the content already on the level of the individual .md files.
  • according to the log (included) some input characters are not properly recognized (yet). This is e.g., about the superscript minus in exponents of floating_point.md when describing the numeric ranges.
  • adjustment of the the format (ISO A4 as a complementary format to letter US, etc.)

2022-10-25_best_practices.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build: sphinx Related to building the page with sphinx section: learn Relevant for the learn section on the webpage
Projects
None yet
Development

No branches or pull requests

2 participants