Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build

env:
DENO_DIR: ${{ github.workspace }}/deno_cache_directory

on:
push:
branches:
- main
- dev
pull_request: {}

jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Cache Deno dependencies
uses: actions/cache@v2
with:
path: ${{ env.DENO_DIR }}
key: ${{ hashFiles('example/deno.lock') }}
- uses: denoland/setup-deno@v1.1.1
with:
deno-version: v1.x # Run with latest stable Deno.
# Check if the code is formatted according to Deno's default
# formatting conventions.
- run: deno fmt --check --ignore=$DENO_DIR

# Scan the code for syntax errors and style issues. If
# you want to use a custom linter configuration you can add a configuration file with --config <myconfig>
- run: deno lint --ignore=$DENO_DIR
# Unit tests
- run: deno task test
working-directory: ./example
# E2E tests
- run: |
deno task file_server &
deno task dev &
deno task test_e2e
working-directory: ./example
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# LUHMANN

A lightweight Deno library to dynamically generate a full website from a markdown Zettelkasten.
A lightweight Deno library to dynamically generate a full website from a
markdown Zettelkasten.

## WHAT?

Luhmann fetches markdown files from somewhere on the internet and converts them to a website.
Luhmann fetches markdown files from somewhere on the internet and converts them
to a website.

## GETTING STARTED

Expand All @@ -19,7 +21,6 @@ console.log(`HTTP webserver running. Access it at: http://localhost:8080/`);
for await (const conn of server) {
serveZettelkastenn, zettelResource });
}

```

### TESTS
Expand Down
6 changes: 3 additions & 3 deletions __snapshots__/luhmann_test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ Some test text",
snapshot[`simpleSnippet with bare data isSnapshotMatch 1`] = `
'<section>
<h2><a href="/missing name">missing title</a></h2>
<time datetime="Mon May 22 2023 21:57:18 GMT+0200 (Central European Summer Time)"></time>
<time datetime="Mon, 22 May 2023 19:57:18 GMT"></time>
<span>missing teaser</span>
\\t\\t </section>'
`;

snapshot[`simpleSnippet with full data isSnapshotMatch 1`] = `
'<section>
<h2><a href="/testslug">Test title</a></h2>
<time datetime="Mon May 22 2023 21:57:18 GMT+0200 (Central European Summer Time)"></time>
<time datetime="Mon, 22 May 2023 19:57:18 GMT"></time>
<span>Test teaser</span>
\\t\\t </section>'
`;
Expand Down Expand Up @@ -140,7 +140,7 @@ snapshot[`teaserifyDocs & markupify isSnapshotMatch 2`] = `
[
'<section>
<h2><a href="/test">A first test title</a></h2>
<time datetime="Fri May 21 2032 02:00:00 GMT+0200 (Central European Summer Time)">21.5.2032</time>
<time datetime="Fri, 21 May 2032 00:00:00 GMT">21.5.2032</time>
<span>Best test teaser in the industry</span>
\\t\\t </section>',
]
Expand Down
8 changes: 4 additions & 4 deletions __snapshots__/luhmann_test_e2e.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ snapshot[`e2e isSnapshotMatch 1`] = `
<main data-color-mode="light" data-light-theme="light" data-dark-theme="dark" class="markdown-body">
<section>
<h2><a href="/test_zettel_1">A first test title</a></h2>
<time datetime="Fri May 21 2032 02:00:00 GMT+0200 (Central European Summer Time)">21.5.2032</time>
<time datetime="Fri, 21 May 2032 00:00:00 GMT">21.5.2032</time>
<span>Best test teaser in the industry</span>
\\t\\t </section>,<section>
<h2><a href="/test_zettel_2">A second test title</a></h2>
<time datetime="Sat May 22 2032 02:00:00 GMT+0200 (Central European Summer Time)">22.5.2032</time>
<time datetime="Sat, 22 May 2032 00:00:00 GMT">22.5.2032</time>
<span>Second best test teaser in the industry</span>
\\t\\t </section>
</main>
Expand Down Expand Up @@ -51,7 +51,7 @@ snapshot[`e2e isSnapshotMatch 2`] = `
<main data-color-mode="light" data-light-theme="light" data-dark-theme="dark" class="markdown-body">
<section>
<h2><a href="/test_zettel_1">A first test title</a></h2>
<time datetime="Fri May 21 2032 02:00:00 GMT+0200 (Central European Summer Time)">21.5.2032</time>
<time datetime="Fri, 21 May 2032 00:00:00 GMT">21.5.2032</time>
<span>Best test teaser in the industry</span>
\\t\\t </section><h2 id="test-headline-1"><a class="anchor" aria-hidden="true" tabindex="-1" href="#test-headline-1"><svg class="octicon octicon-link" viewbox="0 0 16 16" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>Test Headline 1</h2><p>An unordered test list</p>
<ul>
Expand Down Expand Up @@ -92,7 +92,7 @@ snapshot[`e2e isSnapshotMatch 3`] = `
<main data-color-mode="light" data-light-theme="light" data-dark-theme="dark" class="markdown-body">
<section>
<h2><a href="/test_zettel_2">A second test title</a></h2>
<time datetime="Sat May 22 2032 02:00:00 GMT+0200 (Central European Summer Time)">22.5.2032</time>
<time datetime="Sat, 22 May 2032 00:00:00 GMT">22.5.2032</time>
<span>Second best test teaser in the industry</span>
\\t\\t </section><h2 id="test-headline-2"><a class="anchor" aria-hidden="true" tabindex="-1" href="#test-headline-2"><svg class="octicon octicon-link" viewbox="0 0 16 16" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>Test Headline 2</h2><p>An unordered test list</p>
<ul>
Expand Down
1 change: 1 addition & 0 deletions example/deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"format": "deno fmt ../luhmann.ts ../luhmann_test.ts",
"file_server": "deno run --allow-read --allow-net https://deno.land/std@0.188.0/http/file_server.ts static",
"update_snapshots": "deno test --allow-all ../luhmann_test.ts -- --update",
"update_snapshots_e2e": "deno test --allow-all ../luhmann_test_e2e.ts -- --update",
"test": "deno test --allow-read ../luhmann_test.ts",
"test_e2e": "deno test --allow-read --allow-net ../luhmann_test_e2e.ts",
"lint": "deno lint ../luhmann.ts ../luhmann_test.ts"
Expand Down
98 changes: 49 additions & 49 deletions example/deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading