Closed ronaldtse closed 5 years ago
ping @opoudjis @strogonoff
This would be awesome and simplify the quickstart a lot.
The exact templates to be used for generation could be provided by specific gems (e.g. Metanorma-ISO); Metanorma-CLI can depend on them and complain if e.g. you try to metanorma new --class iso
without having metanorma-iso
installed, although it’s not up to me how it’s done better.
Alternatives: metanorma init
IMO metanorma build
is not the best as it hints at rendering final documents.
No, I have no idea what you're asking for, and I don't see the point of it.
In fact, the only thing I see here being of any generalisable use is the index.doc skeleton. And we already have several of those.
Not my idea but I still like it.
I agree that Github/Travis stuff could only prompt more confusion for some users, deploy.sh is hard to generalize, and I have no comment about Metanorma project file layout.
What do you think of just bundling just the Makefile / Gemfile / index.adoc as an easy installable skeleton @opoudjis?
And we already have several of those.
Let’s say I’m an ISO author, how do I use one now? Sorry if it’s a silly/straightforward question
Grab an existing document, like the Rice document, and replace its contents. This doesn't deserve any more work than that.
I've assigned myself this task, but I'm assigning it back to you and Ronald, because I know nothing about the workflow that it presupposes, and there is not enough here for me to work on otherwise.
The skeleton model makes sense overall. I believe that’s the way create-react-app worked originally, for example. (That said I just discovered that in latest versions they seem to have switched to a model where the user runs a “create” command to create app skeleton.)
@strogonoff and that's why we prefer a "metanorma create" command 👍
I do agree now with @opoudjis that we don't want to split the sections. But the rest of the files are useful.
So:
metanorma new -t iso my-doc-name
# => new directory `my-doc-name/` gets created with ISO document template
metanorma new -t iso my-doc-name --split-sections
# => new directory `my-doc-name/` gets created with ISO document template with split sections
The template will be downloaded from a place like:
https://github.com/metanorma/metanorma-templates-{flavor}/{document-type}
(OGC already keeps separate templates for different document types)
(@opoudjis NIST has requested to provide split sections in a template 😉 )
I find this predilection for split sections bizarre: given how pervasive cross-referencing is, having to skip between documents during authoring seems to me utterly counterproductive. But there's no accounting for taste. :-)
It’s a matter of the text editor. If you find changing tabs better than scrolling, split files is easier (to me). If you like scrolling, a single file is easier.
I generally use editors that have good tab support, so I prefer split files (unless the document is short).
And this is the related OGC task: https://github.com/metanorma/metanorma-ogc/issues/23
@ronaldtse: Let me try to summarize what do we need for this, I'm taking iso as an example.
metanorma new -t iso doc-name
will create a new doc-name
documentdoc-name
will contains the minimum of a Gemfile, index.adoc in the projectQuestion:
cc: @opoudjis
@abunashir going to push the templates in a few minutes 😉
It will be at https://github.com/metanorma/mn-templates-csd/
@abunashir just for the record.
We will start off the first iteration by creating a separate script called metanorma-new
in exe/
.
The CSD template repository of https://github.com/metanorma/mn-templates-csd is already done (mostly) and up.
The command is metanorma-new -t {type} -d {doctype} [my-new-document-name]
doc-type
does not need validation, as long as the remote git repo has that directory it is fine.In the future:
This is being done in #35
We need a command to generate a new skeleton for a new Metanorma document.
This is similar to the
bundle gem
andrails new
commands. We want to generate a new Metanorma document skeleton, perhaps we can use git to download the skeleton (or include it in the gem).The files that are necessary are:
metanorma.env(the contents now go inside the metanorma file)Makefile(contents should go into metanorma-cli gem)sections/{nn}-{title}.adocdeploy.sh(contents should go into metanorma-cli gem)and?