eolang 0.33.2 → 0.33.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Formula/eolang.rb +2 -2
- package/Formula/eolang@0.32.0.rb +2 -2
- package/Formula/eolang@0.32.1.rb +2 -2
- package/Formula/eolang@0.33.0.rb +2 -2
- package/README.md +2 -2
- package/eo-version.txt +1 -1
- package/mvnw/dependency-reduced-pom.xml +1 -1
- package/mvnw/pom.xml +1 -1
- package/package.json +2 -1
- package/src/commands/docs.js +40 -27
- package/src/resources/xmir-transformer.xsl +7 -6
- package/src/version.js +2 -2
package/Formula/eolang.rb
CHANGED
|
@@ -7,9 +7,9 @@ require "language/node"
|
|
|
7
7
|
class Eolang < Formula
|
|
8
8
|
desc "Command-line Tool-Kit"
|
|
9
9
|
homepage "https://github.com/objectionary/eoc"
|
|
10
|
-
url "https://github.com/objectionary/eoc/archive/refs/tags/0.33.
|
|
10
|
+
url "https://github.com/objectionary/eoc/archive/refs/tags/0.33.2.tar.gz"
|
|
11
11
|
version "0.33.1"
|
|
12
|
-
sha256 "
|
|
12
|
+
sha256 "e795fba4fef808afffef01e0e17081ae135cfdc9115a36fbee76cfb56f203f9c"
|
|
13
13
|
license "MIT"
|
|
14
14
|
|
|
15
15
|
depends_on "node"
|
package/Formula/eolang@0.32.0.rb
CHANGED
|
@@ -7,9 +7,9 @@ require "language/node"
|
|
|
7
7
|
class Eolang < Formula
|
|
8
8
|
desc "Command-line Tool-Kit"
|
|
9
9
|
homepage "https://github.com/objectionary/eoc"
|
|
10
|
-
url "https://github.com/objectionary/eoc/archive/refs/tags/0.33.
|
|
10
|
+
url "https://github.com/objectionary/eoc/archive/refs/tags/0.33.2.tar.gz"
|
|
11
11
|
version "0.32.0"
|
|
12
|
-
sha256 "
|
|
12
|
+
sha256 "e795fba4fef808afffef01e0e17081ae135cfdc9115a36fbee76cfb56f203f9c"
|
|
13
13
|
license "MIT"
|
|
14
14
|
|
|
15
15
|
depends_on "node"
|
package/Formula/eolang@0.32.1.rb
CHANGED
|
@@ -7,9 +7,9 @@ require "language/node"
|
|
|
7
7
|
class Eolang < Formula
|
|
8
8
|
desc "Command-line Tool-Kit"
|
|
9
9
|
homepage "https://github.com/objectionary/eoc"
|
|
10
|
-
url "https://github.com/objectionary/eoc/archive/refs/tags/0.33.
|
|
10
|
+
url "https://github.com/objectionary/eoc/archive/refs/tags/0.33.2.tar.gz"
|
|
11
11
|
version "0.32.1"
|
|
12
|
-
sha256 "
|
|
12
|
+
sha256 "e795fba4fef808afffef01e0e17081ae135cfdc9115a36fbee76cfb56f203f9c"
|
|
13
13
|
license "MIT"
|
|
14
14
|
|
|
15
15
|
depends_on "node"
|
package/Formula/eolang@0.33.0.rb
CHANGED
|
@@ -7,9 +7,9 @@ require "language/node"
|
|
|
7
7
|
class Eolang < Formula
|
|
8
8
|
desc "Command-line Tool-Kit"
|
|
9
9
|
homepage "https://github.com/objectionary/eoc"
|
|
10
|
-
url "https://github.com/objectionary/eoc/archive/refs/tags/0.33.
|
|
10
|
+
url "https://github.com/objectionary/eoc/archive/refs/tags/0.33.2.tar.gz"
|
|
11
11
|
version "0.33.0"
|
|
12
|
-
sha256 "
|
|
12
|
+
sha256 "e795fba4fef808afffef01e0e17081ae135cfdc9115a36fbee76cfb56f203f9c"
|
|
13
13
|
license "MIT"
|
|
14
14
|
|
|
15
15
|
depends_on "node"
|
package/README.md
CHANGED
|
@@ -18,14 +18,14 @@ First, you install [npm][npm-install] and [Java SE][java-se].
|
|
|
18
18
|
Then, you install [eolang][npm] package, using [npm][npm-install]:
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
|
-
npm install -g eolang@0.33.
|
|
21
|
+
npm install -g eolang@0.33.2
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
You can also use [Homebrew] (on macOS):
|
|
25
25
|
|
|
26
26
|
```bash
|
|
27
27
|
brew tap objectionary/eoc https://github.com/objectionary/eoc
|
|
28
|
-
brew install objectionary/eoc/eolang@0.33.
|
|
28
|
+
brew install objectionary/eoc/eolang@0.33.2
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
Then, you write a simple [EO](https://www.eolang.org) program in `hello.eo` file
|
package/eo-version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.58.
|
|
1
|
+
0.58.8
|
|
@@ -121,6 +121,6 @@
|
|
|
121
121
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
|
122
122
|
<heap-size>undefined</heap-size>
|
|
123
123
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
124
|
-
<jeo.version>0.14.
|
|
124
|
+
<jeo.version>0.14.14</jeo.version>
|
|
125
125
|
</properties>
|
|
126
126
|
</project>
|
package/mvnw/pom.xml
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<version>0.0.0</version>
|
|
11
11
|
<packaging>jar</packaging>
|
|
12
12
|
<properties>
|
|
13
|
-
<jeo.version>0.14.
|
|
13
|
+
<jeo.version>0.14.14</jeo.version>
|
|
14
14
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
15
15
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
|
16
16
|
<eo.version>undefined</eo.version>
|
package/package.json
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"commander": "^12.1.0",
|
|
11
11
|
"eo2js": "^0.0.8",
|
|
12
12
|
"fast-xml-parser": "^5.2.3",
|
|
13
|
+
"marked": "^4.3.0",
|
|
13
14
|
"node": "^24.1.0",
|
|
14
15
|
"relative": "^3.0.2",
|
|
15
16
|
"semver": "^7.7.2",
|
|
@@ -57,5 +58,5 @@
|
|
|
57
58
|
"postinstall": "node scripts/postinstall.js",
|
|
58
59
|
"test": "mocha --timeout 1200000"
|
|
59
60
|
},
|
|
60
|
-
"version": "0.33.
|
|
61
|
+
"version": "0.33.3"
|
|
61
62
|
}
|
package/src/commands/docs.js
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
const fs = require('fs');
|
|
7
7
|
const path = require('path');
|
|
8
8
|
const SaxonJS = require('saxon-js');
|
|
9
|
+
const { marked } = require('marked');
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* Recursively reads all .xmir files from a directory.
|
|
@@ -52,16 +53,27 @@ function transformDocument(xmir, xsl) {
|
|
|
52
53
|
return html;
|
|
53
54
|
}
|
|
54
55
|
|
|
56
|
+
/**
|
|
57
|
+
* Converts Markdown blocks in documentation to HTML
|
|
58
|
+
* @param {String} html - text of HTML file
|
|
59
|
+
* @return {String} HTML document
|
|
60
|
+
*/
|
|
61
|
+
function convertMarkdownToHtml(html) {
|
|
62
|
+
const regex = /(?<opening_tag><div\s+class\s*=\s*["']object-desc["'][^>]*>)(?<content>[\s\S]*?)(?<closing_tag><\/div>)/gi;
|
|
63
|
+
const converted_html = html.replace(regex, (match, opening_tag, content, closing_tag) => `${opening_tag}${marked.parse(content)}${closing_tag}`);
|
|
64
|
+
return converted_html;
|
|
65
|
+
}
|
|
66
|
+
|
|
55
67
|
/**
|
|
56
68
|
* Creates documentation block from given XMIR
|
|
57
|
-
* @param {String}
|
|
69
|
+
* @param {String} filepath - path of XMIR
|
|
58
70
|
* @return {String} HTML block
|
|
59
71
|
*/
|
|
60
|
-
function createXmirHtmlBlock(
|
|
72
|
+
function createXmirHtmlBlock(filepath) {
|
|
61
73
|
try {
|
|
62
|
-
const xmir = fs.readFileSync(
|
|
74
|
+
const xmir = fs.readFileSync(filepath).toString();
|
|
63
75
|
const xsl = fs.readFileSync(path.join(__dirname, '..', 'resources', 'xmir-transformer.xsl')).toString();
|
|
64
|
-
return transformDocument(xmir, xsl);
|
|
76
|
+
return convertMarkdownToHtml(transformDocument(xmir, xsl));
|
|
65
77
|
} catch(error) {
|
|
66
78
|
throw new Error(`Error while applying XSL to XMIR: ${error.message}`, error);
|
|
67
79
|
}
|
|
@@ -70,42 +82,43 @@ function createXmirHtmlBlock(xmir_path) {
|
|
|
70
82
|
/**
|
|
71
83
|
* Generates Package HTML
|
|
72
84
|
* @param {String} name - Package name
|
|
73
|
-
* @param {String[]}
|
|
74
|
-
* @param {String}
|
|
85
|
+
* @param {String[]} htmls - Array of xmirs htmls
|
|
86
|
+
* @param {String} css - CSS file path
|
|
75
87
|
* @return {String} HTML of the package
|
|
76
88
|
*/
|
|
77
|
-
function generatePackageHtml(name,
|
|
78
|
-
|
|
89
|
+
function generatePackageHtml(name, htmls, css) {
|
|
90
|
+
htmls = htmls.filter(item => item !== '<article class="app-block"></article>');
|
|
91
|
+
const date = new Date();
|
|
79
92
|
return `<!DOCTYPE html>
|
|
80
93
|
<html>
|
|
81
94
|
<head>
|
|
82
|
-
<link href="${
|
|
83
|
-
|
|
95
|
+
<link href="${css}" rel="stylesheet" type="text/css">
|
|
96
|
+
<link rel="stylesheet"
|
|
97
|
+
href="https://cdn.jsdelivr.net/npm/tacit-css@1.9.1/dist/tacit-css.min.css"/>
|
|
84
98
|
</head>
|
|
85
99
|
<body>
|
|
86
|
-
|
|
100
|
+
<section>
|
|
101
|
+
<header>
|
|
102
|
+
<nav>
|
|
103
|
+
<h1>${name} documentation</h1>
|
|
104
|
+
<p>Creation date: ${date.toUTCString()}</p>
|
|
105
|
+
</nav>
|
|
106
|
+
</header>
|
|
107
|
+
${htmls.join('\n')}
|
|
108
|
+
</section>
|
|
87
109
|
</body>
|
|
88
110
|
</html>`;
|
|
89
111
|
}
|
|
90
112
|
|
|
91
113
|
/**
|
|
92
114
|
* Wraps given html body
|
|
115
|
+
* @param {String} name - File name
|
|
93
116
|
* @param {String} html - HTML body
|
|
94
|
-
* @param {String}
|
|
117
|
+
* @param {String} css - CSS file path
|
|
95
118
|
* @return {String} Ready HTML
|
|
96
119
|
*/
|
|
97
|
-
function wrapHtml(html,
|
|
98
|
-
return
|
|
99
|
-
<!DOCTYPE html>
|
|
100
|
-
<html>
|
|
101
|
-
<head>
|
|
102
|
-
<link href="${css_path}" rel="stylesheet" type="text/css">
|
|
103
|
-
</head>
|
|
104
|
-
<body>
|
|
105
|
-
${html}
|
|
106
|
-
</body>
|
|
107
|
-
</html>
|
|
108
|
-
`;
|
|
120
|
+
function wrapHtml(name, html, css) {
|
|
121
|
+
return generatePackageHtml(name, [html], css);
|
|
109
122
|
}
|
|
110
123
|
|
|
111
124
|
/**
|
|
@@ -128,7 +141,7 @@ module.exports = async function(opts) {
|
|
|
128
141
|
const xmir_html = createXmirHtmlBlock(xmir);
|
|
129
142
|
const html_app = path.join(output, path.dirname(relative),`${name}.html`);
|
|
130
143
|
fs.mkdirSync(path.dirname(html_app), {recursive: true});
|
|
131
|
-
fs.writeFileSync(html_app, wrapHtml(xmir_html, css));
|
|
144
|
+
fs.writeFileSync(html_app, wrapHtml(name, xmir_html, css));
|
|
132
145
|
const packages = path.dirname(relative).split(path.sep).join('.');
|
|
133
146
|
const html_package = path.join(output, `package_${packages}.html`);
|
|
134
147
|
if (!(packages in packages_info)) {
|
|
@@ -143,10 +156,10 @@ module.exports = async function(opts) {
|
|
|
143
156
|
for (const package_name of Object.keys(packages_info)) {
|
|
144
157
|
fs.mkdirSync(path.dirname(packages_info[package_name].path), {recursive: true});
|
|
145
158
|
fs.writeFileSync(packages_info[package_name].path,
|
|
146
|
-
generatePackageHtml(package_name
|
|
159
|
+
generatePackageHtml(`${package_name} package`, packages_info[package_name].xmir_htmls, css));
|
|
147
160
|
}
|
|
148
161
|
const packages = path.join(output, 'packages.html');
|
|
149
|
-
fs.writeFileSync(packages, generatePackageHtml('', all_xmir_htmls, css));
|
|
162
|
+
fs.writeFileSync(packages, generatePackageHtml('overall package', all_xmir_htmls, css));
|
|
150
163
|
console.info('Documentation generation completed in the %s directory', output);
|
|
151
164
|
} catch (error) {
|
|
152
165
|
console.error('Error generating documentation:', error);
|
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
* SPDX-License-Identifier: MIT
|
|
5
5
|
-->
|
|
6
6
|
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
|
7
|
+
<xsl:output method="html"/>
|
|
7
8
|
<xsl:template match="/">
|
|
8
|
-
<
|
|
9
|
-
<xsl:for-each select="//o[(@name and @name != 'φ') and (not(@base) or (@base != '∅' and @base != 'ξ'))]">
|
|
9
|
+
<article class="app-block">
|
|
10
|
+
<xsl:for-each select="//o[(@name and (@name != 'φ' and @name != 'λ' and not(starts-with(@name, '+')))) and (not(@base) or (@base != '∅' and @base != 'ξ'))]">
|
|
10
11
|
<xsl:if test="//comments/comment[@line = current()/@line]">
|
|
11
12
|
<div class="object-block">
|
|
12
13
|
<xsl:variable name="fullname">
|
|
@@ -17,7 +18,7 @@
|
|
|
17
18
|
</xsl:choose>
|
|
18
19
|
</xsl:for-each>
|
|
19
20
|
</xsl:variable>
|
|
20
|
-
<
|
|
21
|
+
<h1 class="object-title"><xsl:value-of select="$fullname"/></h1>
|
|
21
22
|
<p class="object-sign">
|
|
22
23
|
<xsl:value-of select="$fullname"/>(<xsl:for-each select="current()/o[@base and @base = '∅']">
|
|
23
24
|
<xsl:value-of select="@name"/>
|
|
@@ -25,15 +26,15 @@
|
|
|
25
26
|
<xsl:when test="position() != last()">, </xsl:when>
|
|
26
27
|
</xsl:choose>
|
|
27
28
|
</xsl:for-each>)</p>
|
|
28
|
-
<
|
|
29
|
+
<div class="object-desc">
|
|
29
30
|
<xsl:call-template name="break">
|
|
30
31
|
<xsl:with-param name="text" select="//comments/comment[@line = current()/@line]"/>
|
|
31
32
|
</xsl:call-template>
|
|
32
|
-
</
|
|
33
|
+
</div>
|
|
33
34
|
</div>
|
|
34
35
|
</xsl:if>
|
|
35
36
|
</xsl:for-each>
|
|
36
|
-
</
|
|
37
|
+
</article>
|
|
37
38
|
</xsl:template>
|
|
38
39
|
<xsl:template name="break">
|
|
39
40
|
<xsl:param name="text" select="string(.)"/>
|
package/src/version.js
CHANGED