metanorma-cc 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.github/workflows/macos.yml +39 -0
- data/.github/workflows/ubuntu.yml +53 -0
- data/.github/workflows/windows.yml +41 -0
- data/.gitignore +1 -0
- data/.hound.yml +3 -0
- data/.rubocop.yml +10 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +11 -0
- data/LICENSE +25 -0
- data/README.adoc +61 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/rspec +18 -0
- data/bin/setup +8 -0
- data/docs/navigation.adoc +8 -0
- data/docs/quickstart.adoc +368 -0
- data/lib/asciidoctor/cc.rb +5 -0
- data/lib/asciidoctor/cc/basicdoc.rng +1059 -0
- data/lib/asciidoctor/cc/biblio.rng +1237 -0
- data/lib/asciidoctor/cc/boilerplate.xml +46 -0
- data/lib/asciidoctor/cc/cc.rng +116 -0
- data/lib/asciidoctor/cc/converter.rb +69 -0
- data/lib/asciidoctor/cc/front.rb +93 -0
- data/lib/asciidoctor/cc/isodoc.rng +1504 -0
- data/lib/asciidoctor/cc/reqt.rng +194 -0
- data/lib/asciidoctor/cc/validate.rb +29 -0
- data/lib/asciidoctor/cc/validate_section.rb +138 -0
- data/lib/isodoc/cc/base_convert.rb +42 -0
- data/lib/isodoc/cc/csd.standard.xsl +3228 -0
- data/lib/isodoc/cc/html/_coverpage.scss +128 -0
- data/lib/isodoc/cc/html/cc.scss +763 -0
- data/lib/isodoc/cc/html/dots-w@2x.png +0 -0
- data/lib/isodoc/cc/html/dots@2x.png +0 -0
- data/lib/isodoc/cc/html/header.html +240 -0
- data/lib/isodoc/cc/html/html_cc_intro.html +8 -0
- data/lib/isodoc/cc/html/html_cc_titlepage.html +93 -0
- data/lib/isodoc/cc/html/htmlstyle.scss +409 -0
- data/lib/isodoc/cc/html/scripts.html +71 -0
- data/lib/isodoc/cc/html/word_cc_intro.html +19 -0
- data/lib/isodoc/cc/html/word_cc_titlepage.html +64 -0
- data/lib/isodoc/cc/html/wordstyle.scss +1157 -0
- data/lib/isodoc/cc/html_convert.rb +51 -0
- data/lib/isodoc/cc/metadata.rb +62 -0
- data/lib/isodoc/cc/pdf_convert.rb +21 -0
- data/lib/isodoc/cc/presentation_xml_convert.rb +10 -0
- data/lib/isodoc/cc/word_convert.rb +38 -0
- data/lib/metanorma-cc.rb +11 -0
- data/lib/metanorma/cc.rb +29 -0
- data/lib/metanorma/cc/processor.rb +53 -0
- data/lib/metanorma/cc/version.rb +5 -0
- data/metanorma-cc.gemspec +43 -0
- metadata +253 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 56fef26c5b91b3bee1ea7a6ee062a171358e56ab8e64745d81b9ff16ede6f32d
|
4
|
+
data.tar.gz: 66eef153e867f2e5854c207059efa4bca7ffc1d5753a990f191711b1092ecf0e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 4296a74e2a8118436c957b6838230b7aaeda4dd8ee6a3319f4b9653c6557b847e01c2ca0bf8419b3bae30f09000b823a4a2cc2013a67302acea7c1e96c7a7a52
|
7
|
+
data.tar.gz: 36dd42a00a2eb5ba70264ea0871a936f6174dbf3ec1938047f063e21a1dbe70439853445a3c418a6d72d63dee2c20b969781cd14b9d5107cfaf17dd23c70708b
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# Auto-generated by Cimas: Do not edit it manually!
|
2
|
+
# See https://github.com/metanorma/cimas
|
3
|
+
name: macos
|
4
|
+
|
5
|
+
on:
|
6
|
+
push:
|
7
|
+
branches: [ master ]
|
8
|
+
pull_request:
|
9
|
+
paths-ignore:
|
10
|
+
- .github/workflows/ubuntu.yml
|
11
|
+
- .github/workflows/windows.yml
|
12
|
+
|
13
|
+
jobs:
|
14
|
+
test-macos:
|
15
|
+
name: Test on Ruby ${{ matrix.ruby }} macOS
|
16
|
+
runs-on: macos-latest
|
17
|
+
continue-on-error: ${{ matrix.experimental }}
|
18
|
+
strategy:
|
19
|
+
fail-fast: false
|
20
|
+
matrix:
|
21
|
+
ruby: [ '2.6', '2.5', '2.4' ]
|
22
|
+
experimental: [false]
|
23
|
+
include:
|
24
|
+
- ruby: '2.7'
|
25
|
+
experimental: true
|
26
|
+
steps:
|
27
|
+
- uses: actions/checkout@master
|
28
|
+
- name: Use Ruby
|
29
|
+
uses: actions/setup-ruby@v1
|
30
|
+
with:
|
31
|
+
ruby-version: ${{ matrix.ruby }}
|
32
|
+
architecture: 'x64'
|
33
|
+
- name: Update gems
|
34
|
+
run: |
|
35
|
+
sudo gem install bundler --force
|
36
|
+
bundle install --jobs 4 --retry 3
|
37
|
+
- name: Run specs
|
38
|
+
run: |
|
39
|
+
bundle exec rake
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# Auto-generated by Cimas: Do not edit it manually!
|
2
|
+
# See https://github.com/metanorma/cimas
|
3
|
+
name: ubuntu
|
4
|
+
|
5
|
+
on:
|
6
|
+
push:
|
7
|
+
branches: [ master ]
|
8
|
+
tags:
|
9
|
+
- '*'
|
10
|
+
pull_request:
|
11
|
+
paths-ignore:
|
12
|
+
- .github/workflows/macos.yml
|
13
|
+
- .github/workflows/windows.yml
|
14
|
+
|
15
|
+
jobs:
|
16
|
+
test-linux:
|
17
|
+
name: Test on Ruby ${{ matrix.ruby }} Ubuntu
|
18
|
+
runs-on: ubuntu-latest
|
19
|
+
continue-on-error: ${{ matrix.experimental }}
|
20
|
+
strategy:
|
21
|
+
fail-fast: false
|
22
|
+
matrix:
|
23
|
+
ruby: [ '2.6', '2.5', '2.4' ]
|
24
|
+
experimental: [false]
|
25
|
+
include:
|
26
|
+
- ruby: '2.7'
|
27
|
+
experimental: true
|
28
|
+
steps:
|
29
|
+
- uses: actions/checkout@master
|
30
|
+
- name: Use Ruby
|
31
|
+
uses: actions/setup-ruby@v1
|
32
|
+
with:
|
33
|
+
ruby-version: ${{ matrix.ruby }}
|
34
|
+
architecture: 'x64'
|
35
|
+
- name: Update gems
|
36
|
+
run: |
|
37
|
+
gem install bundler
|
38
|
+
bundle install --jobs 4 --retry 3
|
39
|
+
- name: Run specs
|
40
|
+
run: |
|
41
|
+
bundle exec rake
|
42
|
+
- name: Trigger dependent repositories
|
43
|
+
if: github.ref == 'refs/heads/master' && matrix.ruby == '2.6'
|
44
|
+
env:
|
45
|
+
GH_USERNAME: ${{ secrets.PAT_USERNAME }}
|
46
|
+
GH_ACCESS_TOKEN: ${{ secrets.PAT_TOKEN }}
|
47
|
+
run: |
|
48
|
+
curl -LO --retry 3 https://raw.githubusercontent.com/metanorma/metanorma-build-scripts/master/trigger-gh-actions.sh
|
49
|
+
[[ -f ".github/workflows/dependent_repos.env" ]] && source .github/workflows/dependent_repos.env
|
50
|
+
for repo in $DEPENDENT_REPOS
|
51
|
+
do
|
52
|
+
sh trigger-gh-actions.sh $ORGANISATION $repo $GH_USERNAME $GH_ACCESS_TOKEN $GITHUB_REPOSITORY "{ \"ref\": \"${GITHUB_REF}\" }"
|
53
|
+
done
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# Auto-generated by Cimas: Do not edit it manually!
|
2
|
+
# See https://github.com/metanorma/cimas
|
3
|
+
name: windows
|
4
|
+
|
5
|
+
on:
|
6
|
+
push:
|
7
|
+
branches: [ master ]
|
8
|
+
pull_request:
|
9
|
+
paths-ignore:
|
10
|
+
- .github/workflows/macos.yml
|
11
|
+
- .github/workflows/ubuntu.yml
|
12
|
+
|
13
|
+
jobs:
|
14
|
+
test-windows:
|
15
|
+
name: Test on Ruby ${{ matrix.ruby }} Windows
|
16
|
+
runs-on: windows-latest
|
17
|
+
continue-on-error: ${{ matrix.experimental }}
|
18
|
+
strategy:
|
19
|
+
fail-fast: false
|
20
|
+
matrix:
|
21
|
+
ruby: [ '2.6', '2.5', '2.4' ]
|
22
|
+
experimental: [false]
|
23
|
+
include:
|
24
|
+
- ruby: '2.7'
|
25
|
+
experimental: true
|
26
|
+
steps:
|
27
|
+
- uses: actions/checkout@master
|
28
|
+
- name: Use Ruby
|
29
|
+
uses: actions/setup-ruby@v1
|
30
|
+
with:
|
31
|
+
ruby-version: ${{ matrix.ruby }}
|
32
|
+
architecture: 'x64'
|
33
|
+
- name: Update gems
|
34
|
+
shell: pwsh
|
35
|
+
run: |
|
36
|
+
gem install bundler
|
37
|
+
bundle config --local path vendor/bundle
|
38
|
+
bundle install --jobs 4 --retry 3
|
39
|
+
- name: Run specs
|
40
|
+
run: |
|
41
|
+
bundle exec rake
|
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
.DS_Store
|
data/.hound.yml
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
# This project follows the Ribose OSS style guide.
|
2
|
+
# https://github.com/riboseinc/oss-guides
|
3
|
+
# All project-specific additions and overrides should be specified in this file.
|
4
|
+
|
5
|
+
inherit_from:
|
6
|
+
- https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
|
7
|
+
AllCops:
|
8
|
+
TargetRubyVersion: 2.3
|
9
|
+
Rails:
|
10
|
+
Enabled: true
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at ronald.tse@ribose.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
Encoding.default_external = Encoding::UTF_8
|
2
|
+
Encoding.default_internal = Encoding::UTF_8
|
3
|
+
|
4
|
+
source "https://rubygems.org"
|
5
|
+
git_source(:github) { |repo| "https://github.com/#{repo}" }
|
6
|
+
|
7
|
+
gemspec
|
8
|
+
|
9
|
+
if File.exist? 'Gemfile.devel'
|
10
|
+
eval File.read('Gemfile.devel'), nil, 'Gemfile.devel' # rubocop:disable Security/Eval
|
11
|
+
end
|
data/LICENSE
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
BSD 2-Clause License
|
2
|
+
|
3
|
+
Copyright (c) 2018, Ribose
|
4
|
+
All rights reserved.
|
5
|
+
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
8
|
+
|
9
|
+
* Redistributions of source code must retain the above copyright notice, this
|
10
|
+
list of conditions and the following disclaimer.
|
11
|
+
|
12
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
14
|
+
and/or other materials provided with the distribution.
|
15
|
+
|
16
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
17
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
18
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
19
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
20
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
21
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
22
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
23
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
24
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
25
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/README.adoc
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
= metanorma-cc: Metanorma processor for CalConnect standards
|
2
|
+
|
3
|
+
image:https://img.shields.io/gem/v/metanorma-cc.svg["Gem Version", link="https://rubygems.org/gems/metanorma-cc"]
|
4
|
+
image:https://github.com/metanorma/metanorma-cc/workflows/macos/badge.svg["Build Status (macOS)", link="https://github.com/metanorma/metanorma-cc/actions?workflow=macos"]
|
5
|
+
image:https://github.com/metanorma/metanorma-cc/workflows/ubuntu/badge.svg["Build Status (ubuntu)", link="https://github.com/metanorma/metanorma-cc/actions?workflow=ubuntu"]
|
6
|
+
image:https://github.com/metanorma/metanorma-cc/workflows/windows/badge.svg["Build Status (Windows)", link="https://github.com/metanorma/metanorma-cc/actions?workflow=windows"]
|
7
|
+
image:https://codeclimate.com/github/metanorma/metanorma-cc/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/metanorma/metanorma-cc"]
|
8
|
+
image:https://img.shields.io/github/issues-pr-raw/metanorma/metanorma-cc.svg["Pull Requests", link="https://github.com/metanorma/metanorma-cc/pulls"]
|
9
|
+
image:https://img.shields.io/github/commits-since/metanorma/metanorma-cc/latest.svg["Commits since latest",link="https://github.com/metanorma/metanorma-cc/releases"]
|
10
|
+
|
11
|
+
_Formerly known as_ `asciidoctor-csd`, `metanorma-csd`.
|
12
|
+
|
13
|
+
== Functionality
|
14
|
+
|
15
|
+
This gem processes http://asciidoctor.org/[Asciidoctor] documents following
|
16
|
+
the Metanorma model for generating CalConnect Standards.
|
17
|
+
|
18
|
+
The gem currently inherits from the https://github.com/metanorma/metanorma-standoc
|
19
|
+
gem, and aligns closely to it. Refer to https://metanorma.com[] for guidance.
|
20
|
+
|
21
|
+
== Usage
|
22
|
+
|
23
|
+
The preferred way to invoke this gem is via the `metanorma` script:
|
24
|
+
|
25
|
+
[source,console]
|
26
|
+
----
|
27
|
+
$ metanorma --type cc a.adoc # output HTML and PDF
|
28
|
+
$ metanorma --type cc --extensions html a.adoc # output just HTML
|
29
|
+
$ metanorma --type cc --extensions pdf a.adoc # output just PDF
|
30
|
+
$ metanorma --type cc --extensions xml a.adoc # output Metanorma XML
|
31
|
+
----
|
32
|
+
|
33
|
+
The gem translates the document into Metanorma XML format, and then
|
34
|
+
validates its output against the CC Metanorma XML document model; errors are
|
35
|
+
reported to console against the XML, and are intended for users to
|
36
|
+
check that they have provided all necessary components of the
|
37
|
+
document.
|
38
|
+
|
39
|
+
The gem then converts the XML into output formats such as HTML and PDF.
|
40
|
+
|
41
|
+
=== Installation
|
42
|
+
|
43
|
+
If you are using a Mac, the https://github.com/metanorma/metanorma-macos-setup
|
44
|
+
repository has instructions on setting up your machine to run Metanorma
|
45
|
+
scripts such as this one. You need only run the following in a Terminal console:
|
46
|
+
|
47
|
+
[source,console]
|
48
|
+
----
|
49
|
+
$ bash <(curl -s https://raw.githubusercontent.com/metanorma/metanorma-macos-setup/master/metanorma-setup)
|
50
|
+
$ gem install metanorma-cc
|
51
|
+
----
|
52
|
+
|
53
|
+
== Documentation
|
54
|
+
|
55
|
+
See https://www.metanorma.com/author/cc/[Author CalConnect documents with Metanorma CC].
|
56
|
+
|
57
|
+
== Examples
|
58
|
+
|
59
|
+
* Example documents are avalable at the https://github.com/metanorma/mn-samples-cc[mn-samples-cc] repository.
|
60
|
+
* Document templates are available at the https://github.com/metanorma/mn-templates-cc[mn-templates-cc] repository.
|
61
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "asciidoctor/csd"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/rspec
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'rspec' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require "pathname"
|
10
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path(
|
11
|
+
"../../Gemfile", Pathname.new(__FILE__).realpath
|
12
|
+
)
|
13
|
+
|
14
|
+
require "rubygems"
|
15
|
+
require "bundler/setup"
|
16
|
+
|
17
|
+
load Gem.bin_path("rspec-core", "rspec")
|
18
|
+
|
data/bin/setup
ADDED
@@ -0,0 +1,368 @@
|
|
1
|
+
= Quickstart Guide for Metanorma-CSD
|
2
|
+
|
3
|
+
Start using Metanorma-CSD to author CalConnect docs in these steps:
|
4
|
+
|
5
|
+
. Get Metanorma running on your machine
|
6
|
+
. Fetch and compile an example Metanorma-CSD document
|
7
|
+
. Modify the document to fit your goals while keeping it valid AsciiCSD
|
8
|
+
|
9
|
+
This guide assumes proficiency with the terminal,
|
10
|
+
and uses the Docker option of running Metanorma
|
11
|
+
(there’re other
|
12
|
+
https://www.metanorma.com/overview/getting-started/[options of installing Metanorma],
|
13
|
+
too).
|
14
|
+
|
15
|
+
|
16
|
+
== Get Metanorma running on your machine
|
17
|
+
|
18
|
+
Assuming you have Docker installed, it’s as easy as:
|
19
|
+
|
20
|
+
[source,console]
|
21
|
+
--
|
22
|
+
docker pull ribose/metanorma
|
23
|
+
--
|
24
|
+
|
25
|
+
|
26
|
+
== Fetch and compile an example Metanorma-CSD document
|
27
|
+
|
28
|
+
We’re going to use the vCard Format Specification sample document here.
|
29
|
+
Clone the Metanorma-CSD repository and change into the directory with the example:
|
30
|
+
|
31
|
+
[source,console]
|
32
|
+
--
|
33
|
+
git clone https://github.com/metanorma/metanorma-csd.git
|
34
|
+
cd /spec/examples/
|
35
|
+
--
|
36
|
+
|
37
|
+
To compile the document, run the Docker container as follows:
|
38
|
+
|
39
|
+
[source,console]
|
40
|
+
--
|
41
|
+
docker run -v "$(pwd)":/metanorma/ -w /metanorma ribose/metanorma metanorma -t csd -x xml,html,pdf,doc rfc6350.adoc
|
42
|
+
--
|
43
|
+
|
44
|
+
NOTE: If you use Metanorma-CLI instead of Docker,
|
45
|
+
http://metanorma.com:4001/software/metanorma-cli/docs/usage/[see how to use the metanorma executable to compile documnts].
|
46
|
+
|
47
|
+
|
48
|
+
== Write valid AsciiCSD
|
49
|
+
|
50
|
+
A Metanorma-CSD is a file in AsciiDoc format with certain extensions
|
51
|
+
specific to Metanorma as a whole and Metanorma-CSD in particular.
|
52
|
+
(We call the format AsciiCSD for short.)
|
53
|
+
|
54
|
+
|
55
|
+
=== AsciiDoc basics
|
56
|
+
|
57
|
+
NOTE: Skip this section if you’re already familiar with AsciiDoc syntax.
|
58
|
+
|
59
|
+
==== Inline formatting
|
60
|
+
|
61
|
+
[source,asciidoc]
|
62
|
+
--
|
63
|
+
*bold emphasis*, _italic emphasis_, `monospace / code snippet`
|
64
|
+
"`Typographic double quotes`", '`typographic single quotes`'
|
65
|
+
Subscript: H~2~O; superscript: E=mc^2^
|
66
|
+
--
|
67
|
+
|
68
|
+
==== Sections, anchors and references
|
69
|
+
|
70
|
+
[source,asciidoc]
|
71
|
+
--
|
72
|
+
== Section 1
|
73
|
+
|
74
|
+
Content (see <<anchor>>)
|
75
|
+
|
76
|
+
== Section 2
|
77
|
+
|
78
|
+
=== Section 2.1
|
79
|
+
|
80
|
+
[[anchor]]
|
81
|
+
==== Section 2.2
|
82
|
+
|
83
|
+
Content 2.2. http://www.calconnect.org/[CalConnect]
|
84
|
+
--
|
85
|
+
|
86
|
+
==== Lists and blocks
|
87
|
+
|
88
|
+
[source,asciidoc]
|
89
|
+
--
|
90
|
+
* Unordered list item 1
|
91
|
+
* Unordered list item 2
|
92
|
+
|
93
|
+
. Ordered list item 1
|
94
|
+
. Ordered list item 2
|
95
|
+
|
96
|
+
Definition list:
|
97
|
+
|
98
|
+
stem:[w]:: is the mass fraction of grains with defects in the test sample;
|
99
|
+
stem:[m_D]:: is the mass, in grams, of grains with that defect;
|
100
|
+
mag:: is the mass, in grams, of the aggregated test sample.
|
101
|
+
--
|
102
|
+
|
103
|
+
==== Tables, figures, footnotes
|
104
|
+
|
105
|
+
A rather complex table:
|
106
|
+
|
107
|
+
[source,adoc]
|
108
|
+
----
|
109
|
+
[[tableD-1]]
|
110
|
+
[cols="<,^,^,^,^",headerrows=2]
|
111
|
+
.Repeatability and reproducibility of husked rice yield
|
112
|
+
|===
|
113
|
+
.2+| Description 4+| Rice sample
|
114
|
+
| Arborio | Drago footnote:[Parboiled rice.] | Balilla | Thaibonnet
|
115
|
+
|
116
|
+
| Number of laboratories retained after eliminating outliers | 13 | 11 | 13 | 13
|
117
|
+
| Mean value, g/100 g | 81,2 | 82,0 | 81,8 | 77,7
|
118
|
+
|===
|
119
|
+
----
|
120
|
+
|
121
|
+
Images (figures) and footnotes:
|
122
|
+
|
123
|
+
[source,adoc]
|
124
|
+
----
|
125
|
+
[[figureC-1]]
|
126
|
+
.Typical gelatinization curve
|
127
|
+
image::images/rice_image2.png[]
|
128
|
+
footnote:[The time stem:[t_90] was estimated to be 18,2 min for this example.]
|
129
|
+
----
|
130
|
+
|
131
|
+
|
132
|
+
==== Admonition blocks, quotes & code listings
|
133
|
+
|
134
|
+
Admonitions (notes, warnings, cautions, etc.) and examples:
|
135
|
+
|
136
|
+
[source,adoc]
|
137
|
+
----
|
138
|
+
NOTE: It is unnecessary to compare rice yield across years.
|
139
|
+
|
140
|
+
[example]
|
141
|
+
5 + 3 = 8
|
142
|
+
----
|
143
|
+
|
144
|
+
Block quotes:
|
145
|
+
|
146
|
+
[source,adoc]
|
147
|
+
----
|
148
|
+
[quote,ISO,"ISO7301,clause 1"]
|
149
|
+
_____
|
150
|
+
This Standard gives the minimum specifications for rice (_Oryza sativa_ L.)
|
151
|
+
_____
|
152
|
+
----
|
153
|
+
|
154
|
+
Source code:
|
155
|
+
|
156
|
+
[source,adoc]
|
157
|
+
----
|
158
|
+
[source,some-lang]
|
159
|
+
------
|
160
|
+
function () -> {}
|
161
|
+
------
|
162
|
+
----
|
163
|
+
|
164
|
+
|
165
|
+
=== Extensions to AsciiDoc
|
166
|
+
|
167
|
+
==== Document header & custom AsciiDoc attributes
|
168
|
+
|
169
|
+
`:docnumber:`: CalConnect document number, as allocated by TCC.
|
170
|
+
|
171
|
+
`:status:`: The status of the document can be one of:
|
172
|
+
|
173
|
+
* proposal
|
174
|
+
* working-draft
|
175
|
+
* committee-draft
|
176
|
+
* draft-standard
|
177
|
+
* final-draft
|
178
|
+
* published
|
179
|
+
* withdrawn
|
180
|
+
|
181
|
+
`:doctype:`: The type of the document can be one of:
|
182
|
+
|
183
|
+
* standard
|
184
|
+
* directive
|
185
|
+
* guide
|
186
|
+
* specification
|
187
|
+
* report
|
188
|
+
* amendment
|
189
|
+
* technical-corrigendum
|
190
|
+
|
191
|
+
`:technical-committee:`, `:technical-committee_N:` (where N is a positive integer):
|
192
|
+
Technical committee; there can be more than one.
|
193
|
+
|
194
|
+
`:draft:`: Enables comments in Word and XML.
|
195
|
+
|
196
|
+
`:local-cache-only:`: Used with Metanorma under Docker to ensure bibliographic entries
|
197
|
+
do not get unnecessarily fetched all the time.
|
198
|
+
|
199
|
+
|
200
|
+
==== Foreword & Introduction
|
201
|
+
|
202
|
+
Foreword must be put before the first real section/clause (the `==` one).
|
203
|
+
|
204
|
+
----
|
205
|
+
[[foreword]]
|
206
|
+
.Foreword
|
207
|
+
The Calendaring and Scheduling Consortium ("`CalConnect`") is global non-profit
|
208
|
+
organization with the aim to facilitate interoperability of technologies across
|
209
|
+
user-centric systems and applications...
|
210
|
+
----
|
211
|
+
|
212
|
+
Introduction comes after Foreword and is unnumbered (actually "`0`"):
|
213
|
+
|
214
|
+
----
|
215
|
+
[[introduction]]
|
216
|
+
:sectnums!: <== disables display of section number
|
217
|
+
== Introduction
|
218
|
+
|
219
|
+
<<ISO8601>> has been the international standard for date and time representations
|
220
|
+
and is applied widely, including in the <<RFC5545>> and <<RFC6350>> standards
|
221
|
+
...
|
222
|
+
|
223
|
+
:sectnums: <== re-enables display of section number
|
224
|
+
----
|
225
|
+
|
226
|
+
NOTE: Some ISO standards display Introduction section numbers (the "`0`") if there are
|
227
|
+
too many sub-sections.
|
228
|
+
|
229
|
+
|
230
|
+
==== Normative references & bibliography
|
231
|
+
|
232
|
+
What is a normative vs informative reference?
|
233
|
+
|
234
|
+
* A change to a normative reference requires updating of the document;
|
235
|
+
* A change to an informative reference should not trigger a change in the document.
|
236
|
+
|
237
|
+
|
238
|
+
Clause 2 must be this:
|
239
|
+
|
240
|
+
----
|
241
|
+
[bibliography]
|
242
|
+
== Normative references
|
243
|
+
|
244
|
+
* [[[ISO3696,ISO 3696]]], _Water for analytical laboratory use -- Test methods_
|
245
|
+
----
|
246
|
+
|
247
|
+
Last section must be this:
|
248
|
+
|
249
|
+
----
|
250
|
+
[bibliography]
|
251
|
+
== Bibliography
|
252
|
+
|
253
|
+
* [[[ISO5609,ISO 5609]]], _Soil for laboratory analysis -- Test methods_
|
254
|
+
----
|
255
|
+
|
256
|
+
NOTE: the Bibliography is identical in usage with the IETF RFC section "`Informative references`".
|
257
|
+
|
258
|
+
|
259
|
+
==== Citations
|
260
|
+
|
261
|
+
In a CSD you often want to cite external or internal references.
|
262
|
+
|
263
|
+
Internal:
|
264
|
+
[source,adoc]
|
265
|
+
----
|
266
|
+
[[dog-food]]
|
267
|
+
== Dog food
|
268
|
+
|
269
|
+
Dogs love food, not only bones. Mine especially loves eating Oreo's.
|
270
|
+
|
271
|
+
== Living with your dog
|
272
|
+
|
273
|
+
My dog, Cookie, loves to eat cookies (see <<dog-food>>).
|
274
|
+
|
275
|
+
----
|
276
|
+
|
277
|
+
|
278
|
+
External (remember to add the reference!):
|
279
|
+
|
280
|
+
[source,adoc]
|
281
|
+
----
|
282
|
+
The quality requirements on wheat are described in <<ISO7301>>.
|
283
|
+
|
284
|
+
In particular, those for bread wheat (T. aestivum) are given in
|
285
|
+
<<ISO7301,clause=5.6>>.
|
286
|
+
----
|
287
|
+
|
288
|
+
|
289
|
+
==== Terms and definitions
|
290
|
+
|
291
|
+
This must be clause 3.
|
292
|
+
|
293
|
+
[source,adoc]
|
294
|
+
----
|
295
|
+
[[tda]] <= anchor if you want it
|
296
|
+
[source=ISO8601-1] <= allows inheriting terms and definitions from
|
297
|
+
another document
|
298
|
+
== Terms, definitions, symbols and abbreviations <= can combine T&D and S&A
|
299
|
+
|
300
|
+
=== Terms and definitions <= the real T&D clause
|
301
|
+
|
302
|
+
[[term-explicit]] <= anchor if you want it
|
303
|
+
==== explicit form <= term item
|
304
|
+
|
305
|
+
date and time representation that uses designator symbols to delimit
|
306
|
+
time scale components
|
307
|
+
----
|
308
|
+
|
309
|
+
|
310
|
+
==== Term entry in T&D
|
311
|
+
|
312
|
+
The structure is strict; the following illustrates the complete structure of a term entry.
|
313
|
+
|
314
|
+
In the term source (`[.source]`), all content after the reference and the "`comma`" is about "`modifications`" to the original definition.
|
315
|
+
|
316
|
+
[source,adoc]
|
317
|
+
----
|
318
|
+
[[paddy]] <= anchor
|
319
|
+
=== paddy <= term
|
320
|
+
alt:[paddy rice] <= alternative term
|
321
|
+
alt:[rough rice] <= second alternative
|
322
|
+
deprecated:[cargo rice] <= deprecated term
|
323
|
+
domain:[rice] <= domain
|
324
|
+
|
325
|
+
rice retaining its husk after threshing <= definition
|
326
|
+
|
327
|
+
[example] <= example
|
328
|
+
Foreign seeds, husks, bran, sand, dust.
|
329
|
+
|
330
|
+
NOTE: The starch of waxy rice consists almost entirely of amylopectin. <= note
|
331
|
+
|
332
|
+
[.source]
|
333
|
+
<<ISO7301,section 3.2>>, The term "cargo rice" is shown as deprecated, <= source
|
334
|
+
and Note 1 to entry is not included here.
|
335
|
+
----
|
336
|
+
|
337
|
+
|
338
|
+
==== Term entry sourced from IEC Electropedia (IEV)
|
339
|
+
|
340
|
+
In the `[.source]`, a termbase such as the IEC Electropedia ("`IEV`") can be used, such as:
|
341
|
+
|
342
|
+
[source,adoc]
|
343
|
+
----
|
344
|
+
[.source]
|
345
|
+
<<IEV,clause "113-01-01">>, the term "space-time" is further explained
|
346
|
+
in a new Note 2 to entry.
|
347
|
+
----
|
348
|
+
|
349
|
+
References to the specific IEC 60500 documents (where IEV terms came
|
350
|
+
from) are automatically added to the Bibliography.
|
351
|
+
|
352
|
+
|
353
|
+
==== Annex
|
354
|
+
|
355
|
+
Annexes have to be placed before the "`Bibliography`".
|
356
|
+
|
357
|
+
[source,adoc]
|
358
|
+
----
|
359
|
+
[[AnnexA]]
|
360
|
+
[appendix,subtype=informative]
|
361
|
+
== Example date and time expressions, and representations
|
362
|
+
...
|
363
|
+
----
|
364
|
+
|
365
|
+
|
366
|
+
== Where next?
|
367
|
+
|
368
|
+
* https://www.metanorma.com/overview/[Learn more about Metanorma]
|