From 4eec08390e4f00c61c47b15a8ed2fe5b553f3c6c Mon Sep 17 00:00:00 2001 From: Leonhard Masche Date: Sat, 18 Jun 2022 16:30:34 +0000 Subject: [PATCH] dependabot, labeler, testing --- .github/dependabot.yml | 16 ++++++++++++++++ .github/labeler.yml | 14 ++++++++++++++ .github/workflows/ci.yml | 8 +++++++- .github/workflows/labeler.yml | 9 +++++++++ src/main.ts | 8 +++----- src/styles.scss | 14 +++++++++++++- 6 files changed, 62 insertions(+), 7 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/labeler.yml create mode 100644 .github/workflows/labeler.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..0ae41b7 --- /dev/null +++ b/.github/dependabot.yml @@ -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 diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 0000000..f0de359 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,14 @@ +readme: + - 'README.md' + +plugin: + - 'src/main.ts' + +styles: + - 'src/styles.scss' + +automation: + - '.github/workflows/*' + +wontfix: + - 'LICENSE' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e888689..6069e79 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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/') diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 0000000..e25f426 --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,9 @@ +on: pull_request + +jobs: + label: + runs-on: ubuntu-latest + + steps: + - name: Labeler + uses: actions/labeler@v4.0.0 diff --git a/src/main.ts b/src/main.ts index 386d794..1248a1f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -29,7 +29,7 @@ export default class ObsidianFunctionPlot extends Plugin { async functionPlotHandler(source: string, el: HTMLElement, _ctx: MarkdownPostProcessorContext): Promise { 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] @@ -66,10 +66,8 @@ export default class ObsidianFunctionPlot extends Plugin { el.querySelectorAll('text').forEach(el => el.setAttribute('fill', 'currentColor')) } catch (e) { el.innerHTML = ` -
-

- ${e}\n\n${source} -

+
+

${e}\n\n${source}

` } } diff --git a/src/styles.scss b/src/styles.scss index 2a34ef0..a0fabc3 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -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; + } +}