MapStore2 icon indicating copy to clipboard operation
MapStore2 copied to clipboard

#8371: Documentation export as pdf

Open dsuren1 opened this issue 3 years ago • 7 comments

Description

This PR adds support for documentation export as PDF

Changes done

  • Modified hyperlinks such that it works in both html and exported PDF file
  • Replaced mermaid diagrams with png as mermaid diagrams cannot be exported to PDF (no plugin support)
  • Documentation is downloaded with default name mapstore_documentation.pdf
  • Added new plugin mkdocs-pdf-export-plugin (forked with fix for relatives hrefs)
  • Dependency libraries added Markdown and WeasyPrint
  • Exported document has combined pages of all md files

Please check if the PR fulfills these requirements

  • [x] The commit message follows our guidelines: https://github.com/geosolutions-it/MapStore2/blob/master/CONTRIBUTING.md
  • [x] Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce? (check one with "x", remove the others)

  • [x] Feature

Issue

What is the current behavior? #8371

What is the new behavior? Document can be exported as PDF via a small export icon on top of all the pages image

Sample can be found here: https://mapstore2-temp.readthedocs.io/en/latest/

Breaking change

Does this PR introduce a breaking change? (check one with "x", remove the other)

  • [ ] Yes, and I documented them in migration notes
  • [x] No

Other useful information

dsuren1 avatar Aug 01 '22 13:08 dsuren1

@dsuren1 I suggest also to use https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint to check syntax of the markdown

MV88 avatar Aug 02 '22 07:08 MV88

@MV88

  • [ ] i don't know why it is building here since locally i have some problems like
  • [ ] links in docs/index.md fails in exported pdf

Unfortunately, I don't see this error and also if you use the built docs from this PR https://mapstore--8455.org.readthedocs.build/en/8455/. Downloading PDF has index.md page, and is exported to PDF and the link in home.md Managing Users and Groups section works fine.

This is the pdf downloaded from the doc built in the PR

  • [ ] syntax is wrong see

I will modify this. But in my defense, I have only modified the href that has reference in another section of md file which doesn't work in the exported pdf, so I left the other ones untouched.

  • [ ] can you add or improve needed changes in order to build the docs locally, maybe we can improve it here?

Sure, I can add some guidelines

dsuren1 avatar Aug 03 '22 06:08 dsuren1

I will modify this. But in my defense, I have only modified the href that has reference in another section of md file which doesn't work in the exported pdf, so I left the other ones untouched.

we can open a dedicated issue for this, please ignore

MV88 avatar Aug 03 '22 07:08 MV88

I will modify this. But in my defense, I have only modified the href that has reference in another section of md file which doesn't work in the exported pdf, so I left the other ones untouched.

we can open a dedicated issue for this, please ignore

Sure. Thanks. But I have updated this alone for now.

dsuren1 avatar Aug 03 '22 07:08 dsuren1

Downloading PDF has index.md page, and is exported to PDF and the link in home.md Managing Users and Groups section works fine.

try to click over here in page 2 image

https://user-images.githubusercontent.com/11991428/182552098-32c4d9ac-0582-4347-9042-136273694aec.mp4

please check if other internal links are broken (basically by clicking on all links :)

MV88 avatar Aug 03 '22 07:08 MV88

@MV88 I have fixed all the broken internal links and also updated documentation guideline accordingly with a note.

dsuren1 avatar Aug 03 '22 08:08 dsuren1

@MV88 can you please complete the review?

tdipisa avatar Aug 08 '22 12:08 tdipisa

@dsuren1 pr is conflicting please resolve it when you can

MV88 avatar Aug 17 '22 15:08 MV88

@ElenaGallo testable in DEV

MV88 avatar Aug 19 '22 08:08 MV88

Test passed @dsuren1 please backport to the stable branch.

ElenaGallo avatar Aug 19 '22 16:08 ElenaGallo