These documents belong to Project PLATEAU by MLIT.
sources/
-
source of the documents
sources/001-v4/
-
PLATEAU Handbook #01 source, v4.
sources/001-v4/iur/
-
i-UR data. Downloaded from here: https://www.chisou.go.jp/tiiki/toshisaisei/itoshisaisei/iur/index.html (see #128)
sources/002-v4/
-
PLATEAU Handbook #02 source, v4.
reference-docs/
-
Reference documents.
_site/
-
(automatically generated, in the
gh-pages
branch) published document. collection.yml
-
The PLATEAU Handbook collection of 001 and 002. After compilation the output will be at
index.html
.
The easy way if you install locally:
git clone https://github.com/metanorma/mn-samples-plateau/
bundle
bundle exec metanorma sources/001-v4/document.adoc
# => sources/001-v4/document.{html,xml,pdf}
bundle exec metanorma sources/001-v4/document.adoc # or whichever document
This command outputs the built document at:
-
sources/001-v4/document.{html,pdf,xml}
bundle exec metanorma site generate
This command creates _site/
. The HTML entry point is at _site/index.html
.
Warning
|
There is NO NEED to convert the original HTML documents to Metanorma. This is only historic information, and the commands have already been changed. |
Steps:
-
Install
coradoc
(runbundle install
) -
Obtain the
index.html
from https://www.mlit.go.jp/plateaudocument02/ -
Load the page entirely, and then copy/paste the HTML DOM content into a new
index.html
file. -
Run the
reverse_adoc
command:
$ bundle exec reverse_adoc -rcoradoc/reverse_adoc/plugins/plateau --split-sections 2 --external-images -o sources/001-v4/document.adoc reference-docs/plateau-document-01-v4.html
$ bundle exec reverse_adoc -rcoradoc/reverse_adoc/plugins/plateau --split-sections 2 --external-images -o sources/002-v4/document.adoc reference-docs/plateau-document-02-v4.html
Where:
reference-docs/plateau-document-01.html
-
is the input document
-o plateau-document-01/index.adoc
-
is the output document path
--split-sections
-
means to split files at Clause level 2
--external-images
-
means to extract out all images to separate files
-rcoradoc/reverse_adoc/plugins/plateau
-
applies Plateau-specific conversions
Some PLATEAU documents utilize webp images.
Due to #7 , the PDF renderer we use, Apache FOP, does not support webp images.
Hence at import we have to convert all webp images into PNG.
Converting with parallel processing: (if you have GNU Parallel)
$ parallel dwebp {} -o {}.png ::: *.webp
Converting sequentially:
$ find . -name "*.webp" -exec dwebp \{} -o \{}.png
Updating the files to refer to the new .png
files:
sed -i '' 's/\.webp/.webp.png/g' sources/001-v3/sections/*.adoc
If you have installed the build tools locally, and wish to run the locally-installed compilation tools, there is nothing further to set.
If you don’t want to deal with local dependencies, use the docker:
docker run -v "$(pwd)":/metanorma -w /metanorma -it metanorma/metanorma metanorma site generate