Skip to content

Commit

Permalink
dependabot, labeler, testing
Browse files Browse the repository at this point in the history
  • Loading branch information
leonhma authored Jun 18, 2022
1 parent e5241b6 commit 4eec083
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 7 deletions.
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2

updates:
- package-ecosystem: npm
directory: '/'
schedule:
interval: daily
ignore:
- dependency-name: obsidian
assignees:
- leonhma
reviewers:
- leonhma
commit-message:
include: scope
prefix: chore
14 changes: 14 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
readme:
- 'README.md'

plugin:
- 'src/main.ts'

styles:
- 'src/styles.scss'

automation:
- '.github/workflows/*'

wontfix:
- 'LICENSE'
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
name: Build
name: CI

on: [push]

jobs:
echo:
runs-on: ubuntu-latest
steps:
- run: |
echo "${{ github.ref }}"
build:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/heads/')
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
on: pull_request

jobs:
label:
runs-on: ubuntu-latest

steps:
- name: Labeler
uses: actions/[email protected]
8 changes: 3 additions & 5 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default class ObsidianFunctionPlot extends Plugin {
async functionPlotHandler(source: string, el: HTMLElement, _ctx: MarkdownPostProcessorContext): Promise<void> {
try {
// styles
el.classList.add('functionplot')
el.classList.add('obsidian-functionplot-render')
// parse yaml for bounds and functions to plot

const header = (source.match(/-{3}[^]+-{3}/) || [null])[0]
Expand Down Expand Up @@ -66,10 +66,8 @@ export default class ObsidianFunctionPlot extends Plugin {
el.querySelectorAll('text').forEach(el => el.setAttribute('fill', 'currentColor'))
} catch (e) {
el.innerHTML = `
<div style="border-radius:1em;background:black;opacity:0.5">
<p style="opacity:1;font-size:0.7em;padding:1em">
${e}\n\n${source}
</p>
<div class="obsidian-functionplot-error">
<p>${e}\n\n${source}</p>
</div>`
}
}
Expand Down
14 changes: 13 additions & 1 deletion src/styles.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
.functionplot {
.obsidian-functionplot-render {
color: var(--text-normal);
width: 100%;
height: 100%;
border-radius: 0.5em;
}

.obsidian-functionplot-error {
border-radius: 1em;
background: black;
opacity: 0.5;

p {
opacity: 1;
font-size: 0.7em;
padding: 1em;
}
}

0 comments on commit 4eec083

Please sign in to comment.