89 lines
1.9 KiB
Markdown
89 lines
1.9 KiB
Markdown
# Proxmox Book
|
|
|
|
## How to
|
|
|
|
### Generate PDF with basic theme
|
|
|
|
```bash
|
|
docker run -v $PWD:/src asciidoctor/docker-asciidoctor /usr/bin/asciidoctor-pdf\
|
|
/src/src/book.adoc \
|
|
-a pdf-theme=/src/theme/basic-theme.yml \
|
|
-D /src/output
|
|
```
|
|
|
|
### Generate PDF with diagrams
|
|
|
|
```bash
|
|
sudo docker run -v $PWD:/src asciidoctor/docker-asciidoctor /usr/bin/asciidoctor-pdf -r asciidoctor-diagram /src/mkt.adoc -a
|
|
pdf-theme=/src/theme/basic-theme.yml -D /src/output
|
|
```
|
|
|
|
### Generate DOCX
|
|
|
|
```bash
|
|
INPUT_ADOC=mkt.adoc
|
|
asciidoctor --backend docbook --out-file - $INPUT_ADOC| \
|
|
pandoc --from docbook --to docx --output $INPUT_ADOC.docx
|
|
|
|
# On the Mac, this will open the generated file in MS Word
|
|
open $INPUT_ADOC.docx
|
|
```
|
|
|
|
```bash
|
|
INPUT_ADOC=mkt.adoc
|
|
sudo docker run -v $PWD:/src asciidoctor/docker-asciidoctor -r asciidoctor-diagram /usr/bin/asciidoctor-pdf --backend docbook --out-file - $INPUT_ADOC| \
|
|
pandoc --from docbook --to docx --output $INPUT_ADOC.docx
|
|
|
|
# On the Mac, this will open the generated file in MS Word
|
|
open $INPUT_ADOC.docx
|
|
```
|
|
|
|
|
|
|
|
## Convert html to images
|
|
|
|
This are some custom scripts to create and embed Images from Code Diagrams in adoc.
|
|
|
|
use volta for npm vesion manager
|
|
|
|
```shell
|
|
curl https://get.volta.sh | bash
|
|
volta install node@latest
|
|
```
|
|
|
|
gem install asciidoctor-pdf --pre
|
|
npm install puppeteer
|
|
npx puppeteer browsers install chrome
|
|
|
|
|
|
run
|
|
|
|
```shell
|
|
asciidoctor --require ./snippet_to_image.rb --backend pdf chapter_22-formats-whats-important-per-format.adoc -o test.docx
|
|
```
|
|
|
|
|
|
sudo apt install pandoc -y
|
|
|
|
|
|
use python instead of ruby
|
|
|
|
python process.py chapter_22-formats-whats-important-per-format.adoc
|
|
|
|
|
|
## install d2 for diagrams
|
|
|
|
```shell
|
|
sudo apt install build-essential
|
|
curl -fsSL https://d2lang.com/install.sh | sh -s --
|
|
```
|
|
|
|
Codes for themes for d2 diagrams are in https://d2lang.com/tour/themes
|
|
|
|
you use them this way
|
|
|
|
[d2, format=svg, layout=dagre, theme=0]
|
|
|
|
that would be theme neutral.
|
|
|