Skip to content

Commit

Permalink
Merge branch 'main' of github.com:GavinRigsby/obsidian-embed-and-edit…
Browse files Browse the repository at this point in the history
…-code
  • Loading branch information
Gavin (from ESP) committed Feb 21, 2024
2 parents 1b7d601 + ad8c08c commit 2305ea0
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 5 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# 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
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm install
- run: npm run build --if-present
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ You no longer have to open another editor just to view or edit a certain code fi
This plugin allows to embed code files from Obsidian vault or remote file (eg., GitHub). It works better with live preview feature of Obsidian.

### Additional Changes
Additional changes were made to the embed display to add a better fitting title bar (closer resemblace to the code block).
Modified some buttons and styles to the embed display to allow better usability.
Allowed for local filepaths to be used in embed display.
Open VSCode Editor from embedded code file.
Create code buttons creates the file in the current directory (no longer the root)
* Additional changes were made to the embed display to add a better fitting title bar (closer resemblace to the code block).
* Modified some buttons and styles to the embed display to allow better usability.
* Allowed for local filepaths to be used in embed display.
* Open VSCode Editor from embedded code file.
* Create code buttons creates the file in the current directory (no longer the root).
* Clicking Edit button and returning to the page with embeded code will automatically update (5 second max wait).
* Clicking Refresh button will automatically update the code (No longer have to edit block then rebuild).

## Using the embed block
First you need to activate the plugin from Community Plugins. Then you can embed the code as follow:
Expand Down Expand Up @@ -60,8 +62,10 @@ The `PATH`, `LINES` and `TITLE` properties are set as YAML key-value paris:

* `PATH` should be the file to embed from the vault or a remote address. If you use github make sure to use `https://raw.githubusercontent.com/...`
* `LINES` will include only the specified lines of code. The set of included lines will append dots (`...`) to show any excluded lines in the file.
* `FUNCTION` will include only the specified funcitons. The set of included lines will append dots (`...`) to show any excluded lines in the file.
* `TITLE` will set the title displayed above the embeded code. If the `TITLE` is not set then the filename of the embeded file will be displayed.


## Using Obsidian VSCode Editor

### Basic features
Expand Down

0 comments on commit 2305ea0

Please sign in to comment.