Skip to content

Commit e3f4395

Browse files
committed
Add 'packages/Flat-Website/' from commit '89aa8e582c6124775846b52ec3350986363bc4de'
git-subtree-dir: packages/Flat-Website git-subtree-mainline: 6f86a8f git-subtree-split: 89aa8e5
2 parents 6f86a8f + 89aa8e5 commit e3f4395

172 files changed

Lines changed: 38615 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.DS_Store
2+
node_modules
3+
/build
4+
/.svelte-kit
5+
/package
6+
.env
7+
.env.*
8+
!.env.example
9+
10+
# Ignore files for PNPM, NPM and YARN
11+
pnpm-lock.yaml
12+
package-lock.json
13+
yarn.lock
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module.exports = {
2+
extends: [
3+
// add more generic rule sets here, such as:
4+
// 'eslint:recommended',
5+
'plugin:svelte/recommended',
6+
],
7+
rules: {
8+
// override/add rules settings here, such as:
9+
// 'svelte/rule-name': 'error'
10+
},
11+
};
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Test Flat-Website Server
2+
3+
on:
4+
push:
5+
branches: ['master']
6+
pull_request:
7+
branches: ['master']
8+
schedule:
9+
- cron: '0 7 * * *'
10+
11+
env:
12+
LOGGING_DEFAULT_SHOW_PREFIX: true
13+
LOGGING_DEFAULT_LOGGING_LEVEL: DEBUG
14+
LOGGING_DEFAULT_SHOW_FORMATTING: true
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Setup Maven Action
22+
uses: s4u/setup-maven-action@v1.8.0
23+
with:
24+
java-version: 8
25+
26+
- uses: actions/checkout@v3
27+
28+
- name: Download latest Airship
29+
uses: FlatLang/fetch-airship@master
30+
with:
31+
includePrerelease: true
32+
33+
- uses: actions/setup-node@v3
34+
with:
35+
node-version: 20
36+
37+
- name: Cache Maven dependencies
38+
uses: actions/cache@v3
39+
with:
40+
path: |
41+
~/.m2/repository
42+
key: ${{ runner.os }}-build-${{ env.cache-name }}
43+
restore-keys: |
44+
${{ runner.os }}-build-${{ env.cache-name }}-
45+
${{ runner.os }}-build-
46+
${{ runner.os }}-
47+
48+
- name: Build Flat-Website server Test
49+
run: |
50+
node airship.js -f server install test -t es6
51+
52+
- uses: actions/upload-artifact@v4
53+
if: failure()
54+
with:
55+
name: test.js
56+
path: dist/es6/test.js
57+
58+
- name: Run Flat-Website server Test
59+
run: |
60+
node airship.js -f server run test

packages/Flat-Website/.gitignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
.DS_Store
2+
node_modules
3+
/build
4+
/.svelte-kit
5+
/package
6+
.env
7+
.env.*
8+
!.env.example
9+
src/lib/server/server.js
10+
11+
# dependencies
12+
node_modules
13+
14+
# sst
15+
.sst
16+
.build
17+
18+
# opennext
19+
.open-next
20+
21+
# misc
22+
.DS_Store
23+
24+
# local env files
25+
.env*.local

packages/Flat-Website/.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
engine-strict=true
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.DS_Store
2+
node_modules
3+
/build
4+
/.svelte-kit
5+
/package
6+
.env
7+
.env.*
8+
!.env.example
9+
10+
# Ignore files for PNPM, NPM and YARN
11+
pnpm-lock.yaml
12+
package-lock.json
13+
yarn.lock
14+
.sst
15+
*.min.js

packages/Flat-Website/.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"useTabs": false,
3+
"singleQuote": true,
4+
"trailingComma": "all",
5+
"printWidth": 100
6+
}

packages/Flat-Website/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# create-svelte
2+
3+
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).
4+
5+
## Creating a project
6+
7+
If you're seeing this, you've probably already done this step. Congrats!
8+
9+
```bash
10+
# create a new project in the current directory
11+
npm create svelte@latest
12+
13+
# create a new project in my-app
14+
npm create svelte@latest my-app
15+
```
16+
17+
## Developing
18+
19+
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
20+
21+
```bash
22+
npm run dev
23+
24+
# or start the server and open the app in a new browser tab
25+
npm run dev -- --open
26+
```
27+
28+
## Building
29+
30+
To create a production version of your app:
31+
32+
```bash
33+
npm run build
34+
```
35+
36+
You can preview the production build with `npm run preview`.
37+
38+
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import { parse } from 'node-html-parser';
2+
3+
function isHeader(element) {
4+
return ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].indexOf(element.tagName.toLocaleLowerCase()) >= 0;
5+
}
6+
7+
export function anchorButton(element) {
8+
const anchor = parse(
9+
`<a href="#${element.id}" class="anchor-button"><img src="/images/link.svg" alt="permalink" /></a>`,
10+
);
11+
12+
function addAnchor(element) {
13+
element.appendChild(anchor);
14+
element.classList.add('anchor-button-container');
15+
element.setAttribute('style', 'position: relative;');
16+
}
17+
18+
function addContentToHeader(header) {
19+
header.set_content(`<span class="anchor-button-content">${header.innerHTML}</span>`);
20+
}
21+
22+
if (isHeader(element)) {
23+
addContentToHeader(element);
24+
addAnchor(element);
25+
} else {
26+
const child = element.querySelector('h1, h2, h3, h4, h5, h6');
27+
28+
if (isHeader(child)) {
29+
addContentToHeader(child);
30+
addAnchor(child);
31+
} else {
32+
addAnchor(element);
33+
}
34+
}
35+
}
36+
37+
export default async function ({ content }) {
38+
const root = parse(content);
39+
const anchors = root.querySelectorAll(`[anchor-button]`);
40+
41+
anchors.forEach((anchor) => {
42+
anchorButton(anchor);
43+
});
44+
45+
const code = root.toString();
46+
47+
return { code };
48+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"hosted-zone:account=477864722356:domainName=flatlang.org:region=us-east-1": {
3+
"Id": "/hostedzone/Z00185581BNW4Y7I2B083",
4+
"Name": "flatlang.org."
5+
}
6+
}

0 commit comments

Comments
 (0)