Skip to content

Commit 4eec083

Browse files
authored
dependabot, labeler, testing
1 parent e5241b6 commit 4eec083

6 files changed

Lines changed: 62 additions & 7 deletions

File tree

.github/dependabot.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: 2
2+
3+
updates:
4+
- package-ecosystem: npm
5+
directory: '/'
6+
schedule:
7+
interval: daily
8+
ignore:
9+
- dependency-name: obsidian
10+
assignees:
11+
- leonhma
12+
reviewers:
13+
- leonhma
14+
commit-message:
15+
include: scope
16+
prefix: chore

.github/labeler.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
readme:
2+
- 'README.md'
3+
4+
plugin:
5+
- 'src/main.ts'
6+
7+
styles:
8+
- 'src/styles.scss'
9+
10+
automation:
11+
- '.github/workflows/*'
12+
13+
wontfix:
14+
- 'LICENSE'

.github/workflows/ci.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
name: Build
1+
name: CI
22

33
on: [push]
44

55
jobs:
6+
echo:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- run: |
10+
echo "${{ github.ref }}"
11+
612
build:
713
runs-on: ubuntu-latest
814
if: startsWith(github.ref, 'refs/heads/')

.github/workflows/labeler.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
on: pull_request
2+
3+
jobs:
4+
label:
5+
runs-on: ubuntu-latest
6+
7+
steps:
8+
- name: Labeler
9+
uses: actions/labeler@v4.0.0

src/main.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default class ObsidianFunctionPlot extends Plugin {
2929
async functionPlotHandler(source: string, el: HTMLElement, _ctx: MarkdownPostProcessorContext): Promise<void> {
3030
try {
3131
// styles
32-
el.classList.add('functionplot')
32+
el.classList.add('obsidian-functionplot-render')
3333
// parse yaml for bounds and functions to plot
3434

3535
const header = (source.match(/-{3}[^]+-{3}/) || [null])[0]
@@ -66,10 +66,8 @@ export default class ObsidianFunctionPlot extends Plugin {
6666
el.querySelectorAll('text').forEach(el => el.setAttribute('fill', 'currentColor'))
6767
} catch (e) {
6868
el.innerHTML = `
69-
<div style="border-radius:1em;background:black;opacity:0.5">
70-
<p style="opacity:1;font-size:0.7em;padding:1em">
71-
${e}\n\n${source}
72-
</p>
69+
<div class="obsidian-functionplot-error">
70+
<p>${e}\n\n${source}</p>
7371
</div>`
7472
}
7573
}

src/styles.scss

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
1-
.functionplot {
1+
.obsidian-functionplot-render {
22
color: var(--text-normal);
33
width: 100%;
44
height: 100%;
55
border-radius: 0.5em;
66
}
7+
8+
.obsidian-functionplot-error {
9+
border-radius: 1em;
10+
background: black;
11+
opacity: 0.5;
12+
13+
p {
14+
opacity: 1;
15+
font-size: 0.7em;
16+
padding: 1em;
17+
}
18+
}

0 commit comments

Comments
 (0)