Compare commits
20 Commits
46f7424bc9
...
v0.1.12
| Author | SHA1 | Date | |
|---|---|---|---|
|
2636e42533
|
|||
|
1a09a51780
|
|||
|
beb80145a4
|
|||
|
0076cbb971
|
|||
|
bd9945b24b
|
|||
|
760af891c5
|
|||
|
f8b15f0ff4
|
|||
|
20e585e708
|
|||
|
3da2c28b13
|
|||
|
35a2080714
|
|||
|
e99170f015
|
|||
|
f48d0a6194
|
|||
|
92a9fe5685
|
|||
|
d0166b1db9
|
|||
|
821456c226
|
|||
|
5ff9cee8de
|
|||
|
df4545a7f1
|
|||
|
34c4144c3d
|
|||
|
fbe142f12f
|
|||
|
bcd60473b6
|
36
.gitea/workflows/build-and-pubilsh.yaml
Normal file
36
.gitea/workflows/build-and-pubilsh.yaml
Normal file
@@ -0,0 +1,36 @@
|
||||
|
||||
name: Build and publish
|
||||
|
||||
on:
|
||||
- workflow_dispatch
|
||||
# push:
|
||||
# branches:
|
||||
# - master
|
||||
|
||||
jobs:
|
||||
build-and-publish:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
NPM_PUBLISH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Use Node.js 20
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
- name: Login to package registry
|
||||
run: |
|
||||
npm config set @doc-utils:registry https://gitea.jbrumond.me/api/packages/doc-utils/npm/
|
||||
npm config set -- '//gitea.jbrumond.me/api/packages/doc-utils/npm/:_authToken' "$NPM_PUBLISH_TOKEN"
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Compile TypeScript
|
||||
run: npm run tsc
|
||||
|
||||
- name: Publish package
|
||||
run: npm publish
|
||||
40
.gitea/workflows/build-and-test.yaml
Normal file
40
.gitea/workflows/build-and-test.yaml
Normal file
@@ -0,0 +1,40 @@
|
||||
|
||||
name: Build and test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build-and-test:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [18.x, 20.x]
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
|
||||
- name: Login to package registry
|
||||
run: |
|
||||
npm config set @doc-utils:registry https://gitea.jbrumond.me/api/packages/doc-utils/npm/
|
||||
npm config set -- '//gitea.jbrumond.me/api/packages/doc-utils/npm/:_authToken' "$NPM_PUBLISH_TOKEN"
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Compile TypeScript
|
||||
run: npm run tsc
|
||||
|
||||
# todo: tests
|
||||
- name: Run tests
|
||||
run: exit 0
|
||||
@@ -58,6 +58,7 @@ figure[data-lang].big svg {
|
||||
max-height: none !important;
|
||||
} */
|
||||
|
||||
/* figure:is([data-lang='pikchr'], [data-lang='nomnoml'], [data-lang='bytefield']) svg text:not([fill^='var']) { */
|
||||
figure:is([data-lang='pikchr'], [data-lang='nomnoml'], [data-lang='bytefield']) svg text {
|
||||
fill: var(--theme-text-body);
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ del {
|
||||
a {
|
||||
font-family: inherit;
|
||||
color: var(--theme-text-link);
|
||||
display: inline-flex;
|
||||
display: inline;
|
||||
align-items: center;
|
||||
column-gap: 0.2rem;
|
||||
}
|
||||
@@ -109,7 +109,8 @@ a:visited {
|
||||
color: var(--theme-text-link-visited);
|
||||
}
|
||||
|
||||
a.icon-link {
|
||||
a.icon-link,
|
||||
a.inline-flex {
|
||||
display: inline-flex;
|
||||
column-gap: 0.3rem;
|
||||
align-items: center;
|
||||
@@ -192,64 +193,64 @@ mark {
|
||||
|
||||
/* ===== Tables ===== */
|
||||
|
||||
table, .table, td, .td {
|
||||
table, .faux-table, td, .faux-td {
|
||||
color: var(--theme-text-body);
|
||||
font-family: var(--font-body);
|
||||
}
|
||||
|
||||
table, .table {
|
||||
table, .faux-table {
|
||||
display: table;
|
||||
margin-block: 2rem;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
table, th, td,
|
||||
.table, .th, .td {
|
||||
.faux-table, .faux-th, .faux-td {
|
||||
font-size: 1rem;
|
||||
line-height: 1.75;
|
||||
}
|
||||
|
||||
thead, .thead {
|
||||
thead, .faux-thead {
|
||||
display: table-header-group;
|
||||
}
|
||||
|
||||
tbody, .tbody {
|
||||
tbody, .faux-tbody {
|
||||
display: table-row-group;
|
||||
}
|
||||
|
||||
tbody tr,
|
||||
.tbody .tr {
|
||||
.faux-tbody .faux-tr {
|
||||
border-top: 1px var(--theme-line) solid;
|
||||
}
|
||||
|
||||
tr, .tr {
|
||||
tr, .faux-tr {
|
||||
display: table-row;
|
||||
}
|
||||
|
||||
th, .th {
|
||||
th, .faux-th {
|
||||
text-align: center;
|
||||
font-weight: 700;
|
||||
color: var(--theme-text-heading);
|
||||
}
|
||||
|
||||
th, .th,
|
||||
td, .td {
|
||||
th, .faux-th,
|
||||
td, .faux-td {
|
||||
padding-block: 0.5rem;
|
||||
padding-inline: 1rem;
|
||||
display: table-cell;
|
||||
}
|
||||
|
||||
td, .td {
|
||||
td, .faux-td {
|
||||
display: table-cell;
|
||||
font-weight: 300;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
:is(td, .td):not(:last-of-type) {
|
||||
:is(td, .faux-td):not(:last-of-type) {
|
||||
border-inline-end: 0.1rem solid var(--theme-line);
|
||||
}
|
||||
|
||||
:is(table, .table) :is(input, select) {
|
||||
:is(table, .faux-table) :is(input, select) {
|
||||
margin-block: 0;
|
||||
}
|
||||
|
||||
|
||||
32
package-lock.json
generated
32
package-lock.json
generated
@@ -1,16 +1,16 @@
|
||||
{
|
||||
"name": "@doc-utils/docs2website",
|
||||
"version": "0.1.6",
|
||||
"version": "0.1.12",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@doc-utils/docs2website",
|
||||
"version": "0.1.6",
|
||||
"version": "0.1.12",
|
||||
"dependencies": {
|
||||
"@doc-utils/color-themes": "^0.1.15",
|
||||
"@doc-utils/color-themes": "^0.2.0",
|
||||
"@doc-utils/jsonschema2markdown": "^0.1.1",
|
||||
"@doc-utils/markdown2html": "^0.3.4",
|
||||
"@doc-utils/markdown2html": "^0.3.6",
|
||||
"glob": "^10.2.3",
|
||||
"ical": "^0.8.0",
|
||||
"ical-generator": "^4.1.0",
|
||||
@@ -33,9 +33,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@doc-utils/color-themes": {
|
||||
"version": "0.1.15",
|
||||
"resolved": "https://gitea.jbrumond.me/api/packages/doc-utils/npm/%40doc-utils%2Fcolor-themes/-/0.1.15/color-themes-0.1.15.tgz",
|
||||
"integrity": "sha512-P0oIlq4Z0cUOf7P4T2OUfhT/Cn/msl3oHTenVWHxKMDPlIYueR6AhFdRCHTI0A+DxyH+0EIi6CnMq3JYnILI0w=="
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://gitea.jbrumond.me/api/packages/doc-utils/npm/%40doc-utils%2Fcolor-themes/-/0.2.0/color-themes-0.2.0.tgz",
|
||||
"integrity": "sha512-UtjY25B8m4qdMvrmTPK3I1JXckbc1cvCOmIygHFBexpSWBQmb+sdoXfdCsoSpgPncurz1kwlEXffgPELCGtP8g=="
|
||||
},
|
||||
"node_modules/@doc-utils/jsonschema2markdown": {
|
||||
"version": "0.1.1",
|
||||
@@ -51,9 +51,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@doc-utils/markdown2html": {
|
||||
"version": "0.3.4",
|
||||
"resolved": "https://gitea.jbrumond.me/api/packages/doc-utils/npm/%40doc-utils%2Fmarkdown2html/-/0.3.4/markdown2html-0.3.4.tgz",
|
||||
"integrity": "sha512-zL3kay/zbrBJWGKIxGCyF+EXsafSxY1aN+miG+GOyml1neoOwd67vNIiE96KuEucf6rvuICPiYTjm3uJxkjd/g==",
|
||||
"version": "0.3.6",
|
||||
"resolved": "https://gitea.jbrumond.me/api/packages/doc-utils/npm/%40doc-utils%2Fmarkdown2html/-/0.3.6/markdown2html-0.3.6.tgz",
|
||||
"integrity": "sha512-LCt5HAAcHz6lE+IqV2igQP7bbTq1juNbyn4KWqn3xe9eSslIyl7EvSaEH68WQtqEzX/iVFOvZz7qSoqsQeggXA==",
|
||||
"dependencies": {
|
||||
"bytefield-svg": "^1.6.1",
|
||||
"dompurify": "^2.3.6",
|
||||
@@ -2677,9 +2677,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@doc-utils/color-themes": {
|
||||
"version": "0.1.15",
|
||||
"resolved": "https://gitea.jbrumond.me/api/packages/doc-utils/npm/%40doc-utils%2Fcolor-themes/-/0.1.15/color-themes-0.1.15.tgz",
|
||||
"integrity": "sha512-P0oIlq4Z0cUOf7P4T2OUfhT/Cn/msl3oHTenVWHxKMDPlIYueR6AhFdRCHTI0A+DxyH+0EIi6CnMq3JYnILI0w=="
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://gitea.jbrumond.me/api/packages/doc-utils/npm/%40doc-utils%2Fcolor-themes/-/0.2.0/color-themes-0.2.0.tgz",
|
||||
"integrity": "sha512-UtjY25B8m4qdMvrmTPK3I1JXckbc1cvCOmIygHFBexpSWBQmb+sdoXfdCsoSpgPncurz1kwlEXffgPELCGtP8g=="
|
||||
},
|
||||
"@doc-utils/jsonschema2markdown": {
|
||||
"version": "0.1.1",
|
||||
@@ -2695,9 +2695,9 @@
|
||||
}
|
||||
},
|
||||
"@doc-utils/markdown2html": {
|
||||
"version": "0.3.4",
|
||||
"resolved": "https://gitea.jbrumond.me/api/packages/doc-utils/npm/%40doc-utils%2Fmarkdown2html/-/0.3.4/markdown2html-0.3.4.tgz",
|
||||
"integrity": "sha512-zL3kay/zbrBJWGKIxGCyF+EXsafSxY1aN+miG+GOyml1neoOwd67vNIiE96KuEucf6rvuICPiYTjm3uJxkjd/g==",
|
||||
"version": "0.3.6",
|
||||
"resolved": "https://gitea.jbrumond.me/api/packages/doc-utils/npm/%40doc-utils%2Fmarkdown2html/-/0.3.6/markdown2html-0.3.6.tgz",
|
||||
"integrity": "sha512-LCt5HAAcHz6lE+IqV2igQP7bbTq1juNbyn4KWqn3xe9eSslIyl7EvSaEH68WQtqEzX/iVFOvZz7qSoqsQeggXA==",
|
||||
"requires": {
|
||||
"bytefield-svg": "^1.6.1",
|
||||
"dompurify": "^2.3.6",
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "@doc-utils/docs2website",
|
||||
"version": "0.1.6",
|
||||
"version": "0.1.12",
|
||||
"publishConfig": {
|
||||
"registry": "https://gitea.home.jbrumond.me/api/packages/doc-utils/npm/"
|
||||
"registry": "https://gitea.jbrumond.me/api/packages/doc-utils/npm/"
|
||||
},
|
||||
"scripts": {
|
||||
"tsc": "tsc",
|
||||
@@ -22,9 +22,9 @@
|
||||
"typescript": "^5.0.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"@doc-utils/color-themes": "^0.1.15",
|
||||
"@doc-utils/color-themes": "^0.2.0",
|
||||
"@doc-utils/jsonschema2markdown": "^0.1.1",
|
||||
"@doc-utils/markdown2html": "^0.3.4",
|
||||
"@doc-utils/markdown2html": "^0.3.6",
|
||||
"glob": "^10.2.3",
|
||||
"ical": "^0.8.0",
|
||||
"ical-generator": "^4.1.0",
|
||||
|
||||
@@ -8,9 +8,8 @@ import { render_theme_css_properties } from '../themes';
|
||||
import { load_partials, FrontMatter, Context, load_layout, render_template, EventFrontmatter } from '../template';
|
||||
import { render_markdown_to_html, render_markdown_to_html_inline_sync } from '@doc-utils/markdown2html';
|
||||
import { RSSEntry } from './rss';
|
||||
import { DateTime } from 'luxon';
|
||||
import { EventEntry } from './icalendar';
|
||||
import { as_context_time, as_html_time, from_iso } from '../time';
|
||||
import { as_context_time, from_iso } from '../time';
|
||||
import { FileMetadata } from '../metadata';
|
||||
|
||||
export interface OutFileURL {
|
||||
@@ -31,9 +30,9 @@ export function map_output_file_to_url(state: BuildState, out_file: string, inde
|
||||
rel_path = '/' + rel_path;
|
||||
}
|
||||
|
||||
const base_url = state.conf.base_url.endsWith('/')
|
||||
const base_url = state.conf.base_url?.endsWith('/')
|
||||
? state.conf.base_url.slice(0, -1)
|
||||
: state.conf.base_url;
|
||||
: (state.conf.base_url ?? '');
|
||||
|
||||
return {
|
||||
base_url,
|
||||
@@ -108,7 +107,7 @@ export function mustache_context(state: BuildState, page_url: string, metadata:
|
||||
return {
|
||||
env: state.env,
|
||||
page: frontmatter,
|
||||
base_url: state.conf.base_url,
|
||||
base_url: state.conf.base_url ?? '/',
|
||||
page_url: page_url,
|
||||
page_published: as_context_time(from_iso(metadata.first_seen_time), 'dt-published'),
|
||||
page_updated: has_been_updated ? as_context_time(from_iso(metadata.last_updated_time), 'dt-updated') : null,
|
||||
@@ -142,7 +141,7 @@ export function mustache_context(state: BuildState, page_url: string, metadata:
|
||||
export async function render_page(state: BuildState, in_file: string, out_file: string, out_url: OutFileURL, text: string, render_as_markdown: boolean, hash: string, frontmatter?: any) {
|
||||
if (render_as_markdown) {
|
||||
const opts = Object.assign({ }, state.conf.markdown, {
|
||||
base_url: out_url.abs_url
|
||||
// base_url: out_url.abs_url,
|
||||
});
|
||||
|
||||
text = await render_markdown_to_html(text, opts);
|
||||
|
||||
Reference in New Issue
Block a user