Skip to content

DEPRECATED: Notes on testing metanorma

Jo Cook edited this page Jan 16, 2023 · 1 revision

Initial setup

Installed pandoc and cloned this repo:

apt install pandoc
git clone [email protected]:agiorguk/gemini.git
cd gemini/pending/june2021
pandoc datasets.htm -f html -t asciidoc -o datasets.adoc

Grabbed the metanorma docker image and ran with required options

docker pull metanorma/metanorma
docker run -v "$(pwd)":/metanorma/ -w /metanorma metanorma/metanorma metanorma compile -t {flavor} -x {output-formats} {my-document-path}

Where:

So our command line becomes:

docker run -v "$(pwd)":/metanorma/ -w /metanorma metanorma/metanorma metanorma compile -t iso -x html *.adoc --agree-to-terms

On first run (?) I had to add —agree-to-terms so that it would download the necessary iso fonts

Output generates the following:

  • datasets.err
  • datasets.html
  • datasets.presentation.xml

Let's try with a custom flavor!

Get generic metanorma.yml from https://www.metanorma.org/builder/topics/simple-adoption/

Edit metanorma.yml to set org short name, long name and logo. I left the name of the flavor as generic so that I didn't have to faff around with ruby

First run generates a lot of errors. Errors reference the xml file that's generated. I can't seem to get it to pick up metanorma.yml- what's generated shows the default values for everything despite adding a :customize: metanorma.yml element under the title line in the asciidoc.

Testing reverse_adoc for conversion

gem install reverse_adoc
gem pristine ffi --version 1.12.2 # to get around an error
reverse_adoc datasets.htm > datasets.adoc

Ah ha! The space before :customize: metanorma.yml is important!

Outdated

See https://github.com/agiorguk/gemini/wiki/Draft:-Generating-documentation-using-a-%22generic-flavour%22-of-Metanorma for working approach. The information below is kept for reference only.

But compilation still fails with errors relating to https://github.com/metanorma/isodoc/blob/50ab2fb176858451be24ef0120d55ba086a5b92a/lib/isodoc/css.rb#L78

Using the iso flavour works but generic does not. It also doesn't seem to matter which metanorma container I use.

We can get to the command line of the running container using the following:

docker run -it --entrypoint bash -v "$(pwd)":/metanorma/ metanorma/mn-ubuntu

However, nothing I tried inside the container to install the sassc gem worked at all so I submitted this GitHub issue: https://github.com/metanorma/metanorma-docker/issues/119