Skip to content

Commit db2fabe

Browse files
Merge pull request #81 from TorstenDittmann/feat-enhanced-image
feat: relative images
2 parents ce3ee8c + 76e3905 commit db2fabe

File tree

22 files changed

+2935
-2355
lines changed

22 files changed

+2935
-2355
lines changed

.github/workflows/lint.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Lint
2+
on:
3+
pull_request:
4+
branches: ['**']
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- uses: actions/setup-node@v4
11+
with:
12+
node-version: '20.x'
13+
registry-url: 'https://registry.npmjs.org'
14+
- run: npm ci
15+
- run: npm run lint

.github/workflows/publish.yml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
name: Publish
22
on:
3-
release:
4-
types: [published]
3+
release:
4+
types: [published]
55
jobs:
6-
build:
7-
runs-on: ubuntu-latest
8-
steps:
9-
- uses: actions/checkout@v3
10-
# Setup .npmrc file to publish to npm
11-
- uses: actions/setup-node@v3
12-
with:
13-
node-version: '20.x'
14-
registry-url: 'https://registry.npmjs.org'
15-
- run: npm ci
16-
- run: npm run publish-packages
17-
env:
18-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- uses: actions/setup-node@v4
11+
with:
12+
node-version: '20.x'
13+
registry-url: 'https://registry.npmjs.org'
14+
- run: npm ci
15+
- run: npm run publish-packages
16+
env:
17+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/test.yml

Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,22 @@
1-
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3-
41
name: Tests
5-
62
on:
7-
push:
8-
branches: [ "main" ]
9-
pull_request:
10-
branches: [ "main" ]
11-
3+
pull_request:
4+
branches: ['**']
125
jobs:
13-
tests:
14-
strategy:
15-
matrix:
16-
os: [ubuntu-latest, windows-latest, macos-latest]
17-
node-version: [20.x]
18-
runs-on: ${{ matrix.os }}
19-
steps:
20-
- uses: actions/checkout@v3
21-
- name: Use Node.js ${{ matrix.node-version }}
22-
uses: actions/setup-node@v3
23-
with:
24-
node-version: ${{ matrix.node-version }}
25-
cache: 'npm'
26-
- run: npm ci
27-
- run: npm run build
28-
- run: npx playwright install
29-
- run: npm test
6+
tests:
7+
strategy:
8+
matrix:
9+
os: [ubuntu-latest, windows-latest, macos-latest]
10+
node-version: [20.x]
11+
runs-on: ${{ matrix.os }}
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Use Node.js ${{ matrix.node-version }}
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: ${{ matrix.node-version }}
18+
cache: 'npm'
19+
- run: npm ci
20+
- run: npm run build
21+
- run: npx playwright install --with-deps chromium
22+
- run: npm test

apps/demo/.eslintrc.cjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type { import("eslint").Linter.Config } */
12
module.exports = {
23
root: true,
34
extends: [

apps/demo/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
},
1515
"devDependencies": {
1616
"@playwright/test": "^1.28.1",
17-
"@sveltejs/adapter-auto": "^3.0.0",
18-
"@sveltejs/kit": "^2.0.0",
17+
"@sveltejs/adapter-cloudflare": "^4.4.0",
18+
"@sveltejs/kit": "*",
1919
"@sveltejs/vite-plugin-svelte": "^3.0.0",
20-
"@typescript-eslint/eslint-plugin": "^6.13.1",
21-
"@typescript-eslint/parser": "^6.17.0",
20+
"@typescript-eslint/eslint-plugin": "^7.0.0",
21+
"@typescript-eslint/parser": "*",
2222
"eslint": "^8.53.0",
23-
"eslint-config-prettier": "^9.0.0",
23+
"eslint-config-prettier": "^9.1.0",
2424
"eslint-plugin-svelte": "^2.35.1",
2525
"prettier": "*",
2626
"prettier-plugin-svelte": "^3.0.3",
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../routes/playground/markdown/image.jpeg

apps/demo/src/routes/+layout.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
>Close menu</a
3939
>
4040
</div>
41-
4241
<nav class="p-navigation__nav" aria-label="Navigation">
4342
<ul class="p-navigation__items">
4443
{#each links as link}

apps/demo/src/routes/playground/markdown/+page.markdoc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,15 @@ Lists
1616

1717
`Inline code`
1818

19-
```
19+
```html
2020
Code fences
2121
```
2222

23+
![Images](./image.jpeg)
24+
![Images]($lib/assets/image.jpeg)
25+
![Images](assets/image.jpeg)
26+
![Images](/favicon.png)
27+
2328
## Why create Markdoc instead of using an alternative?
2429

2530
### Why not MDX?
@@ -28,7 +33,7 @@ Code fences
2833

2934
Markdoc uses a fully declarative approach to composition and flow control, where MDX relies on JavaScript and React. This means MDX affords users more power and flexibility, but at the cost of complexity–content can quickly become as complex as regular code, which can lead to maintainability complications or a more difficult authoring environment.
3035

31-
One of the key motivations for creating Markdoc at Stripe was to create a format that is optimized for writing rather than programming so that we could overcome the challenges that resulted from mixing code and content in our legacy documentation platform. With Markdoc, contributors can iterate quickly without having to subject their edits to a code review and the standard of technical scrutiny that we would have to apply to a format that supports embedded JavaScript. Markdoc also helps us enforce stronger controls around presentation and page logic, avoiding situations in which one-off hacks and procedural content generation introduce bugs and unpredictable behavior.
36+
One of the key motivations for creating Markdoc at Stripe was to create a format that is optimized for writing rather than programming so that we could overcome the challenges that resulted from mixing code and content in our legacy documentation platform. With Markdoc, contributors can iterate quickly without having to subject their edits to a code review and the standard of technical scrutiny that we would have to apply to a format that supports embedded JavaScript. Markdoc also helps us enforce stronger controls around presentation and page logic, avoiding situations in which one-off hacks and procedural content generation introduce bugs and unpredictable behavior.
3237

3338
Markdoc's first-class, declarative tag syntax integrates seamlessly with Markdown content and can make it simpler to handle content transforms, static analysis, and validation in a unified, lightweight manner. In MDX, some of these tasks require operating on a more complicated JavaScript AST and accounting for the full spectrum of JavaScript language features. MDX also has a significantly larger runtime dependency footprint and relies on a JavaScript parser to handle the embedded logic.
3439

3.14 KB
Loading

apps/demo/svelte.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import adapter from '@sveltejs/adapter-auto';
1+
import adapter from '@sveltejs/adapter-cloudflare';
22
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
33
import { dirname, join } from 'path';
44
import { fileURLToPath } from 'url';
@@ -34,6 +34,9 @@ const config = {
3434
// If your environment is not supported or you settled on a specific environment, switch out the adapter.
3535
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
3636
adapter: adapter(),
37+
alias: {
38+
assets: 'src/lib/assets',
39+
},
3740
},
3841
};
3942

0 commit comments

Comments
 (0)