Git Product home page Git Product logo

metanorma-cc's Introduction

metanorma-cc: Metanorma processor for CalConnect standards

Gem Version Build Status Code Climate Pull Requests Commits since latest

Functionality

This gem processes Metanorma documents following the Metanorma model for generating CalConnect Standards.

The gem currently inherits from the https://github.com/metanorma/metanorma-standoc gem, and aligns closely to it. Refer to https://metanorma.com for guidance.

Usage

The preferred way to invoke this gem is via the metanorma script:

$ metanorma --type cc a.adoc                   # output HTML and PDF
$ metanorma --type cc --extensions html a.adoc # output just HTML
$ metanorma --type cc --extensions pdf a.adoc  # output just PDF
$ metanorma --type cc --extensions xml a.adoc  # output Metanorma XML

The gem translates the document into Metanorma XML format, and then validates its output against the CC Metanorma XML document model; errors are reported to console against the XML, and are intended for users to check that they have provided all necessary components of the document.

The gem then converts the XML into output formats such as HTML and PDF.

Installation

If you are using a Mac, the https://github.com/metanorma/metanorma-macos-setup repository has instructions on setting up your machine to run Metanorma scripts such as this one. You need only run the following in a Terminal console:

$ bash <(curl -s https://raw.githubusercontent.com/metanorma/metanorma-macos-setup/master/metanorma-setup)
$ gem install metanorma-cc

Examples

Notes

Metanorma-CC was formerly published as asciidoctor-csd and metanorma-csd.

metanorma-cc's People

Contributors

abunashir avatar andrew2net avatar camobap avatar github-actions[bot] avatar intelligent2013 avatar metanorma-ci avatar opoudjis avatar ribose-jeffreylau avatar ronaldtse avatar strogonoff avatar w00lf avatar webdev778 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

metanorma-cc's Issues

Update CSD prefixes and stage codes to new ones

CSD documents are now labeled as below.

=== Project code

. The project code shall be of the form `[n]`, where `[n]` is any
selected positive integer of less than 5 digits.

. The numbering system applies across all project types.
Different project types shall not share an identical project code.

. The project code shall be assigned on proposal acceptance
of the project.

. Co-published documents shall attempt to use an identical project
code in both CalConnect and at the collaborative publisher to prevent
potential ambiguity, if possible.


=== Document identifier

==== Representation

The document identifier takes the form of `[type][stage] [code][:][y]`, where:

* `[type]` is the document identifier prefix;
* `[stage]` is the document stage;
* `[code]` is the project code of the project that created the document; and
* `[y]` is the 4-digit edition year.


==== Edition year

The edition year is the calendar year in which the document is published.
On updates, a document will retain the same project code but may be
assigned a different edition year in which the update is published.


==== Co-publishing

Co-published documents shall incorporate codes from all collaborative
publishing parties in the document identifier, joined together via a
"`solidus`" sign ("`/`").

[example]
CalConnect deliverables co-published with ISO are referenced as as "`CC/ISO`",
with IETF as "`CC/IETF`".


[[document-type]]
==== Document types

Document types shall be represented in the "`type`" as follows:

. Standard, "`CC`"

. Directive, "`CC/DIR`"

. Guide, "`CC/Guide`"

. Specification, "`CC/S`"

. Report, "`CC/R`"

. Amendment, "`CC/Amd`"

. Technical corrigendum, "`CC/Cor`"

[example]
"`CC/Guide/DS 38002:2018`" is a CalConnect Guide at DS stage with
project number 38002, published in 2018.

==== Document stages

Document stages shall be represented in the "`stage`" as follows:

. Published, "` `" (blank)

. Final draft standard, "`/FDS`"

. Draft standard, "`/DS`"

. Technical committee draft, "`/CD`"

. Project group draft / Working draft, "`/WD`"


[example]
"`CC/FDS 10668:2018`" is a CalConnect standard document at FDS stage
with project number 10668, published in 2018.

[example]
"`CC/Guide/DS 20080:2018`" is a CalConnect guide at DS stage with
project number 20080, published in 2018.

NoMethodError: undefined method `save' for #<Relaton::Db:...>

bundler: failed to load command: metanorma (/Users/me/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/bin/metanorma)
NoMethodError: undefined method `save' for #<Relaton::Db:0x00007fd892238300>
  /Users/me/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems/asciidoctor-csd-0.4.2/lib/asciidoctor/csd/converter.rb:79:in `makexml'

Error when inheriting terms and defs from another document

[[tda]]
[source=iso8601-1]
== Terms, definitions, symbols and abbreviations

=== Terms and definitions

[[term-explicit]]
==== explicit form

date and time representation that uses designator symbols to delimit time scale components

Error:

NoMethodError: undefined method `[]' for nil:NilClass
  /Users/myself/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/bundler/gems/isodoc-e3a94e99afd5/lib/isodoc/function/section.rb:116:in `block in term_defs_boilerplate_cont'

Accept multiple committees

As title.

e.g., "TC VCARD, TC CALENDAR" rather than currently "TC VCARD, CALENDAR" when I put "VCARD, CALENDAR" in the :technical-committee: document attribute.

Create gem

The asciidoctor-csd gem that generates CSD from AsciiDoc

Errors when compiling CSD document (used to work before)

The asciidoctor-csd gem has been deprecated and has been replaced by metanorma-csd
...
bundler: failed to load command: metanorma (/Users/myself/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/bin/metanorma)
ArgumentError: unknown keyword: affilation
/Users/myself/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems/iso-bib-item-0.2.5/lib/iso_bib_item/person.rb:91:in `initialize'

Issues with HTML output

  1. Annex should not be unrendered?

screen shot 2018-05-04 at 11 01 58 am

  1. Annex title should be in single line

screen shot 2018-05-04 at 11 01 21 am

  1. Reference numbering, title, year should not be bolded. (probably?)

screen shot 2018-05-04 at 11 01 09 am

Adopting CSD for existing CalConnect public documents

CalConnect maintains a public document repository, of which most documents can be re-published in the new CSD or a CSD-derived format.

http://www.calconnect.org/resources/documents/document-register

The existing document types are:

  • ARTF=Code Artifact
  • PRES=Presentation
  • PROP=Proposal
  • RCMD=Recommendation
  • REPT=Report
  • REVW=Public Review
  • IETF DRAFT=IETF Internet Draft
  • IETF RFC=IETF Pubished Standard

The existing document numbering scheme is "CD YYSS", where:

  • "CD" stands for "CalConnect document
  • "YY" is the last two digits of a YYYY year
  • "SS" is a sequential unique number for the documents published within that YY year

Metadata of a document looks like this:

CALCONNECT DOCUMENT CD 1705
Type:      Report
Title:     Report on CalConnect Conference XL
Version:   1.0
Date:      2017-10-23
Status:    Published
Source:    N/A

Errors on datetime-explicit document

I'm getting this error on the document (admittedly there are errors within the document, but the toolchain should still not fail):

NoMethodError: undefined method `[]' for nil:NilClass
  /Users/myself/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems/isodoc-0.8.10/lib/isodoc/function/terms.rb:46:in `block (2 levels) in termnote_parse'

Style a CSD manifest

In metanorma/metanorma-mpfa#1, Pierre, you created a stylesheet for a manifest of external references to files.

I have created a script that renders manifests as normal ISO XML documents, and converts those to HTML. The manifests are meant to be just like normal standards documents, with their components as normal clauses and subclauses; so modifying the contents of the HTML file is not a desirable option; we want this file to look like an index of other files, but altering only the CSS, while still preserving the look-and-feel of normal CSD documents.

I am attaching where I have gotten to, along with the input file from which it is generated (in YAML). The task is to change the CSS to something more like what @ronaldtse wants, for an index of CSD documents. The problem is that I'm somewhat vague as to what he wants, and you will have to liaise with him as to specifics.

csd index.zip

Need example spec

Need an example standard for this. @ronaldtse, if you can't supply a plausible CSD standard, I'll use the Rice document.

Numbering of Examples

In CSD the Examples provided inside lists are not following the overall numbering of examples within the same clause.

Update list of status

Let's confirm that this is the authoritative list of status (for now). We want to get rid of all the meaningless abbreviations.

  • code: Code Artifact
  • presentation: Presentation
  • proposal: Proposal
  • standard: Recommendation (just calling this "Standard" instead of "Recommendation")
  • report: report
  • Public Review => Remove
  • IETF DRAFT: => proposal
  • IETF RFC: => standard

Failure in compiling document at eref

In ribose-ext-standards/iso/time-date-terminology, run make clean all.

See this error:

(==>> SEE THIS ) Term "time axis" does not match IEV 113-01-03113-01-07 ""
(==>> SEE THIS ) Term "time scale" does not match IEV 713-05-18113-01-11 ""
(==>> SEE THIS ) Term "duration" does not match IEV 113-01-13 "durationtime (for continuous time scales)"
(==>> SEE THIS ) ISO: 'see term-gregorian-calendar' is pointing to a normative section
(==>> SEE THIS ) ISO: 'see term-ordinal-date' is pointing to a normative section
bundler: failed to load command: metanorma (==>> SEE THIS ) (/Users/myself/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/bin/metanorma)
(==>> SEE THIS ) NoMethodError: undefined method `at' for nil:NilClass
  /Users/myself/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/bundler/gems/metanorma-iso-1b0dd34f9c23/lib/asciidoctor/iso/validate.rb:140:in `block in see_erefs_validate'
...
make: *** [iso-date-time-terminology-tc154-nwip-en.html] Error 1

Bundle with asciidoctor 1.5.7 fails to run

I'm getting this error when building CSD documents:

NoMethodError: undefined method `asciidoc_sub' for #<Asciidoctor::Csd::Converter:0x00007fa889891000>
gems/asciidoctor-csd-41b173a7ed94/lib/asciidoctor/csd/converter.rb:44:in `block (2 levels) in title'

This seems to be an incompatibility with the newly released asciidoctor 1.5.7?

Thanks!

Suppress generation of temporarily / useless files

In this directory: https://github.com/riboseinc/csd-public-documents/tree/master/conference41rpt

Run make clean all.

Before:

Apr 16 12:59 Makefile
Apr 16 12:45 csd-report-conference-41.adoc

After:

Apr 16 13:01 .tmp.xml
Apr 16 12:59 Makefile
Apr 16 13:01 _images/
Apr 16 12:45 csd-report-conference-41.adoc <--- original
Apr 16 13:01 csd-report-conference-41.doc
Apr 16 13:01 csd-report-conference-41.html <--- we only want this!
Apr 16 13:01 csd-report-conference-41.xml
Apr 16 13:01 csd-report-conference-41_files/
Apr 16 13:01 csd.css
Apr 16 13:01 header.html
Apr 16 13:01 htmlstyle.css
Apr 16 13:01 wordstyle.css

Section number should not always start from 4

Generated from csd-public-documents/conference40rpt/csd-report-conference-40.adoc

screen shot 2018-04-18 at 11 48 25 am

Given a report does not have "Scope", "Norm Refs" and "T&D" sections, it would be better to only limit the section numbers 1/2/3 to the "Standard" doctype?

Don't generate PDF if `puppeteer` is not installed

Currently asciidoctor-csd automatically generates a PDF via puppeteer. But when it is not installed, we don't want to err out.

open internal/modules/cjs/loader.js:573
    throw err;
    ^

Error: Cannot find module 'puppeteer'

It should just display a WARNING.

Incompatible with Relaton?

bundler: failed to load command: metanorma (/Users/myself/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/bin/metanorma)
NoMethodError: undefined method `save_cache_biblio' for #<Asciidoctor::Csd::Converter:0x00007fe9b602fb50>
  /Users/myself/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems/asciidoctor-csd-0.4.1/lib/asciidoctor/csd/converter.rb:79:in `makexml'

Grammar errors

With recent grammar changes, large number of errors being reported on the RFC 6350 document.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.