@publisle/template-article 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/README.md +14 -2
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +42 -0
- package/dist/index.js.map +1 -0
- package/package.json +34 -3
- package/src/index.ts +47 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 VoidReg
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @publisle/template-article
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Publisle Research profile package.
|
|
4
|
+
|
|
5
|
+
Requires Node.js 24 or later. Framework adapters also require their declared peer dependencies.
|
|
6
|
+
This package is part of Publisle `0.1.0`, the first beta release.
|
|
7
|
+
Frozen contract version integers are independent of npm package versions.
|
|
8
|
+
|
|
9
|
+
- [Core standard](https://github.com/VoidReg/publisle/blob/main/docs/standards/README.md)
|
|
10
|
+
- [Quickstart and package usage](https://github.com/VoidReg/publisle#readme)
|
|
11
|
+
- [Distribution and release checklist](https://github.com/VoidReg/publisle/blob/main/docs/guides/releases.md)
|
|
12
|
+
- [Research export guide](https://github.com/VoidReg/publisle/blob/main/docs/guides/journal-export.md)
|
|
13
|
+
|
|
14
|
+
Research tooling is optional and is excluded from Core-only installations. Read any
|
|
15
|
+
included `NOTICE.md` for third-party licensing obligations.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,wBAAwB,CAAC;AAChC,eAAO,MAAM,QAAQ,EAAE,kBAyBtB,CAAC;AACF,eAAO,MAAM,cAAc,EAAE,kBAgB5B,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { renderLatexArticle, } from "@publisle/template-sdk";
|
|
2
|
+
export const template = {
|
|
3
|
+
id: "article",
|
|
4
|
+
version: "1.0.0",
|
|
5
|
+
format: "latex",
|
|
6
|
+
engines: ["pdflatex", "lualatex"],
|
|
7
|
+
languages: ["en"],
|
|
8
|
+
directions: ["ltr"],
|
|
9
|
+
bibliographyMode: "csl",
|
|
10
|
+
requiredMetadata: ["title", "authors"],
|
|
11
|
+
validate(article, _context) {
|
|
12
|
+
if (!article.title || !article.authors.length)
|
|
13
|
+
throw new Error("Template requires title and authors.");
|
|
14
|
+
return [];
|
|
15
|
+
},
|
|
16
|
+
render: (article, context) => renderLatexArticle(article, context, {
|
|
17
|
+
id: "article",
|
|
18
|
+
version: "1.0.0",
|
|
19
|
+
className: "article",
|
|
20
|
+
classOptions: "11pt,a4paper",
|
|
21
|
+
defaultEngine: "lualatex",
|
|
22
|
+
tagging: true,
|
|
23
|
+
direction: "ltr",
|
|
24
|
+
}),
|
|
25
|
+
};
|
|
26
|
+
export const arabicTemplate = {
|
|
27
|
+
...template,
|
|
28
|
+
id: "article-arabic",
|
|
29
|
+
engines: ["lualatex"],
|
|
30
|
+
languages: ["ar"],
|
|
31
|
+
directions: ["rtl"],
|
|
32
|
+
render: (article, context) => renderLatexArticle(article, context, {
|
|
33
|
+
id: "article-arabic",
|
|
34
|
+
version: "1.0.0",
|
|
35
|
+
className: "article",
|
|
36
|
+
classOptions: "11pt,a4paper",
|
|
37
|
+
defaultEngine: "lualatex",
|
|
38
|
+
tagging: true,
|
|
39
|
+
direction: "rtl",
|
|
40
|
+
}),
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,GAEnB,MAAM,wBAAwB,CAAC;AAChC,MAAM,CAAC,MAAM,QAAQ,GAAuB;IAC1C,EAAE,EAAE,SAAS;IACb,OAAO,EAAE,OAAO;IAChB,MAAM,EAAE,OAAO;IACf,OAAO,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;IACjC,SAAS,EAAE,CAAC,IAAI,CAAC;IACjB,UAAU,EAAE,CAAC,KAAK,CAAC;IACnB,gBAAgB,EAAE,KAAK;IACvB,gBAAgB,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC;IACtC,QAAQ,CAAC,OAAO,EAAE,QAAQ;QACxB,IAAI,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM;YAC3C,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;QAE1D,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,CAC3B,kBAAkB,CAAC,OAAO,EAAE,OAAO,EAAE;QACnC,EAAE,EAAE,SAAS;QACb,OAAO,EAAE,OAAO;QAChB,SAAS,EAAE,SAAS;QACpB,YAAY,EAAE,cAAc;QAC5B,aAAa,EAAE,UAAU;QACzB,OAAO,EAAE,IAAI;QACb,SAAS,EAAE,KAAK;KACjB,CAAC;CACL,CAAC;AACF,MAAM,CAAC,MAAM,cAAc,GAAuB;IAChD,GAAG,QAAQ;IACX,EAAE,EAAE,gBAAgB;IACpB,OAAO,EAAE,CAAC,UAAU,CAAC;IACrB,SAAS,EAAE,CAAC,IAAI,CAAC;IACjB,UAAU,EAAE,CAAC,KAAK,CAAC;IACnB,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,CAC3B,kBAAkB,CAAC,OAAO,EAAE,OAAO,EAAE;QACnC,EAAE,EAAE,gBAAgB;QACpB,OAAO,EAAE,OAAO;QAChB,SAAS,EAAE,SAAS;QACpB,YAAY,EAAE,cAAc;QAC5B,aAAa,EAAE,UAAU;QACzB,OAAO,EAAE,IAAI;QACb,SAAS,EAAE,KAAK;KACjB,CAAC;CACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@publisle/template-article",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@publisle/template-sdk": "0.1.0"
|
|
16
|
+
},
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"access": "public"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist",
|
|
22
|
+
"src",
|
|
23
|
+
"README.md",
|
|
24
|
+
"NOTICE.md",
|
|
25
|
+
"LICENSE"
|
|
26
|
+
],
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": ">=24"
|
|
29
|
+
},
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "git+https://github.com/VoidReg/publisle.git",
|
|
33
|
+
"directory": "packages/template-article"
|
|
34
|
+
},
|
|
35
|
+
"homepage": "https://github.com/VoidReg/publisle#readme",
|
|
36
|
+
"types": "./dist/index.d.ts"
|
|
6
37
|
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import {
|
|
2
|
+
renderLatexArticle,
|
|
3
|
+
type PublishingTemplate,
|
|
4
|
+
} from "@publisle/template-sdk";
|
|
5
|
+
export const template: PublishingTemplate = {
|
|
6
|
+
id: "article",
|
|
7
|
+
version: "1.0.0",
|
|
8
|
+
format: "latex",
|
|
9
|
+
engines: ["pdflatex", "lualatex"],
|
|
10
|
+
languages: ["en"],
|
|
11
|
+
directions: ["ltr"],
|
|
12
|
+
bibliographyMode: "csl",
|
|
13
|
+
requiredMetadata: ["title", "authors"],
|
|
14
|
+
validate(article, _context) {
|
|
15
|
+
if (!article.title || !article.authors.length)
|
|
16
|
+
throw new Error("Template requires title and authors.");
|
|
17
|
+
|
|
18
|
+
return [];
|
|
19
|
+
},
|
|
20
|
+
render: (article, context) =>
|
|
21
|
+
renderLatexArticle(article, context, {
|
|
22
|
+
id: "article",
|
|
23
|
+
version: "1.0.0",
|
|
24
|
+
className: "article",
|
|
25
|
+
classOptions: "11pt,a4paper",
|
|
26
|
+
defaultEngine: "lualatex",
|
|
27
|
+
tagging: true,
|
|
28
|
+
direction: "ltr",
|
|
29
|
+
}),
|
|
30
|
+
};
|
|
31
|
+
export const arabicTemplate: PublishingTemplate = {
|
|
32
|
+
...template,
|
|
33
|
+
id: "article-arabic",
|
|
34
|
+
engines: ["lualatex"],
|
|
35
|
+
languages: ["ar"],
|
|
36
|
+
directions: ["rtl"],
|
|
37
|
+
render: (article, context) =>
|
|
38
|
+
renderLatexArticle(article, context, {
|
|
39
|
+
id: "article-arabic",
|
|
40
|
+
version: "1.0.0",
|
|
41
|
+
className: "article",
|
|
42
|
+
classOptions: "11pt,a4paper",
|
|
43
|
+
defaultEngine: "lualatex",
|
|
44
|
+
tagging: true,
|
|
45
|
+
direction: "rtl",
|
|
46
|
+
}),
|
|
47
|
+
};
|