diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b3c24b91..d294f641 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -88,13 +88,12 @@ tests:jessie: build:doc: stage: build - image: python:slim + image: python:alpine before_script: - - pip install -r doc/requirements.txt + - apk add make script: - cd doc - - mkdocs build -s - - htmlark public_html/print_page/index.html -o LdapSaisie.html + - make public_html LdapSaisie.html artifacts: paths: - doc/public_html/ @@ -113,6 +112,22 @@ build:doc:pdf: paths: - doc/LdapSaisie.pdf +build:doc:epub: + stage: build + image: + name: pandoc/core + entrypoint: ["/bin/sh", "-c"] + needs: + - build:doc + before_script: + - apk add make + script: + - cd doc + - make LdapSaisie.epub + artifacts: + paths: + - doc/LdapSaisie.epub + deploy:doc: stage: deploy image: alpine:latest @@ -124,5 +139,4 @@ deploy:doc: - echo "$SSH_HOST_KEY" | base64 -d > ~/.ssh/known_hosts script: - rsync -atv --exclude '.git*' --delete --progress ./doc/public_html/ $SSH_USER@$SSH_HOST:./ - - rsync -atv ./doc/LdapSaisie.html $SSH_USER@$SSH_HOST:LdapSaisie.html - - rsync -atv ./doc/LdapSaisie.pdf $SSH_USER@$SSH_HOST:LdapSaisie.pdf + - rsync -atv ./doc/LdapSaisie.html ./doc/LdapSaisie.pdf ./doc/LdapSaisie.epub $SSH_USER@$SSH_HOST:./ diff --git a/doc/.gitignore b/doc/.gitignore index f46ff6dd..1cb7c665 100644 --- a/doc/.gitignore +++ b/doc/.gitignore @@ -1,4 +1,5 @@ public_html LdapSaisie.html LdapSaisie.pdf +LdapSaisie.epub venv diff --git a/doc/Makefile b/doc/Makefile index 627f2dcf..1af7eece 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -12,9 +12,23 @@ LdapSaisie.html: venv public_html LdapSaisie.pdf: venv LdapSaisie.html docker run -v $(CURDIR):/workspace pink33n/html-to-pdf --url file:///workspace/LdapSaisie.html --pdf LdapSaisie.pdf +LdapSaisie.epub: venv LdapSaisie.html + pandoc LdapSaisie.html \ + -f html \ + --toc \ + --standalone \ + --top-level-division=chapter \ + --highlight-style style/pygments.theme \ + --css style/epub.css \ + --metadata=title:"Documentation LdapSaisie" \ + --metadata=author:"Benjamin Renard" \ + --metadata=lang:"fr-FR" \ + --metadata=cover-image:"../src/images/default/logo.png" \ + -o LdapSaisie.epub + venv: python3 -m venv venv venv/bin/python -m pip install -r requirements.txt clean: - rm -fr venv public_html LdapSaisie.html + rm -fr venv public_html LdapSaisie.html LdapSaisie.pdf LdapSaisie.epub diff --git a/doc/style/epub.css b/doc/style/epub.css new file mode 100644 index 00000000..b77aba38 --- /dev/null +++ b/doc/style/epub.css @@ -0,0 +1,142 @@ +/* This defines styles and classes used in the book */ +/* body { margin: 5%; text-align: justify; font-size: medium; } +code { font-family: monospace; } +h1 { text-align: left; } +h2 { text-align: left; } +h3 { text-align: left; } */ +h4 { text-align: left; } +h5 { text-align: left; } +h6 { text-align: left; } +h1.title { } +h2.author { } +h3.date { } +nav#toc ol, +nav#landmarks ol { padding: 0; margin-left: 1em; } +nav#toc ol li, +nav#landmarks ol li { list-style-type: none; margin: 0; padding: 0; } +a.footnote-ref { vertical-align: super; } +em, em em em, em em em em em { font-style: italic;} +em em, em em em em { font-style: normal; } +/* code{ white-space: pre-wrap; } */ +span.smallcaps{ font-variant: small-caps; } +span.underline{ text-decoration: underline; } +q { quotes: "“" "”" "‘" "’"; } +div.column{ display: inline-block; vertical-align: top; width: 50%; } +div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} + +body { + font-family: "DejaVu Serif", serif; + margin: 5% 5% 20% 5%; + text-align: justify; + font-size: 0.75em; + line-height: 1.5; +} + +h1 { + text-align: left; + font-size: 2em; +} + +h2 { + text-align: left; +} + +h3 { + text-align: left; +} + +h1.title { + text-align: center; +} + +p.author { + text-align: center; +} + +code { + font-family: "DejaVu Sans Mono", monospace; + background-color: #ebebeb; + font-size: 100%; + line-height: inherit; + white-space: pre-wrap; +} + +pre { + font-family: "DejaVu Sans Mono", monospace; + padding: 1em; + overflow: auto; + font-size: 100%; + line-height: inherit; + border-radius: 0.25em; + background-color: #ebebeb; + white-space: pre-wrap; +} + +table { + border-collapse: collapse; + font-size: 100%; +} + +th, td { + padding: 0.8em; +} + +table, th, td { + border: 0.06em solid black; +} + +a { + text-decoration: none; +} + +blockquote { + border-style: solid solid solid solid; + border-color: #a41434; + border-width: medium; + border-radius: 0.5em; + padding-left: 1em; + padding-right: 1em; + background-color: #fcecf4; +} + +@media screen { /* Workaround for iBooks issue; see #6242 */ + .sourceCode { + overflow: visible !important; + white-space: pre-wrap !important; + } +} + +/* + * Warning / Important / Note + */ +.admonition { + border: .05rem solid #448aff; + border-radius: .2rem; + font-size: .64rem; + margin: 1.5625em 0; + padding: 0 .6rem; + page-break-inside: avoid; +} + +.admonition p:first-of-type { + font-weight: bold; + padding: .6rem; + margin: 0 -.6rem; + background-color: #448aff1a; +} + +.admonition.warning { + border-color: #ff9100; +} + +.admonition.warning p:first-of-type { + background-color: #ff91001a; +} + +.admonition.note { + border-color: #448aff; +} + +.admonition.note p:first-of-type { + background-color: #448aff1a; +} diff --git a/doc/style/pygments.theme b/doc/style/pygments.theme new file mode 100644 index 00000000..354a451e --- /dev/null +++ b/doc/style/pygments.theme @@ -0,0 +1,211 @@ +{ + "text-color": null, + "background-color": null, + "line-number-color": "#aaaaaa", + "line-number-background-color": null, + "text-styles": { + "Alert": { + "text-color": "#ff0000", + "background-color": null, + "bold": true, + "italic": false, + "underline": false + }, + "Annotation": { + "text-color": "#60a0b0", + "background-color": null, + "bold": true, + "italic": true, + "underline": false + }, + "Attribute": { + "text-color": "#7d9029", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "BaseN": { + "text-color": "#40a070", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "BuiltIn": { + "text-color": "#008000", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Char": { + "text-color": "#4070a0", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Comment": { + "text-color": "#60a0b0", + "background-color": null, + "bold": false, + "italic": true, + "underline": false + }, + "CommentVar": { + "text-color": "#60a0b0", + "background-color": null, + "bold": true, + "italic": true, + "underline": false + }, + "Constant": { + "text-color": "#880000", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "ControlFlow": { + "text-color": "#007020", + "background-color": null, + "bold": true, + "italic": false, + "underline": false + }, + "DataType": { + "text-color": "#902000", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "DecVal": { + "text-color": "#40a070", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Documentation": { + "text-color": "#ba2121", + "background-color": null, + "bold": false, + "italic": true, + "underline": false + }, + "Error": { + "text-color": "#ff0000", + "background-color": null, + "bold": true, + "italic": false, + "underline": false + }, + "Extension": { + "text-color": null, + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Float": { + "text-color": "#40a070", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Function": { + "text-color": "#06287e", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Import": { + "text-color": "#008000", + "background-color": null, + "bold": true, + "italic": false, + "underline": false + }, + "Information": { + "text-color": "#60a0b0", + "background-color": null, + "bold": true, + "italic": true, + "underline": false + }, + "Keyword": { + "text-color": "#007020", + "background-color": null, + "bold": true, + "italic": false, + "underline": false + }, + "Operator": { + "text-color": "#666666", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Other": { + "text-color": "#007020", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Preprocessor": { + "text-color": "#bc7a00", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "SpecialChar": { + "text-color": "#4070a0", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "SpecialString": { + "text-color": "#bb6688", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "String": { + "text-color": "#4070a0", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Variable": { + "text-color": "#19177c", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "VerbatimString": { + "text-color": "#4070a0", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Warning": { + "text-color": "#60a0b0", + "background-color": null, + "bold": true, + "italic": true, + "underline": false + } + } +}