-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
120 lines (120 loc) · 5.6 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>CMTools</title>
<link rel="stylesheet" href="/css/site.css">
</head>
<body>
<nav>
<ul>
<li><a href="/">Home</a></li>
<li><a href="index.html">README</a></li>
<li><a href="LICENSE">LICENSE</a></li>
<li><a href="INSTALL.html">INSTALL</a></li>
<li><a href="user_manual.html">User Manual</a></li>
<li><a href="about.html">About</a></li>
<li><a href="search.html">Search</a></li>
<li><a href="https://github.com/caltechlibrary/CMTools">GitHub</a></li>
</ul>
</nav>
<section>
<h1 id="codemeta-tools">CodeMeta Tools</h1>
<p><a href="https://codemeta.github.io">CodeMeta</a> Tools provides a
simple command line tool called <code>cmt</code> that can be used to
generate project files and artifacts. It also provides a tool called
<code>cme</code> to edit and manage the CodeMeta file. The project
focuses on leveraging CodeMeta data, directory name and Git repo
information for building and release software written in Python, Go,
JavaScript or TypeScript. It was motivated by the practices in Caltech
Library’s Digital Development Group.</p>
<p>The tools are intended to be run from the project root directory.
<code>cmt</code> expects the file path of your codemeta.json file as
well as one or more target files to be generated. The target file’s
extension determines the generated content. The tool can generate the
following project files based on the contents of the codemeta.json file.
<code>cme</code> expects the file path of your codemeta.json file and
optionally the attributes of the CodeMeta object you wish to manage.</p>
<p><code>cme</code> is used to create and manage “codemeta.json”.
<code>cmt</code> is used to generate the following.</p>
<ul>
<li>CITATION.cff</li>
<li>version.ts, version.js, version.go or version.py</li>
<li>about.md</li>
<li>page.hbs (handlebars template) or page.tmpl (Pandoc template)</li>
</ul>
<h2 id="create-and-manage-your-file">Create and manage your file</h2>
<p><code>cme</code> is for managing your “codemeta.json” file. If only
the “codemeta.json” file is provided then you’ll be in an “interactive”
mode. You will be prompted for each top level attribute. You either
press enter and accept the current value or replace the value. For
complex attributes like “author”, and “keywords”<a href="#fn1"
class="footnote-ref" id="fnref1" role="doc-noteref"><sup>1</sup></a> you
use YAML notation followed by a line containing only a period to
indicate completion. If you enter only the line with a period then the
current value remains. Here’s an example of setting up to use
<code>cme</code> to create and edit the “codemeta.json” file.</p>
<pre class="shell"><code>cme codemeta.json</code></pre>
<p>The will let you iterate over the top level CodeMeta object
attributes. For multi line or list attributes your favorite editor will
be used to create or update the values.</p>
<p>Here’s an example of updating the version and
<code>.releaseNotes</code> attributes but instead of the direct input
you edit the value using the Micro Editor<a href="#fn2"
class="footnote-ref" id="fnref2"
role="doc-noteref"><sup>2</sup></a>.</p>
<pre class="shell"><code>cme codemeta.json version releaseNotes -e</code></pre>
<p>Since the version is short you’ll just be prompted to type in a new
version string. You release notes maybe longer so for that you’ll drop
into your editor.</p>
<h2 id="create-a-version-file-for-typescript-go-and-python">Create a
version file for TypeScript, Go and Python</h2>
<p>The <code>cmt</code> command can render a version file suitable for
TypeScript, JavaScript, Go and Python projects. The version file will
contain version name, release hash, release date and license
information. Here’s an example of rendering a “version.ts” for the
CMTools project.</p>
<pre class="shell"><code>cmt codemeta.json version.ts</code></pre>
<p>For Go you would do,</p>
<pre class="shell"><code>cmt codemeta.json version.go</code></pre>
<p>and for Python.</p>
<pre class="shell"><code>cmt codemeta.json version.py</code></pre>
<h2 id="creating-an-about.md">Creating an about.md</h2>
<p>The codemeta file contains sufficient information to rendering an
about page for your project. Rendering a Markdown document for that
purpose can be done with the following.</p>
<pre class="shell"><code>cmt codemeta.json about.md</code></pre>
<h2 id="create-a-simple-project-handlebars-template">Create a simple
project handlebars template</h2>
<p>A handlebars template can be generated from the codemeta.json as
well.</p>
<pre class="shell"><code>cmt codemeta.json page.hbs</code></pre>
<p>This Handlebars template then can be used along with a handlebars
template script to build the website from your repository.</p>
<h2 id="create-a-project-pandoc-template">Create a project Pandoc
template</h2>
<p>A Pandoc template can be generated from the codemeta.json as
well.</p>
<pre><code>cmt codemeta.json page.tmpl</code></pre>
<h2 id="additional-project-documentation">Additional Project
Documentation</h2>
<ul>
<li><a href="user_manual.html">user manual</a></li>
<li><a href="INSTALL.html">installation</a></li>
<li><a href="LICENSE">license</a></li>
</ul>
<section id="footnotes" class="footnotes footnotes-end-of-document"
role="doc-endnotes">
<hr />
<ol>
<li id="fn1"><p>For a full list of complex fields see the user manual
for <code>cme</code>.<a href="#fnref1" class="footnote-back"
role="doc-backlink">↩︎</a></p></li>
<li id="fn2"><p>You need to have <a
href="http://micro-editor.github.io">Micro Editor</a> installed for this
to work.<a href="#fnref2" class="footnote-back"
role="doc-backlink">↩︎</a></p></li>
</ol>
</section>
</section>
</body>
</html>